Close ANT HRM channel and save to SDcard ?

Dear Members,

How can I stop ANT HRM channel temporarily, and save the heart rate value on to SDcard ?

My code at static void page0_data_log(ant_hrm_page0_data_t const * p_page_data),

err_code = sd_ant_channel_close(HRM_CHANNEL_NUM);
APP_ERROR_CHECK(err_code);
        
        log_hrm(p_page_data->computed_heart_rate); //log HRM value 8Dec21 Rixtronix LAB
        //open the channel
        err_code=sd_ant_channel_open(HRM_CHANNEL_NUM);
        APP_ERROR_CHECK(err_code);

Please revise me ?

Thanks

Parents Reply
  • the event that indicate the channel is closed ,which event ? thanks...

    code :

     
    		err_code = sd_ant_channel_close(HRM_CHANNEL_NUM);
         APP_ERROR_CHECK(err_code);
    		
    		 if (err_code==NRF_SUCCESS )
    			 {
    				 
    		      err_code = sd_ant_channel_unassign(HRM_CHANNEL_NUM); 
    				 NRF_LOG_INFO("WRITE HRM TO SDcard Page 0...\r\n");
    		
    				 
    			 }

    Please correct me the sequence and where should I put that sequence of closing the channel, write to SDcard and reopen again ?

    Thanks

Children
Related