You are here: Forum Home → ANT Developers Forums → ANT General Questions → Thread
/**@brief initialize application
*/
static void continuous_scan_init()
{
uint32_t err_code;
// Set library config to report RSSI and Device ID
err_code = sd_ant_lib_config_set(
ANT_LIB_CONFIG_MESG_OUT_INC_RSSI | ANT_LIB_CONFIG_MESG_OUT_INC_DEVICE_ID);
APP_ERROR_CHECK(err_code);
// Configure channel 0 for scanning mode
ant_channel_config_t channel_config =
{
.channel_number = CT_CHANNEL_NUMBER,
.channel_type = CHANNEL_TYPE_SLAVE,
.ext_assign = 0x00,
.rf_freq = FEC_ANTPLUS_RF_FREQ,
.transmission_type = 0x05u,
.device_type = FEC_DEVICE_TYPE,
.device_number = TACX_DEVICE_NUMBER,
.channel_period = FEC_MSG_PERIOD, // Not used, since this is going to be scanning
.network_number = ANTPLUS_NETWORK_NUMBER,
};
err_code = ant_channel_init(&channel;_config);
APP_ERROR_CHECK(err_code);
// Activate message reception from the slave as well
// This function starts receive scanning mode feature. Channel 0 must be assigned. All other channels must be closed.
err_code = sd_ant_rx_scan_mode_start(0);
APP_ERROR_CHECK(err_code);
}