Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed-rtos mbed Xbus
Fork of MTi-1_example by
Diff: main.cpp
- Revision:
- 14:155f9a55ec51
- Parent:
- 11:8593ba137917
- Child:
- 15:558d279addd9
diff -r dc2aa4678ec7 -r 155f9a55ec51 main.cpp
--- a/main.cpp Tue May 19 13:11:23 2015 +0200
+++ b/main.cpp Tue May 19 13:29:34 2015 +0200
@@ -54,24 +54,24 @@
}
}
-static void mtDataHandler(uint8_t mid, uint16_t dataLength, uint8_t const* data)
+static void mtDataHandler(struct XbusMessage const* message)
{
- if (mid == MTDATA2_MESSAGE_ID)
+ if (message->mid == MTDATA2_MESSAGE_ID)
{
pc.printf("MTData2:");
uint16_t counter;
- if (MtData2_getItem(&counter, XDI_PacketCounter, data, dataLength))
+ if (MtData2_getItem(&counter, XDI_PacketCounter, message->data, message->length))
{
pc.printf(" Packet counter: %5d", counter);
}
float ori[4];
- if (MtData2_getItem(ori, XDI_Quaternion, data, dataLength))
+ if (MtData2_getItem(ori, XDI_Quaternion, message->data, message->length))
{
pc.printf(" Orientation: (% .3f, % .3f, % .3f, % .3f)", ori[0], ori[1],
ori[2], ori[3]);
}
uint32_t status;
- if (MtData2_getItem(&status, XDI_StatusWord, data, dataLength))
+ if (MtData2_getItem(&status, XDI_StatusWord, message->data, message->length))
{
pc.printf(" Status:%X", status);
}
@@ -79,7 +79,7 @@
}
else
{
- pc.printf("Received Xbus message. MID=%X, length=%d\n", mid, dataLength);
+ pc.printf("Received Xbus message. MID=%X, length=%d\n", message->mid, message->length);
}
}

Xsens MTi 1-series