You are here: Forum Home → ANT Developers Forums → ANT in Mobile Phones → Thread
return_value = sd_ant_event_get(&ant;_channel, &event;, event_message_buffer);
if (return_value == NRF_SUCCESS)
{
// Handle event
switch (event)
{
case EVENT_RX:
handle_channel_event(event, 0, 0, event_message_buffer);
break;
default:
break;
}
}
static void handle_channel_event(uint32_t event, uint8_t add, uint32_t data,uint8_t * p_event_message_buffer)
{
uint32_t return_value;
switch (event)
{
case EVENT_RX:
switch (p_event_message_buffer[1])
{
/* Acknowledged data recieved */
//case MESG_BROADCAST_DATA_ID:
case MESG_ACKNOWLEDGED_DATA_ID: //Necessary to check acknowledged data in embedded systems
switch (p_event_message_buffer[ANT_OP_ID])
{
case START_MEAS:
check = 1;
break;
case CHANNEL_COM:
break;
case PCAP_CONFIG:
nrf_gpio_pin_set(LED6);
break;
default:
break;
}
break;
}
default:
break;
}
}