I'm trying to figure out the return values from the listener's onMessage(msg) interrupt.
It looks like "msg" itself is a structure with multiple elements (such as "deviceNumber". And at least one of those elements in "msg" is an 8 byte array that we can get calling "getPayload()". I know a few of the items in "payload", such as [0], [6] and [7].
Any idea where I can get the definitions for what is in "payload" for various ANT devices like a Power Meter, Radar, Shifting, Speed Sensor, Cadence Sensor. And the other elements in "msg" besides "deviceNumber"?
Sorry of this is obvious in the various manuals... I just can seem to find them. Thanks!!
Here is part of my code that works. I just don't know what else is in "msg" and "payload" that might be interesting.
===============
function onMessage(msg) {
var payload = msg.getPayload();
var page = payload[0] & 0x7F;
var devnum = msg.deviceNumber;
var status = (payload[7] >> 4) & 0x7;
var voltage = (payload[7] & 0xF); if (voltage != 0xF) { voltage = voltage + (payload[6] / 256.0); } else { voltage = 0.00; }