This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to use nRF51422( with S210) to match the ANT Mesh Network?

Dear all:

I want to constantly transmit messages from a nRF51422 to an other nRF51422 with specific ID by ANT protocol. Then, I want to receive the messages from one to another. And the messages should include the ID and the RSSI information. So, I want to know the process to set the function provided by s210. 1、How to set the ID of a nRF51422 ? 2、How to transmit a message including ID and RSSI from one nRF51422 to another nRF51422 ? 3、How a nRF51422 receive a message from a nRF51422 with specific ID ?

In addition:what's the difference between the functions as below? (1) sd_ant_broadcast_message_tx (uint8_t ucChannel, uint8_t ucSize, uint8_t *aucMesg) (2) sd_ant_acknowledge_message_tx (uint8_t ucChannel, uint8_t ucSize, uint8_t *aucMesg)

Parents
  • Hi,

    If you look at the broadcast tx/rx example you see the usage of sd_ant_channel_id_set where the id is defined.

     // You can supply your rx with the following code:
    // RSSI has to be setup BEFORE the channel is opened.
        /* Enable RSSI level for received messages */
        sd_ant_lib_config_set(0x6E); // needed to get both rssi and device id
        sd_ant_lib_config_set(ANT_LIB_CONFIG_MESG_OUT_INC_RSSI);
        sd_ant_lib_config_set(ANT_LIB_CONFIG_MESG_OUT_INC_DEVICE_ID);
    
        // and your TX:
         // RSSI has to be setup BEFORE the channel is opened.
            /* Enable RSSI level for received messages */
            sd_ant_lib_config_set(ANT_LIB_CONFIG_MESG_OUT_INC_RSSI);
    

    I used the parameters from the broadcast example.

    As for your second question, the acknowledge message will ask the received to acknowledge the message, resulting in a EVENT_TRANSFER_TX_COMPLETED or failed event.

    Cheers!

Reply
  • Hi,

    If you look at the broadcast tx/rx example you see the usage of sd_ant_channel_id_set where the id is defined.

     // You can supply your rx with the following code:
    // RSSI has to be setup BEFORE the channel is opened.
        /* Enable RSSI level for received messages */
        sd_ant_lib_config_set(0x6E); // needed to get both rssi and device id
        sd_ant_lib_config_set(ANT_LIB_CONFIG_MESG_OUT_INC_RSSI);
        sd_ant_lib_config_set(ANT_LIB_CONFIG_MESG_OUT_INC_DEVICE_ID);
    
        // and your TX:
         // RSSI has to be setup BEFORE the channel is opened.
            /* Enable RSSI level for received messages */
            sd_ant_lib_config_set(ANT_LIB_CONFIG_MESG_OUT_INC_RSSI);
    

    I used the parameters from the broadcast example.

    As for your second question, the acknowledge message will ask the received to acknowledge the message, resulting in a EVENT_TRANSFER_TX_COMPLETED or failed event.

    Cheers!

Children
No Data
Related