Example for updating the MTi-1's firmware. Uses a platform independent, retargetable pure C implementation of the firmware updater protocol.

Dependencies:   mbed-rtos mbed

Embed: (wiki syntax)

« Back to documentation index

xbusparser.h File Reference

xbusparser.h File Reference

Go to the source code of this file.

Data Structures

struct  XbusParserCallback
 Callback function structure for use with the XbusParser. More...

Functions

size_t XbusParser_mem (void)
 Get the amount of memory needed for the XbusParser structure.
struct XbusParser * XbusParser_create (struct XbusParserCallback const *callback)
 Create a new XbusParser object.
void XbusParser_destroy (struct XbusParser *parser)
 Frees an XbusParser structure allocated by XbusParser_create().
struct XbusParser * XbusParser_init (void *parserMem, struct XbusParserCallback const *callback)
 Initializes an XbusParser in the passed memory location.
void XbusParser_parseBuffer (struct XbusParser *parser, uint8_t const *buf, size_t bufSize)
 Parse a buffer of data received from a motion tracker.

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 xbusparser.h.


Function Documentation

struct XbusParser* XbusParser_create ( struct XbusParserCallback const *  callback ) [read]

Create a new XbusParser object.

Parameters:
callbackPointer to callback structure containing callback functions for memory management and handling received messages.
Returns:
Pointer the new XbusParser structure.

Uses malloc to allocate the memory required for the parser.

Definition at line 71 of file xbusparser.c.

void XbusParser_destroy ( struct XbusParser *  parser )

Frees an XbusParser structure allocated by XbusParser_create().

Definition at line 85 of file xbusparser.c.

struct XbusParser* XbusParser_init ( void *  parserMem,
struct XbusParserCallback const *  callback 
) [read]

Initializes an XbusParser in the passed memory location.

Parameters:
parserMemPointer to memory to use for storing parser state. Should be at least as big as the value returned by XbusParser_mem().
callbackPointer to callback structure containing callback functions for memory management and handling received messages.
Returns:
Initialized XbusParser structure.

Definition at line 99 of file xbusparser.c.

size_t XbusParser_mem ( void   )

Get the amount of memory needed for the XbusParser structure.

Definition at line 57 of file xbusparser.c.

void XbusParser_parseBuffer ( struct XbusParser *  parser,
uint8_t const *  buf,
size_t  bufSize 
)

Parse a buffer of data received from a motion tracker.

Definition at line 218 of file xbusparser.c.