OLE Developer Guide  Latest Git
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Stream Decoder

Detailed Description

Unpack messages from the host.

Files

file  message.h
 The host to device message data structure.
 
file  stream_decoder.h
 Unpack messages from the host.
 

Data Structures

struct  Message
 A de-serialized message. More...
 

Typedefs

typedef void(* MessageHandler )(const Message *)
 A function pointer used to handle new messages. More...
 
typedef void(* MessageHandler )(const Message *)
 A function pointer used to handle new messages. More...
 

Functions

void StreamDecoder_Initialize (MessageHandler handler)
 Initialize the Stream Decoder. More...
 
bool StreamDecoder_GetFragmentedFrameFlag ()
 Get the value of the fragmented frame flag. More...
 
void StreamDecoder_ClearFragmentedFrameFlag ()
 Clear the fragmented frame flag.
 
void StreamDecoder_Process (const uint8_t *data, unsigned int size)
 Decode data from an input stream. More...
 

Typedef Documentation

typedef void(* MessageHandler)(const Message *)

A function pointer used to handle new messages.

Parameters
messageThe message to handle.
typedef void(* MessageHandler)(const Message *)

A function pointer used to handle new messages.

Parameters
messageThe message to handle.

Function Documentation

bool StreamDecoder_GetFragmentedFrameFlag ( )

Get the value of the fragmented frame flag.

This indicates if a fragmented frame has been received. Fragmentation is expensive as it incurs an extra copy.

void StreamDecoder_Initialize ( MessageHandler  handler)

Initialize the Stream Decoder.

Parameters
handlerThe MessageHandler to call with each new message.

If PIPELINE_HANDLE_MESSAGE is defined in app_pipeline.h, the macro will override the handler argument.

void StreamDecoder_Process ( const uint8_t *  data,
unsigned int  size 
)

Decode data from an input stream.

Parameters
dataA pointer to the incoming data.
sizeThe size of the incommig data buffer.

Since this may result in a response being sent, this should only be called if there is space available in the Host TX buffer.