Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Request / Response

Rank

Total Posts: 9

Joined 2014-01-13

PM

If Ive understood correctly, certain messages sent to the Ant devices elicit responses. However, as far as I can tell, the response only contains the message ID ('type') of the initiating request, and doesnt contain any sort of correlation identifier.

Does the Ant device guarantee that a response will always be sent to such messages, or do I have to handle the potential case that the response may never arrive (for whatever reason)?

If the response could potentially never arrive back, or could take too long a time (due to load on the device etc), and the caller times out while waiting, how do you handle the situation where there could be two different messages with the same message ID sent, and the response to the first message eventually returns to the caller, but since the 1st caller has timed out and moved on, the second caller receives the response to the first message (does that make sense)? This now leaves a second response pending to be returned. Obviously this really messes with any state machine.

How do people typically handle this request/response protocol without any request message correlation ID?

Thanks again

N

     
Rank

Total Posts: 19

Joined 2013-11-21

PM

Have you considered possibly using Shared Channels?

See Section 5.6 (page 26 of 127) of ANT Message Protocol and Usage, Rev 5.0.      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

When you sent a message that has a response to ANT (e.g., set channel ID), you are guaranteed that ANT will send back the response. If you miss the responses, it is likely there is a problem in the serial communication with ANT.

There is no sequencing that you can use to match request to response, except that the ID of the message that triggered the response is included. So if you requested to set channel ID, the response contains the Set Channel ID Message ID in it. It is up to the application to track the responses it is expecting based on the messages sent.

Are there specific messages that you are concerned of?      
Rank

Total Posts: 9

Joined 2014-01-13

PM

Thanks. No specific ones - this was a general protocol question. Ive been reading the Ant protocol guide, and although I saw a list of the messages and a flag stating whether a response was expected to certain messages, I didnt see a table that listed the response msg IDs - does such a table of Request Msg ID --> Response Msg ID exist? While several messages result in a response message of 0x40 (for example), some others return different message types. Im looking for a table detailing the full request/response cycle.      
Rank

Total Posts: 9

Joined 2014-01-13

PM

enniom - 14 January 2014 07:43 PM
Have you considered possibly using Shared Channels?

See Section 5.6 (page 26 of 127) of ANT Message Protocol and Usage, Rev 5.0.


It was my understanding that shared channels could only be setup by the Master - Im writing a slave/receiver application to process multiple data streams so I dont think Shared Channels are applicable to my use case (I think) grin )      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

Pretty much for all messages that indicate they do have a reply, the response is the Channel Response Message (0x40). The exception is the Request Message (0x4D), where the response is the message requested (e.g., if you request capabilities, the response will be a capabilities message).