
G.FIT User Guide and Specification, Rev 2.0_Alpha.14
Page 39 of 117
thisisant.
com
7
Serial interface
The extended serial message protocol is used to communicate between the G.FIT module and the application
MCU. In addition to using 2-byte message IDs, the extended serial message protocol is more dynamic than
the standard ANT serial message protocol. For all commands outside of G.FIT functionality, the standard
serial message protocol still applies, as detailed in the
ANT Message Protocol and Usage
document.
1 byte
1 byte
1 byte
1 byte
X byte
1 byte
Sync
Length
Message ID
Payload
Chksum
1 byte
1 byte
1 byte
X byte
1 byte
Sync
Length
Message ID
Payload
Chksum
76543210
||||XXXX--Extended Message type (2=command, 1=request, 0=Response/Event)
XXXX------Extended message indicator (0xE)
Standard Serial Message
Extended Standard Serial Message
Sub Message ID
Figure 7-1. Serial message general packet structure
7.1
Using extended serial messages
The extended serial message protocol defines three types of messages
–
commands, requests and
responses/events. Compared to a standard serial message, an extended serial message is indicated by setting
the top nibble of the message ID to 0xE. The type of extended message is indicated in the following nibble
(command = 0xE2, request = 0xE1 and response/event = 0xE0). The following byte is the sub-message ID,
followed by the payload of the message.
The checksum for both a standard and an extended serial message is calculated as the XOR of all bytes
including the sync byte. The length of a standard message includes the number of bytes in the payload of the
message, whereas for extended serial messages the
length includes the p 1 byte
(to account for
the sub-message ID). As with the standard serial message protocol, the use of optional padding bytes is also
recommended for systems that are slow to react to hardware flow control (when using asynchronous serial
interface).
In general, a command sent by the MCU to G.FIT elicits a response. A request elicits a command message
and an event is an unsolicited message from G.FIT to the MCU. This behavior is illustrated in Figure 7-2.