Hi
I inherited a code-base for connecting to a custom Bike Speed and Cadence (SCS) device, which was based on the ANTPlusDemo android source code, and is used for research purposes. I now need to connect to a second custom SCS device, and hope to continue to build upon my code base and change as little as possible. However, the method for distinguishing between and decoding incoming messages in ANTPlusDemo appears to require a unique channel number, which is extracted from the incoming message of a master device (e.g. HR, WEIGHT, SDM, SCS). Both of my devices transmit the same number (for the SPEED_CADENCE_CHANNEL).
I know the full channel ID of both devices, which are distinct only by their device numbers, and the data message format (they measure different things). Is there a way, for instance, of extracting the device number from an incoming AntRxMessage?
I.e:
case AntMesg.MESG_CHANNEL_ID_ID:
short deviceNum = (short) ((ANTRxMessage[AntMesg.MESG_DATA_OFFSET + 1]&0xFF; | ((ANTRxMessage[AntMesg.MESG_DATA_OFFSET + 2]&0xFF;) << 8)) & 0xFFFF);
works to extract the device number, but only in the case of MESG_CHANNEL_ID_ID. Is the device number transmitted in every message sent from a master, so that I may simply call the correct decode() function for each incoming message based on device number? How might I extract it from the ANTRxMessage?
Thanks.