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

Parents
  • Hi

    If you're not calling ant_search_init(), the stack will use the default search priority. By default I think ANT will first search in low priority mode, before moving to high priority after a defined amount of time. If you call ant_search_init() and set the high priority right away that should do the trick I'd think.

    Best regards,

    Simon

  • Hi Simon,

    I made this function :

    /**@brief Initialize ant search Rixtronix LAB 8Apr22
     */
     static void ant_search_initialize()
     {
    	 ret_code_t err_code;
    	  const ant_search_config_t bs_search_config =
        {
            .channel_number        = ANT_BS_CHANNEL_NUMBER,
            .low_priority_timeout  = ANT_LOW_PRIORITY_TIMEOUT_DISABLE,
            .high_priority_timeout = ANT_HIGH_PRIORITY_SEARCH_DISABLE,
            .search_sharing_cycles = ANT_SEARCH_SHARING_CYCLES_DISABLE,
            .search_priority       = ANT_SEARCH_PRIORITY_DEFAULT,
            .waveform              = ANT_WAVEFORM_DEFAULT,
        };
    		 err_code = ant_search_init(&bs_search_config);
        APP_ERROR_CHECK(err_code);
     }	 
    

    Where can I call it ?

    before main loop and after channell open ?

    Regards,

    Rixtronix

Reply
  • Hi Simon,

    I made this function :

    /**@brief Initialize ant search Rixtronix LAB 8Apr22
     */
     static void ant_search_initialize()
     {
    	 ret_code_t err_code;
    	  const ant_search_config_t bs_search_config =
        {
            .channel_number        = ANT_BS_CHANNEL_NUMBER,
            .low_priority_timeout  = ANT_LOW_PRIORITY_TIMEOUT_DISABLE,
            .high_priority_timeout = ANT_HIGH_PRIORITY_SEARCH_DISABLE,
            .search_sharing_cycles = ANT_SEARCH_SHARING_CYCLES_DISABLE,
            .search_priority       = ANT_SEARCH_PRIORITY_DEFAULT,
            .waveform              = ANT_WAVEFORM_DEFAULT,
        };
    		 err_code = ant_search_init(&bs_search_config);
        APP_ERROR_CHECK(err_code);
     }	 
    

    Where can I call it ?

    before main loop and after channell open ?

    Regards,

    Rixtronix

Children
No Data
Related