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

Detailed Description

Flags track the occurrence of abnormal events.

A flag is a single-bit variable which can be set when an abnormal event occurs. The next response frame sent to the Host will have the flags-changed bit set, which informs the host it should send a GET_FLAGS command.

On receiving a GET_FLAGS command, the Device sends the packed flags structure as the message payload.

Files

file  flags.h
 The Flags Module.
 

Functions

void Flags_Initialize (TransportTXFunction tx_cb)
 Initialize the Flags sub-system. More...
 
static bool Flags_HasChanged ()
 Check if the flags have changed since the last GET_FLAGS message. More...
 
static void Flags_SetLogOverflow ()
 Set the log overflow flag. More...
 
static void Flags_SetTXDrop ()
 Set the TX Drop flag. More...
 
static void Flags_SetTXError ()
 Set the TX Error flag. More...
 
void Flags_SendResponse (uint8_t token)
 Send a flags message. More...
 

Function Documentation

static bool Flags_HasChanged ( )
inlinestatic

Check if the flags have changed since the last GET_FLAGS message.

Returns
true if the flags have changed, false otherwise.
void Flags_Initialize ( TransportTXFunction  tx_cb)

Initialize the Flags sub-system.

Parameters
tx_cbThe callback to use for sending messages when Flags_SendResponse() is called. This can be overridden, see the note below.

If PIPELINE_TRANSPORT_TX is defined in app_pipeline.h, the macro will override the tx_cb argument.

void Flags_SendResponse ( uint8_t  token)

Send a flags message.

Parameters
tokenThe token to include in the response.

This uses the TransportTXFunction passed in Flags_Initialize() to transmit the frame.

static void Flags_SetLogOverflow ( )
inlinestatic

Set the log overflow flag.

This indicates the Logger buffer overflowed and some messages were dropped.

static void Flags_SetTXDrop ( )
inlinestatic

Set the TX Drop flag.

This indicates we tried to send a message to the host before the previous message completed sending.

static void Flags_SetTXError ( )
inlinestatic

Set the TX Error flag.

This indicates USB_DEVICE_EndpointWrite returned an error.