CA-SDK protocol document?

By fredw , 2 May 2014

Is there a document that describes the message set between the MPU-9250 and the PC? We'd like to replace the python program with our own custom app and it would be nice to just have the message spec rather than having to figure it out from the code.

Thanks!

fredw

11 years 10 months ago

Nvm - looks like it's pretty simple. Here are some notes in case anyone else comes along asking the same question:

The outgoing packets are 23 bytes long, fixed.  The first character (sync char) is '$' followed by a packet type, then a priority.  There is always a CRLF at the end.
packet types:
#define PACKET_DEBUG (1)
#define PACKET_QUAT (2)
#define PACKET_DATA (3)
#define PACKET_OTHER_SENSORS (4)
#define PACKET_ROT_MAT (5)
#define PACKET_EULER (6)
#define PACKET_HEADING (7)

The priority field indicates the data type for data packets:
PACKET_DATA_ACCEL = 0,
PACKET_DATA_GYRO,
PACKET_DATA_COMPASS,
PACKET_DATA_QUAT,
PACKET_DATA_EULER,
PACKET_DATA_ROT,
PACKET_DATA_HEADING,
PACKET_DATA_OTHER_SENSORS

Data packets sent with void eMPL_send_data(unsigned char type, long *data) {

Debug packets sent with int _MLPrintLog(int priority, const char* tag, const char* fmt, ...) {

The header for that function describes the protocol a bit:
/**
* @brief Prints a variable argument log message.
* USB output will be formatted as follows:n
* packet[0] = $n
* packet[1] = packet type (1: debug, 2: quat, 3: data)n
* packet[2] = n for debug packets: log priorityn
* for quaternion packets: unusedn
* for data packets: packet content (accel, gyro, etc)n
* packet[3-20] = datan
* packet[21] = \rn
* packet[22] = \n
* @param[in] priority Log priority (based on Android).
* @param[in] tag File specific string.
* @param[in] fmt String of text with optional format tags.
*
* @return 0 if successful.
*/
phpbb Post ID
24981
phpbb Topic ID
16125