EVENT_CHANNEL_CLOSED ?

Dear Members,

How can I scan continously if I loss the sensor,

I have made at this function :

static void ant_evt_handler(ant_evt_t * p_ant_evt, void * p_context)

case EVENT_CHANNEL_CLOSED:
									  NRF_LOG_INFO("EVENT_CHANNEL_CLOSED...\r\n");
								    NRF_LOG_INFO("BSP_INDICATE_SCANNING...\r\n");//31Mar22 Rixtronix LAB
                    
								     err_code = bsp_indication_set(BSP_INDICATE_SCANNING);
					
								    nrf_pwr_mgmt_feed(); //Function for indicating activity.
								    
								
                    break;

but it's not scanning when it loss the sensor ,

Any clues ?

Kind regards,

Rixtronix

  • Hi Kenneth,

    Thanks for the reply,

    Do you know which function for detecting if there's a ANT+ sensor around?

    So the event : if there's sensor detected, open the channel,

    Regards,

    Rixtronix LAB

  • Hi Kenneth,

    Thanks for the reply,

    Is it possible that I scan only and not opening the channel, and the channel is opened by the time there's master / sensor activated.
    Can I scan more than one channel ? 0,1,2, HRM,BSC and BPWR
    The code :

    E:\nRF5_SDK_17.0.2_d674dde\examples\ant\ant_continuous_scanning_controller\main.c

    Line 295 :

    /**@brief initialize application
     */
    static void continuous_scan_init()
    {
        uint32_t err_code;
    
        // Set library config to report RSSI and Device ID
        err_code = sd_ant_lib_config_set(
            ANT_LIB_CONFIG_MESG_OUT_INC_RSSI | ANT_LIB_CONFIG_MESG_OUT_INC_DEVICE_ID);
        APP_ERROR_CHECK(err_code);
    
        // Configure channel 0 for scanning mode, but do not open it.
        // The scanning channel will be opened in scan mode for a short amount of time on a button press.
        ant_channel_config_t channel_config =
        {
            .channel_number    = ANT_SCAN_CHANNEL_NUMBER,
            .channel_type      = CHANNEL_TYPE_SLAVE,
            .ext_assign        = 0x00,
            .rf_freq           = RF_FREQ,
            .transmission_type = CHAN_ID_TRANS_TYPE,
            .device_type       = CHAN_ID_DEV_TYPE,
            .device_number     = 0x00,          // Wildcard
            .channel_period    = 0x00,          // Not used, since this is going to be scanning
            .network_number    = ANT_NETWORK_NUM,
        };
    
        err_code = ant_channel_init(&channel_config);
        APP_ERROR_CHECK(err_code);
    
        // Assign a second channel for sending messages on the reverse direction
        // There is no need to configure any other parameters, this channel is never opened;
        // its resources are used by ANT to send messages in the reverse direction while in
        // continuous scanning mode.
        err_code = sd_ant_channel_assign(ANT_RESPONSE_CHANNEL_NUMBER,
                                         CHANNEL_TYPE_SLAVE,
                                         ANT_NETWORK_NUM,
                                         0x00);
        APP_ERROR_CHECK(err_code);
    }
    

    I can not compile this :
    ..\..\..\..\..\..\components\libraries\util\sdk_errors.h(73): error:  #5: cannot open source input file "nrf_error.h": No such file or directory,

    I got 44 errors similar like above,
    It's already in directory, how can I fix it ?

    Thank you and kind regards,

    Rixtronix LAB

  • Hi Kenneth,

    Thanks for the reply and the examples,

    I read :

    Do you have a similar function like "ANT_OpenRxScanMode" in nRF SDK ?

    Kind regards,

    Rixtronix LAB

  • Hi Kenneth,

    Is there anyway to modify this xml file for fixing the directory issue ?

    Kind regards,

    Rixtronix LAB

  • Hi Kenneth,

    We fixed the path issue,

    Solution :

    Thanks,

    Kind regards,

    Rixtronix LAB

Related