Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Opening transmission to same (responding) device on ANOTHER channel

I may have a massive misunderstanding here....

Using nRF52, SDK 14.2, Ant S212.

I use a background scan to discover devices on channel 0, with a beacon on channel 1.

Once I discover a device, I have to initiate an advanced burst to the discovered device on channel 3 (master) and channel 2 (slave).

So on

Device A (node_id = XX)                                                     Device B (node_id = YY)

Channel 0 (scan)                                          <-                     Channel 1 (Master)

Channel 1 (master)                                        ->                    all other devices

Channel 2 (advanced burst slave)                <-

Channel 3 (advanced burst master)             ->

Then:

Device A (XX) discovers Device B with node_id = YY

How does one initiate an advanced burst between Device A (XX) and Device B (YY) on Device A Channel 3 to Device B Channel 2?

I've tried setting the Device A advanced burst device_id to YYY but that doesn't seem to be the right thing to do.

What one would have expected is a destination address in the transmission packet, but I can't find that functionality in ANT 212.

This does noot work:

ant_channel_config_t master_channel_config =
{
.channel_number = BURST_MASTER_CHANNEL_NUMBER,
.channel_type = CHANNEL_TYPE_MASTER,
.ext_assign = 0x00,
.rf_freq = BURST_RF_FREQ,
.transmission_type = BURST_TRANS_TYPE,
.device_type = CHAN_ID_DEV_TYPE,
.device_number = device_number,    // on device A, tried setting this to YY (device B)
.channel_period = BURST_CHAN_PERIOD,
.network_number = NETWORK_NUM,
};

  • I recommend to check out the ANT_Message_Protocol_and_Usage_Rev_5.1.pdf document.

    In chapter 5.3 Establishing a channel (page 21) you can find how to establish a channel that a master and a slave can use for communication. Once you have established communication between the master and slave, then the default data type used for communication is Broadcast. A Broadcast packet will be sent at every channel period from the master to the slave unless other data type is used. 

    The master or slave may at any time send data, in either direction with another data type. The data types to choose between are

    - Broadcast (sd_ant_broadcast_message_tx() - default)
    - Acknowledged (sd_ant_acknowledge_message_tx())
    - Burst (sd_ant_burst_handler_request())
    - Advanced Burst (sd_ant_adv_burst_config_set, and then sd_ant_burst_handler_request())

    See chapter 5.4 ANT Data types (page 22) for more information about the data types.

    What I think is important to understand is that you don't change channel to send a different data type, you can send whatever data types you like, at any time between a master and a slave using the above API calls. It will default back to Broadcast if no other data type is used.

    I believe there are example showing all data types in the SDK, but you may also find this useful:
    https://devzone.nordicsemi.com/f/nordic-q-a/8831/how-to-reach-maximum-speed-in-ant-advanced-burst-mode 

  • Thank you.

    I have read that document. 

    My question is, what should the Device # (referring too page 21) be if I wanted to set up a channel to a specific slave?

    Should the slave Device # contain the Master's device #? And should the master ALWAYS have its own device # in it's master channel setup?

  • Hi, the master must set all Channel ID parameters, while the slave can set one or more of the Channel ID parameters to wildcard ('0') to search for a the master.

  • I get that. 

    So devices always have to REQUEST from a master?

    So Slave channel sets all communications params AND device_id OF THE MASTER, then opens slave channel. Master device is "found", then slave sends "send me your data" command? Is that correct? 

  • The master will transmit at every channel period, the slave will synchronize to this channel period. Seen from the master it may not know if anyone is actually receiving the data unless the master try to send an acknowledge data (which will only be success if someone is listening), or that the slave send some data in reverse direction (for instance to request data). This is something you can implement based on your way of using the ANT channel, but there is no specific need to do so in most cases. For instance if the master is a temperature sensor, it doesn't need to know if anyone is receiving the temperature data at all times, it will just broadcast it's data at a given interval for anyone to receive.

Related