updated readme.md and payload decoders for new test monitor function

This commit is contained in:
Klaus K Wilting 2018-07-24 19:20:54 +02:00
parent a030918f91
commit 08a4370141
3 changed files with 38 additions and 1 deletions

View File

@ -156,7 +156,8 @@ Hereafter described is the default *plain* format, which uses MSB bit numbering.
byte 14: Vendorfilter mode (0=disabled, 1=enabled) [default 0]
byte 15: RGB LED luminosity (0..100 %) [default 30]
byte 16: GPS send data mode (1=on, 0=ff) [default 1]
bytes 17-27: Software version (ASCII format, terminating with zero)
byte 17: Beacon monitor mode (1=on, 0=off) [default 0]
bytes 18-28: Software version (ASCII format, terminating with zero)
**Port #4:** GPS query result
@ -305,6 +306,11 @@ Note: all settings are stored in NVRAM and will be reloaded when device starts.
0 ... 100 percentage of luminosity (100% = full light)
e.g. 50 -> 50% of luminosity [default]
0x11 set Beacon monitor mode on/off
0 = Beacon monitor mode off [default]
1 = Beacon monitor mode on, enables proximity alarm if test beacons are seen
0x80 get device configuration
Device answers with it's current configuration on Port 3.

View File

@ -31,6 +31,17 @@ function Decoder(bytes, port) {
// gps data
return decode(bytes, [latLng, latLng, uint8, hdop, uint16], ['latitude', 'longitude', 'sats', 'hdop', 'altitude']);
}
if (port === 5) {
// button pressed
return decode(bytes, [uint8], ['button']);
}
if (port === 6) {
// beacon proximity alarm
return decode(bytes, [uint8, uint8], ['rssi', 'beacon']);
}
}

View File

@ -19,5 +19,25 @@ function Decoder(bytes, port) {
}
}
return decoded;
if (port === 2) {
var i = 0;
decoded.battery = ((bytes[i++] << 8) | bytes[i++]);
decoded.uptime = ((bytes[i++] << 56) | (bytes[i++] << 48) | (bytes[i++] << 40) | (bytes[i++] << 32) |
(bytes[i++] << 24) | (bytes[i++] << 16) | (bytes[i++] << 8) | bytes[i++]);
decoded.temp = ((bytes[i++] << 24) | (bytes[i++] << 16) | (bytes[i++] << 8) | bytes[i++]);
}
if (port === 5) {
var i = 0;
decoded.button = (bytes[i++]);
}
if (port === 6) {
var i = 0;
decoded.rssi = (bytes[i++]);
decoded.beacon = (bytes[i++]);
}
return decoded;
}