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

Return error code that 0x4015.

I used SDK nRF5_SDK_14.1.0_1dda907.

I added cycling speed and cadence service of BLE and bicycle speed and cadence of ANT+ in ble_ant_app_hrm example of multiprotocol.

If i opened ant hrm disp channel, i did not send bsc packet.
Then success.

But, if i opened ant  bsc disp channel, i did not send bsc packet.
Then return error code that 0x4015.

How to solve it ?

Parents Reply Children
  • Hi, I think we are going a bit in circles here now.

    To be able to help you, I need to know exactly which softdevice api call that return error code 0x4015 (NRF_ANT_ERROR_CHANNEL_IN_WRONG_STATE). So you will need to find which of the sd_ant_channel_assign(), sd_ant_broadcast_message_tx(), sd_ant_channel_open(), sd_ant_network_address_set(), sd_ant_channel_id_set(), sd_ant_channel_radio_freq_set(), or sd_ant_channel_period_set() that is returning 0x4015.

    Once we know which api call that return NRF_ANT_ERROR_CHANNEL_IN_WRONG_STATE, then next step is to find what are the paramters used in the specific softdevice call, and compare with the parameters for the other channel that is configured. 

  • ant_hrm_disp_open(&m_ant_hrm) that is returning 0x4015.

  • What is the Channel Status if you call sd_ant_channel_status_get()?

    What have you set ucTotalNumberOfChannels when calling sd_ant_enable()?

  • What is the Channel Status if you call sd_ant_channel_status_get()?

    Ans. STATUS_SEARCHING_CHANNEL((uint8_t)0x02) ///< Indicates channel is active and in searching state.


    What have you set ucTotalNumberOfChannels when calling sd_ant_enable()?

    Ans. NRF_SDH_ANT_TOTAL_CHANNELS_ALLOCATED = 7

    #define ANT_HRMRX_ANT_CHANNEL        0       /**< Default ANT Channel. */
    #define ANT_HRMRX_DEVICE_NUMBER    0      /**< Device Number. */
    #define ANT_HRMRX_TRANS_TYPE           0      /**< Transmission Type. */
    #define ANTPLUS_NETWORK_NUMBER     0     /**< Network number. */

    #define ANT_BPWRRX_ANT_CHANNEL      1     /**< Default ANT Channel. */
    #define ANT_BPWRRX_DEVICE_NUMBER 0     /**< Device Number. */
    #define ANT_BPWRRX_TRANS_TYPE         0    /**< Transmission Type. */

    #define ANT_BSCRX_ANT_CHANNEL          2    /**< Default ANT Channel. */
    #define ANT_BSCRX_DEVICE_NUMBER     0    /**< Device Number. */
    #define ANT_BSCRX_TRANS_TYPE            0    /**< Transmission Type. */

  • It seems you are trying to open a channel that is already open and searching.

    Sorry to ask, but have you double checked that the log info show that there are different channels here? For instance for HRM:

    <info> ant_hrm: ANT HRM channel 0 init
    <info> ant_hrm: ANT HRM channel 0 open

    But for next channel:

    <info> ant_bsc: ANT BSC channel 1 init
    <info> ant_bsc: ANT BSC channel 1 open

    And so on.

Related