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

ANT connection event - How to know when connects

I'm using SDK 7.1, PCA10028 eval board, SD310 2.0.1, MCP 3.6.0.8331

I have an ANT device, that on a button press, it must wake up, connect to an ANT channel, and send a few bytes of data.

The device is configured as the Master of the channel. I open the channel, but often miss the first few bytes of data - I believe this is because the Master and Slave have not yet sync'ed up.

In ant_parameters.h there is an EVENT_CONNECTION_SUCCESS, but this event is never triggered - does it only apply to the slave side of the connection? Is there a status call or event that lets the ANT master know when master and slave are synchronized (connected)?

Parents
  • #define EVENT_CONNECTION_START                     ((uint8_t)0x3B) ///< Application generated event used to indicate when starting a connection to a channel
    #define EVENT_CONNECTION_SUCCESS                   ((uint8_t)0x3C) ///< Application generated event used to indicate when successfuly connected to a channel
    #define EVENT_CONNECTION_FAIL                      ((uint8_t)0x3D) ///< Application generated event used to indicate when failed to connect to a channel
    #define EVENT_CONNECTION_TIMEOUT                   ((uint8_t)0x3E) ///< Application generated event used to indicate when connecting to a channel has timed out
    #define EVENT_CONNECTION_UPDATE                    ((uint8_t)0x3F) ///< Application generated event used to indicate when connection parameters have been updated
    

    In ant_parameters.h there is an EVENT_CONNECTION_SUCCESS, but this event is never triggered - does it only apply to the slave side of the connection?

    These are internal events passed between the dual ANT and BLE stack of the S310 softdevice, these internal events should not be used by application developers and should be ignored.

    Is there a status call or event that lets the ANT master know when master and slave are synchronized (connected)?

    There is no such status or event, the ANT master will just send messages with a certain interval regardless if a slave is listening or not. If this is something you require you need to implement it into the application. You could use sd_ant_acknowledge_message_tx(), if the slave gets the message you will get EVENT_TRANSFER_TX_COMPLETED, if not you will get EVENT_TRANSFER_TX_FAILED.

Reply
  • #define EVENT_CONNECTION_START                     ((uint8_t)0x3B) ///< Application generated event used to indicate when starting a connection to a channel
    #define EVENT_CONNECTION_SUCCESS                   ((uint8_t)0x3C) ///< Application generated event used to indicate when successfuly connected to a channel
    #define EVENT_CONNECTION_FAIL                      ((uint8_t)0x3D) ///< Application generated event used to indicate when failed to connect to a channel
    #define EVENT_CONNECTION_TIMEOUT                   ((uint8_t)0x3E) ///< Application generated event used to indicate when connecting to a channel has timed out
    #define EVENT_CONNECTION_UPDATE                    ((uint8_t)0x3F) ///< Application generated event used to indicate when connection parameters have been updated
    

    In ant_parameters.h there is an EVENT_CONNECTION_SUCCESS, but this event is never triggered - does it only apply to the slave side of the connection?

    These are internal events passed between the dual ANT and BLE stack of the S310 softdevice, these internal events should not be used by application developers and should be ignored.

    Is there a status call or event that lets the ANT master know when master and slave are synchronized (connected)?

    There is no such status or event, the ANT master will just send messages with a certain interval regardless if a slave is listening or not. If this is something you require you need to implement it into the application. You could use sd_ant_acknowledge_message_tx(), if the slave gets the message you will get EVENT_TRANSFER_TX_COMPLETED, if not you will get EVENT_TRANSFER_TX_FAILED.

Children
No Data
Related