You will want to send your reverse direction (backchannel) message to the radio in response to EVENT_RX. This is the event that you get every time a message is received by the slave. What I am pointing out is that the backchannel message will not actually get sent as a response to that received message, but as a response to the next received message. By the time you have received the EVENT_RX the radio has either replied with the backchannel message it had pending prior to receiving the message from the master, or has not sent a backchannel message because none was pending.
sd_ant_broadcast_message_tx is used for both the master and bidirectional slave. Acknowledged messages are also possible with sd_ant_acknowledge_message_tx, and burst messages with sd_ant_burst_handler_request.
If you want to send periodic data from what you have as ANT slave to ANT master, and the rate of commands is allowed to be lower than the periodic data rate, then you may want to swap which is master and which is slave. If the command rate is typically much lower than the periodic data rate then this is a much better approach. ANT works most efficiently when sending periodic data from the master to the slave. If the number of masters is small, then the slave can open up a channel for each master. If the number of masters is large, then a scanning slave should be used. The slave can send a command in response to each received message, but some will fail due to RF conditions. A slave that wishes to send a command to multiple masters must send a message to each master independently.
If you would need to implement a scanning slave, but the power consumption of scanning is too high, then a shared channel is an option. What would have been a scanning slave becomes a shared channel master. With shared channels the slaves are polled by the master. The master sends a message to the slave by address, and the slave can respond. This means that commands based on data received from the slave must wait until the next time that slave is polled. The master can send a message to all slaves (address 0), but they cannot respond in this case. See section 5.6 of the ANT Message Protocol and Usage document (
https://www.thisisant.com/resources/ant-message-protocol-and-usage/). Note: This shared channels may not be more power efficient than a scanning channel if you have very short channel periods and don't send a new command each time data is polled. With the scanning channel the radio is spending a lot of time receiving. With the shared channel it is spending time sending and receiving. The power spent by the shared master sending is only useful if it is more than a simple polling command, and would have been similarly spent on backchannel messages from the scanning slave.
All that is required for shared channels is to set the channel type using CHANNEL_TYPE_SHARED_SLAVE or CHANNEL_TYPE_SHARED_MASTER from the nRF SDK, and for slaves to send a broadcast message to the radio to set the shared address.
https://www.thisisant.com/resources/an07-auto-shared-channel-master-example/ has a PC based example. ANT Message protocol and Usage section 5.6 and 8.2 will be very useful.
Addresses of slaves on the shared channel are out of the scope of ANT. They are usually handled through a one time setup tool, or by discovering devices broadcasting as an ANT master and assigning them shared addresses and commanding them to join the shared channel over the channel they are a master on.