You are here: Forum Home → ANT Developers Forums → ANT General Questions → Thread
bool pwrSensorOpen = true;
void ant_evt_handler(ant_evt_t * p_ant_evt, void * p_context)
{
printf("%i\n",p_ant_evt->event);
if (p_ant_evt->event == EVENT_CHANNEL_CLOSED) {
pwrSensorOpen = false;
}
}
void changePowermeter(uint16_t powerId)
{
uint32_t err_code = 0;
printf("closing channel\n");
err_code = sd_ant_channel_close(POWER_CHANNEL_NUMBER);
printf("sdacc X\n",err_code);
while (pwrSensorOpen) {
sd_app_evt_wait();
}
printf("closed\n");
}