Skip to content

Instantly share code, notes, and snippets.

@RandomGenericUsername
Last active April 17, 2023 21:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RandomGenericUsername/36e25eb6bfa3795555956e965fed9872 to your computer and use it in GitHub Desktop.
Save RandomGenericUsername/36e25eb6bfa3795555956e965fed9872 to your computer and use it in GitHub Desktop.
testDaaS
function XYZDeviceDecoder(args)
{
var bytes = args.bytes;
var port = args.fport;
var status = args.status;
var temperature = bytes[0] || bytes[1] << 8;
var humidity = bytes[2] || bytes[3] << 8;
//return {"temp" : 0, "humidity" : 1};
return {"temperature" : temperature, "humidity" : humidity, "raw" : bytes, "port" : port, "status" : {"value" : 1, "context" : status}};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment