AdvancedSerial ProtocolAdvancedSerial ProtocolIn order to communicate sensor data to a client (e.g., a RoboRio robot controller) the navX-MXPsoftware uses a custom protocol. This protocol defines messages sent between the navX-MXPand the client over a serial interface, and includes an error detection capability to ensurecorrupted data is not used by the client.The navX-MXP Serial protocol uses two message types, the legacy ASCII messages initiallyintroduced in the nav6 sensor, and the modern binary messages introduced in the navX-MXP.Source code that implements the navX-MXP ASCII and binary protocols in Java and C++ areprovided to simplify adding support for the navX-MXP protocol to a software project.Message StructureASCII Protocol MessagesEach navX-MXP Serial ASCII protocol message has the following structure:Start of Message Message ID Message Body Message Termination1 byte 1 byte length is message-typedependent4 bytesBinary Protocol MessagesEach navX-MXP Serial Binary protocol message has the following structure:Start ofMessageBinaryMessageIndicatorBinaryMessageLengthMessage ID Message Body MessageTermination1 byte 1 byte 1 byte 1 byte length ismessage-typedependent4 bytesData Type Encoding (ASCII)Base16 encoding is used for ASCII message elements, as follows:Data Type Encoding ExampleFloat (Sign)(100s)(10s)(1s).(10ths)(100ths)‘-132.96’. ‘ 257.38’8-bit Integer (HighNibble)(LowNibble) ‘E9’77