First message from ANT sensor ?

Dear Members,

Can we do this to capture the first message from ANT transmitter ?

void ant_bsc_disp_evt_handler(ant_evt_t * p_ant_evt, void * p_context)
{
    ant_bsc_profile_t * p_profile = (ant_bsc_profile_t *)p_context;
    NRF_LOG_INFO("ant_bsc_disp_evt_handler\r\n"); 
    if (p_ant_evt->channel == p_profile->channel_number)
    {
        switch (p_ant_evt->event)
        {
            case EVENT_RX:
                if (p_ant_evt->message.ANT_MESSAGE_ucMesgID == SEQUENCE_FIRST_MESSAGE)
								 {
								   1st message;
								 }

Kind regards,

Rixtronix LAB

Parents
  • Can we do this to capture the first message from ANT transmitter ?

    Yes, this will be the first burst message.

  • Hi Sigurd,

    Thanks for the reply,

    We need to save RevCount0 from the sensor, as a base for distance calculation and configuration for Odo meter,

    Attached is the formula

    and the log we got from the receiver and sensor :

    50822V1capture.txt

    Function :

    void ant_bsc_disp_evt_handler(ant_evt_t * p_ant_evt, void * p_context)
    {
        ant_bsc_profile_t * p_profile = (ant_bsc_profile_t *)p_context;
        NRF_LOG_INFO("ant_bsc_disp_evt_handler\r\n"); 
        if (p_ant_evt->channel == p_profile->channel_number)
        {
            switch (p_ant_evt->event)
            {
                case EVENT_RX:
    							  /*********************DEBUG THE message Rixtronix LAB 4Aug22*****************/
    						      NRF_LOG_INFO("p_ant_evt->message.ANT_MESSAGE_ucMesgID 0x%02X", p_ant_evt->message.ANT_MESSAGE_ucMesgID);   
    						      if (p_ant_evt->message.ANT_MESSAGE_ucMesgID == SEQUENCE_FIRST_MESSAGE)
    								 {
    									 //write rev_cnt to eeprom here
    									 NRF_LOG_INFO("First ANT message!\r\n"); 
    								 }	 
    								 if (p_ant_evt->message.ANT_MESSAGE_ucMesgID == MESG_BURST_DATA_ID)
    								 {
    									 //write rev_cnt to eeprom here
    									 NRF_LOG_INFO("MESG_BURST_DATA_ID!\r\n"); 
    									 NRF_LOG_INFO("First ANT message!\r\n");
    								 }	     
    						
                    
    								/*********************DEBUG THE message Rixtronix LAB 4Aug22*****************/ 
    								 
                    if (p_ant_evt->message.ANT_MESSAGE_ucMesgID == MESG_BROADCAST_DATA_ID
                     || p_ant_evt->message.ANT_MESSAGE_ucMesgID == MESG_ACKNOWLEDGED_DATA_ID
                     || p_ant_evt->message.ANT_MESSAGE_ucMesgID == MESG_BURST_DATA_ID)
                    {
                        disp_message_decode(p_profile, p_ant_evt->message.ANT_MESSAGE_aucPayload);
    									  NRF_LOG_INFO("p_ant_evt->message.ANT_MESSAGE_ucMesgID 0x%02X", p_ant_evt->message.ANT_MESSAGE_ucMesgID); 
                    }
                    break;
                default:
                    break;
            }
        }
    }

    Await for the response,

    Kind regards,

    Rixtronix LAB

Reply
  • Hi Sigurd,

    Thanks for the reply,

    We need to save RevCount0 from the sensor, as a base for distance calculation and configuration for Odo meter,

    Attached is the formula

    and the log we got from the receiver and sensor :

    50822V1capture.txt

    Function :

    void ant_bsc_disp_evt_handler(ant_evt_t * p_ant_evt, void * p_context)
    {
        ant_bsc_profile_t * p_profile = (ant_bsc_profile_t *)p_context;
        NRF_LOG_INFO("ant_bsc_disp_evt_handler\r\n"); 
        if (p_ant_evt->channel == p_profile->channel_number)
        {
            switch (p_ant_evt->event)
            {
                case EVENT_RX:
    							  /*********************DEBUG THE message Rixtronix LAB 4Aug22*****************/
    						      NRF_LOG_INFO("p_ant_evt->message.ANT_MESSAGE_ucMesgID 0x%02X", p_ant_evt->message.ANT_MESSAGE_ucMesgID);   
    						      if (p_ant_evt->message.ANT_MESSAGE_ucMesgID == SEQUENCE_FIRST_MESSAGE)
    								 {
    									 //write rev_cnt to eeprom here
    									 NRF_LOG_INFO("First ANT message!\r\n"); 
    								 }	 
    								 if (p_ant_evt->message.ANT_MESSAGE_ucMesgID == MESG_BURST_DATA_ID)
    								 {
    									 //write rev_cnt to eeprom here
    									 NRF_LOG_INFO("MESG_BURST_DATA_ID!\r\n"); 
    									 NRF_LOG_INFO("First ANT message!\r\n");
    								 }	     
    						
                    
    								/*********************DEBUG THE message Rixtronix LAB 4Aug22*****************/ 
    								 
                    if (p_ant_evt->message.ANT_MESSAGE_ucMesgID == MESG_BROADCAST_DATA_ID
                     || p_ant_evt->message.ANT_MESSAGE_ucMesgID == MESG_ACKNOWLEDGED_DATA_ID
                     || p_ant_evt->message.ANT_MESSAGE_ucMesgID == MESG_BURST_DATA_ID)
                    {
                        disp_message_decode(p_profile, p_ant_evt->message.ANT_MESSAGE_aucPayload);
    									  NRF_LOG_INFO("p_ant_evt->message.ANT_MESSAGE_ucMesgID 0x%02X", p_ant_evt->message.ANT_MESSAGE_ucMesgID); 
                    }
                    break;
                default:
                    break;
            }
        }
    }

    Await for the response,

    Kind regards,

    Rixtronix LAB

Children
No Data
Related