This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

what's "CHANNEL_IN_WRONG_STATE" ?

hello,

Have any example about how to use "CHANNEL_IN_WRONG_STATE" ?

I don't know how to use it. and also don't know when softdevice return this even.

///< Command response on attempt to perform an action from the wrong channel state

#define CHANNEL_IN_WRONG_STATE ((uint8_t)0x15)


condition: nrf51422/s310

Parents
  • What about sending broadcast, when CHANNEL_0 is (for instance) uninitialized, i.e. sd_ant_channel_status_get returns STATUS_UNASSIGNED_CHANNEL in statusCh0?

    #define CHANNEL_0 0x00
    uint8_t statusCh0;
    
    err_code = sd_ant_broadcast_message_tx(CHANNEL_0, BROADCAST_DATA_BUFFER_SIZE, m_broadcast_data);
    APP_ERROR_CHECK(err_code);
    
    err_code = sd_ant_channel_status_get(CHANNEL_0, &statusCh0);
    APP_ERROR_CHECK(err_code);
    
Reply
  • What about sending broadcast, when CHANNEL_0 is (for instance) uninitialized, i.e. sd_ant_channel_status_get returns STATUS_UNASSIGNED_CHANNEL in statusCh0?

    #define CHANNEL_0 0x00
    uint8_t statusCh0;
    
    err_code = sd_ant_broadcast_message_tx(CHANNEL_0, BROADCAST_DATA_BUFFER_SIZE, m_broadcast_data);
    APP_ERROR_CHECK(err_code);
    
    err_code = sd_ant_channel_status_get(CHANNEL_0, &statusCh0);
    APP_ERROR_CHECK(err_code);
    
Children
  • thanks. I only use "sd_ant_channel_status_get" and I get data from &statusCh0.

    because my project is ANT receiver, I get 0x00 when 51422 is uninitialized, I get 0x43 when 51422 is in EVENT_RX_FAIL , I get 0x41 when 51422 is in EVENT_RX_SEARCH_TIMEOUT,

  • It looks correct. Receive-only slave status:

    • 0x00 when unassigned/uninitialized
    • 0x43 when connected to master
    • 0x42 when master is lost, but slave not yet timed out (still searches for a master)
    • 0x41 when slave's timeout expired
Related