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

nRF52 SDK ANT example "ant_scan_and_forward" example MAX_DEVICES limit?

The nRF52 SDK ANT example "ant_scan_and_forward/" configures a device linit of (16-1)=15 in this line:

// Public Definitions
#define MAX_DEVICES ((uint8_t) 16) /**< Maximum number of devices in that can be registered */

Is there a particular reason for this limit? 

I cannot test larger limits as I don't have that many devices.

Thanks,

Steph

  • Hi,

    I think you can safely increase the number of MAX_DEVICES up to 0xFE without any changes to the code, because 0xFF is reserved value - used to indicate that node ID is invalid. If you want to increase the value further you need to make some changes in the code. For instance, node address is held within uint8_t variables and one byte in ANT transmitting buffer is allocated for the address value.

    Best Regards,

    Martin

  • Hi Martin

    Thank you.

    I have a question re adding burst or advanced burst to the scan and forward:

    If M1 sends a beacon, S1 receives and replies to M1 with "send me an update using advanced burst", M1 receives and sends advanced burst to S1.

    Will this work? I have combined advanced burst into the example and I can send advanced burst on keypress (on demand), but not yet triggered by ACK from S1.

    If this doesn't meet protocol requirements, how should I increase the scan_and_forward buffer to send 24 bytes as had been suggested earlier? I would have to send updates around the network piecemeal in that case (i.e. one sensor per data page).

    Your feedback will be invaluable. 

    Steph

  • I changed the nod_id to uint16_t.

    Hint: Make sure that MAX_DEVICE is a PRIME NUMBER to minimize hash collisions. Alternatively, use quadratic probing or another method.

Related