Hi, I'm using a 51422 with a s210/s310 softdevice. I have some nodes that must exchange some independent data. So I configured the communication to be an independent bidirectional channel.
On both sides of the channel, I use the EVENT_RX to receive data. On the master side, I use the EVENT_TX to call sd_ant_broadcast_message_tx() with new data. On the slave side, I use EVENT_RX to call sd_ant_broadcast_message_tx() with new data.
Now I have the effect, that I see just half of the EVENT_TX events than I see EVENT_RX events. I interpret this as the slave is just broadcasting a new message for every second, received message.
I think the reason, why the system behaves like this is, that when the slave calls sd_ant_broadcast_message_tx() it's already to late for the ant stack to put this into the respond back to the master.
One solution, I could think of would be to use the EVENT_TX event on the slave side to send new messages and to count the number of EVENT_RX events to cope with the situation where the EVENT_TX event got somehow missed (due to channel collision, etc.). With every EVENT_TX event, I send a new message and reset the count. With every EVENT_RX, the counter will be incremented and when it rises over 3, a message would be send too.
I wonder if this sounds reasonable or if there is a much straighter / easier way to implement bidirectional communication at full channel bandwidth.
Thanks for every pointer, thought or comment,
kind regards Torsten