Hello,
In the following code, I have tried to assign a channel to be asychronous so that I can transmit 8 byte acknowledged messages immediately following a button press. However, the call to sd_ant_channel_open() fails with error 0x4015. If I remove the EXT_PARAM_ASYNC_TX_MODE parameter from the channel assign function, then I can open the channel. What am I doing wrong?
Once the channel is open, is it the sd_ant_broadcast_message_tx() I should be using to send the 8 byte message? How do I specify how often it retries?
Thanks.
uint32_t err_code;
const uint8_t chan=0;
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);
// MASTER channel = async Tx
err_code = sd_ant_channel_assign( chan, CHANNEL_TYPE_MASTER, 0, EXT_PARAM_ASYNC_TX_MODE );
APP_ERROR_CHECK(err_code);
// Set Channel id
uint16_t devnum = *(uint32_t *)SERIAL_NUMBER_ADDRESS;
uint8_t devtype = 1;
uint8_t txtype = 0;
err_code = sd_ant_channel_id_set( chan, devnum, devtype, txtype );
APP_ERROR_CHECK(err_code);
// Set channel radio frequency
err_code = sd_ant_channel_radio_freq_set( chan, 77 );
APP_ERROR_CHECK(err_code);
// Channel period = 1000/32768s, but do we need to set this for async Tx???
err_code = sd_ant_channel_period_set( chan, 1000 );
APP_ERROR_CHECK(err_code);
// Set Tx power = 0dBm
err_code = sd_ant_channel_radio_tx_power_set( chan, RADIO_TX_POWER_LVL_3, 0 );
APP_ERROR_CHECK(err_code);
// Open the Tx channel - this fails with error code 0x4015
err_code = sd_ant_channel_open( chan );
APP_ERROR_CHECK(err_code);