You are here: Forum Home → ANT Developers Forums → ANT General Questions → Thread
Ian Haigh
static void ant_channel_rx_broadcast_setup(void)
{
// Configure extended mode, include RSSI
//ret_code_t err_code = sd_ant_lib_config_set(ANT_LIB_CONFIG_MESG_OUT_INC_RSSI | ANT_LIB_CONFIG_MESG_OUT_INC_TIME_STAMP);
ret_code_t err_code = sd_ant_lib_config_set(ANT_LIB_CONFIG_MESG_OUT_INC_RSSI);
APP_ERROR_CHECK(err_code);
ant_channel_config_t broadcast_channel_config =
{
.channel_number = BROADCAST_CHANNEL_NUMBER,
.channel_type = CHANNEL_TYPE_SLAVE,
//.channel_type = CHANNEL_TYPE_SHARED_SLAVE,
.ext_assign = 0x00,
.rf_freq = RF_FREQ,
.transmission_type = CHAN_ID_TRANS_TYPE,
.device_type = CHAN_ID_DEV_TYPE,
.device_number = CHAN_ID_DEV_NUM,
//.device_number = (uint16_t) (NRF_FICR->DEVICEID[0]),
.channel_period = CHAN_PERIOD,
.network_number = ANT_NETWORK_NUM,
};
err_code = ant_channel_init(&broadcast;_channel_config);
APP_ERROR_CHECK(err_code);
// Open channel.
err_code = sd_ant_channel_open(BROADCAST_CHANNEL_NUMBER);
APP_ERROR_CHECK(err_code);
// Configure Tx power for the channel
err_code = sd_ant_channel_radio_tx_power_set(BROADCAST_CHANNEL_NUMBER, RADIO_TX_POWER_LVL_5, 0);
APP_ERROR_CHECK(err_code);
// Set channel search timeout to infinite
err_code = sd_ant_channel_rx_search_timeout_set(BROADCAST_CHANNEL_NUMBER, 255);
//err_code = sd_ant_channel_search_timeout_set(BROADCAST_CHANNEL_NUMBER, 255);
}
Ian Haigh
Ian Haigh
Ian Haigh
Ian Haigh