Data Sheet

Use SYD Dynamics Communication Library
With TransducerM, SYD Dynamics provides dedicated communication library in source code to ease the development effort
required while integrating the TransducerM into your target systems.
C++ Library (Recommended, Full API)
Using the SYD Dynamics C++ library for TransducerM is the most recommended way to interface with TransducerM in your
target applications, as it is very reliable, time saving and can also be easily upgraded to future versions whenever new APIs are
released.
The C++ library can be exported from the ImuAssistant GUI (refer to section ‘Export Communication Library’ on page 19).
Figure 38 shows a typical SYD Dynamics C++ communication library in source code, which can be used independently
(no need for C++ STL support, no third-party library is required in order to make it work).
Below is an example, which will give us a glimpse on how to use the C++ communication library.
Firstly, include necessary header files:
// To use the communication library, we need to include the following
// two header files:
#include "libraryFolder/EasyObjectDictionary.h"
#include "libraryFolder/EasyProfile.h"
Instantiate the communication library:
// Step 1, TransducerM communication library instantiation:
EasyObjectDictionary eOD;
EasyProfile eP(&eOD);
Then implement a function which is called every time new serial data from the TransducerM is available:
/**
* Serial Data Receive - Example
* @note This function is called when new serial data is available
*/
void HelloMotionModule::On_SerialRX(
char* rxData, ///< [INPUT] Pointer to the RX data array
int rxSize ///< [INPUT] Size of the RX data array
){
Ep_Header header;
if(EP_SUCC_ == eP.On_RecvPkg(rxData, rxSize, &header)){ // Step 2: Tell the library that new data has arrived.
// It does not matter if the new data only contains a fraction
// of a complete data package, nor does it matter if the data stream is corrupted
// during the transmission. On_RecvPkg() will only return EP_SUCC_
// when a complete and correct package has arrived.
// Example Reading of the Short ID of the device who sends the data:
uint32 fromId = header.fromId; // Step 3.1: Now we are able to read the received payload data.
Copyright © 2015-2019 SYD Dynamics ApS | www.syd-dynamics.com Page 22 / 33
Figure 38: Communication library (C++ example)