Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

ANT API in Android

Rank

Total Posts: 25

Joined 0

PM

Hi,

a quick question on the following ANT API for Android:
ReceiveMessage(MessageFromAntType messageType, AntMessageParcel messageParcel)

What is the format of the byte array antParcel.getMessageContent() ?
Thanks.
     
RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

When possible the easiest way to interpret the message content is to use the message ID or the MessageFromAntType class to determine what the message type is. Then create a new instance of the message type with the message parcel: ie: new BroadcastDataMessage(messageParcel); each of the message classes has helper methods to decode the data, including the extended information bytes, etc.

If you need to decode it manually, the message content in the AntMessageParcel message is the same bytes and ordering as listed in the ANT Message Protocol Doc EXCEPT the following bytes typically at the beginning and end of a serial message:
-sync byte (handled internally)
-message length byte (can just look at byte[] length)
-the message ID byte (but still available in getMessageId())
-the checksum byte (handled internally)      

Signature

Dynastream Developer