Skip to content

Commit

Permalink
Decoders, power profile
Browse files Browse the repository at this point in the history
  • Loading branch information
eivholt committed Jan 14, 2020
1 parent 01f7372 commit a87f8d4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
17 changes: 17 additions & 0 deletions GotMailWhisperNodeLoRaWAN/AllThingsTalk/PayloadFormatABCL.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "mailboxsensor",
"comment": "Sent when lid opens, with battery voltage.",
"version": "1.0.0",
"sense": [
{
"asset": "Voltage",
"value": {
"byte": 0,
"bytelength": 2,
"type": "integer",
"signed": false
},
"comment": "Voltage value as millivolts."
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function Decoder(bytes, port) {
// Decode an uplink message from a buffer
// (array) of bytes to an object of fields.
var decoded = {};

if (port === 1) decoded.battery = (bytes[0]<<8 | bytes[1]);

return decoded;
}
Binary file modified GotMailWhisperNodeLoRaWAN/Tx13_3v.otii
Binary file not shown.

0 comments on commit a87f8d4

Please sign in to comment.