Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

You are here: Forum Home → ANT Developer’s Forums → ANTWareII → Thread

   

ANTWareII generated broadcast messages off-by-one bug

Rank

Total Posts: 2

Joined 2014-01-31

PM

I am currently working with ANTWareII Version 4.1 and two ANTUSB-m sticks.

I think I found a bug. When I open a master channel, which is set as broadcast, the message board shows e.g.
EVENT_TX_0x03
00-00-00-00-00-00-00-2D
:: 40, 00-01-03
EVENT_TX_0x03
00-00-00-00-00-00-00-2E
:: 40, 00-01-03
EVENT_TX_0x03
00-00-00-00-00-00-00-2F
:: 40, 00-01-03
EVENT_TX_0x03
00-00-00-00-00-00-00-30
:: 40, 00-01-03
EVENT_TX_0x03
00-00-00-00-00-00-00-31
:: 40, 00-01-03

I found out, that the last message shown on the master device is actually not yet sent. Thus the master device says "I have sent packet .....31" and the slave says "I have received packet ....30".

This missing message is compensated by the fact that the master sends twice the same message when opening a new channel.
Something like:

master device
board actual packet sent
Opening channel...
sent packet ... 01 ...01
sent packet ... 02 ...01
sent packet ... 03 ...02
sent packet ... 04 ...03
sent packet ... 05 ...04

and so on.

I have spent many hours trying to find a bug in my implementation, that wasn't there. I hope this would save someone from the same issue.      
Avatar
RankRankRankRank

Total Posts: 129

Joined 2010-11-30

PM

The message is first written to the transmit buffer on the chip, and the 'response no error' notifies that this is done successfully. The 'Event Tx' is triggered every time the message in the transmit buffer is sent over the air.

I am guessing at what you are logging here, but I think it is:

00-00-00-00-00-00-00-2D <- Write "2D" to chip
[Response: No Error] <- Written OK
:: 40, 00-01-03 [EVENT_TX_0x03] <- "I have sent packet .....2D"
00-00-00-00-00-00-00-2E <- Write "2E" to chip
[Response: No Error] <- Written OK
:: 40, 00-01-03 [EVENT_TX_0x03] <- "I have sent packet .....2E"
00-00-00-00-00-00-00-2F <- Write "2F" to chip
[Response: No Error] <- Written OK
:: 40, 00-01-03 [EVENT_TX_0x03] <- "I have sent packet .....2F"
00-00-00-00-00-00-00-30 <- Write "30" to chip
[Response: No Error] <- Written OK
:: 40, 00-01-03 [EVENT_TX_0x03] <- "I have sent packet .....30"
00-00-00-00-00-00-00-31 <- Write "31" to chip
[Response: No Error] <- Written OK

"Packet 31" has not been sent yet, but it is sitting in the transmit buffer on the chip waiting to be sent.

If you do not write any new data to be transmitted, then every following 'Event Tx' will be for "Packet 31"      
Rank

Total Posts: 2

Joined 2014-01-31

PM

Ok I realize that the message is first written in the buffer and then sent, and this is the order of the messages in the log. But please have a look at the logs at the bottom with an example of what I state.

Probably the channel is initiated with the first message to be sent (that is "B7"), but that's not shown in the log. Actually the device should load a "B6" message with the opening of the channel.
Currently, at the opening of the channel the master sends twice the same message, causing the misleading "off by one" problem.

What is the meaning of the " :: 40, 00-01-03 "?

Thanks.


MASTER:
Auto-Open Initiated...
> Opening Channel...
EVENT_TX_0x03
00-00-00-00-00-00-00-B7 <--------------------
:: 40, 00-01-03
EVENT_TX_0x03
00-00-00-00-00-00-00-B8 <--------------------
:: 40, 00-01-03
EVENT_TX_0x03
00-00-00-00-00-00-00-B9
:: 40, 00-01-03
EVENT_TX_0x03
00-00-00-00-00-00-00-BA
:: 40, 00-01-03
EVENT_TX_0x03
00-00-00-00-00-00-00-BB
:: 40, 00-01-03
EVENT_TX_0x03
00-00-00-00-00-00-00-BC
:: 40, 00-01-03
EVENT_TX_0x03
00-00-00-00-00-00-00-BD
:: 40, 00-01-03
EVENT_TX_0x03
00-00-00-00-00-00-00-BE
:: 40, 00-01-03
Closing Channel...

SLAVE
Auto-Open Initiated...
> Opening Channel...
Received BROADCAST_DATA_0x4E
:: 4e, 00-00-00-00-00-00-00-00-B7 <--------------------
Received BROADCAST_DATA_0x4E
:: 4e, 00-00-00-00-00-00-00-00-B7 <--------------------
Received BROADCAST_DATA_0x4E
:: 4e, 00-00-00-00-00-00-00-00-B8
Received BROADCAST_DATA_0x4E
:: 4e, 00-00-00-00-00-00-00-00-B9
Received BROADCAST_DATA_0x4E
:: 4e, 00-00-00-00-00-00-00-00-BA
Received BROADCAST_DATA_0x4E
:: 4e, 00-00-00-00-00-00-00-00-BB
Received BROADCAST_DATA_0x4E
:: 4e, 00-00-00-00-00-00-00-00-BC
Closing Channel...