Basic implementation of Xbus message parsing and generation for embedded processors. The code has no dependencies and should also work for other MCU architectures than ARM provided a C99 compiler is available.

Dependents:   MTi-1_example_LPC1768 MTi-1_rikbeun MTi-1_example MTi-1_example

Embed: (wiki syntax)

« Back to documentation index

xbusmessage.h File Reference

xbusmessage.h File Reference

Go to the source code of this file.

Data Structures

struct  XbusMessage
 An Xbus message structure with optional payload. More...
struct  OutputConfiguration
 Output configuration structure. More...

Enumerations

enum  XsMessageId
 

Xbus message IDs.

More...
enum  XsDataIdentifier
 

Xbus data message type IDs.

More...
enum  XbusLowLevelFormat { XLLF_I2c, XLLF_Spi, XLLF_Uart }
 

Low level format to use when formating Xbus messages for transmission.

More...

Functions

size_t XbusMessage_format (uint8_t *raw, struct XbusMessage const *message, enum XbusLowLevelFormat format)
 Format a message into the raw Xbus format ready for transmission to a motion tracker.
bool XbusMessage_getDataItem (void *item, enum XsDataIdentifier id, struct XbusMessage const *message)
 Get a data item from an XMID_MtData2 Xbus message.
char const * XbusMessage_dataDescription (enum XsDataIdentifier id)
 Get a string description for the passed data identifier.

Detailed Description

Copyright (C) Xsens Technologies B.V., 2015.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file xbusmessage.h.


Enumeration Type Documentation

Low level format to use when formating Xbus messages for transmission.

Enumerator:
XLLF_I2c 

Format for use with I2C interface.

XLLF_Spi 

Format for use with SPI interface.

XLLF_Uart 

Format for use with UART interface.

Definition at line 66 of file xbusmessage.h.

Xbus data message type IDs.

Definition at line 50 of file xbusmessage.h.

Xbus message IDs.

Definition at line 30 of file xbusmessage.h.


Function Documentation

char const* XbusMessage_dataDescription ( enum XsDataIdentifier  id )

Get a string description for the passed data identifier.

Definition at line 226 of file xbusmessage.c.

size_t XbusMessage_format ( uint8_t *  raw,
struct XbusMessage const *  message,
enum XbusLowLevelFormat  format 
)

Format a message into the raw Xbus format ready for transmission to a motion tracker.

Definition at line 76 of file xbusmessage.c.

bool XbusMessage_getDataItem ( void *  item,
enum XsDataIdentifier  id,
struct XbusMessage const *  message 
)

Get a data item from an XMID_MtData2 Xbus message.

Parameters:
itemPointer to where to store the data.
idThe data identifier to get.
messageThe message to read the data item from.
Returns:
true if the data item is found in the message, else false.

Definition at line 184 of file xbusmessage.c.