Hello, I want to implement device pairing, using the pairing bit. The pairing bit is set in the masters device type. For a slave to pair with such master, it opens a channel with the device type set to the pairings masters device type and the device number to 0 (aka wildcard). Now, when the slave receives a first message from the master, it should obtain the masters device number and reopen the channel with the correct device number.
How can the slave get the masters device id? In ANT_MESSAGE I don't find any field, where I device number or the channel id is in. On the othere hand, the device number must be somehow communicate over the air.
Edit: In "ANT Message Protocal and Usage" I found a documented message for ANT devices that are connected via a serial interface. The message is named "Channel ID" (page 114) and is transmitted from the ant device to the host. From the documentation it sounds like it could correspond with function named sd_ant_channel_id_get() from ant_interface.h.
This would make sense but: in ant_parameters.h there is a #define MESG_CHANNEL_ID_ID with the same value (0x51) as in the documentation for the "Host / ANT-Device over serial interface" documentation. This would imply that I have to obtain the information (master device number) from an event.
-
Can I use sd_ant_channel_id_get() on a slave side to obtain the masters device number?
-
or do I have to listen / wait for a MESG_CHANNEL_ID_ID event and pick the device number out of the payload from that message?
Thanks in advance and thanks for reading, Torsten