Macros | Functions
fwupdate.c File Reference
#include "fwupdate.h"
#include "string.h"
#include "xbus.h"
Include dependency graph for fwupdate.c:

Go to the source code of this file.

Macros

#define FWUP_CRITICAL   (unsigned char)0x46
 
#define FWUP_CSERROR   (unsigned char)0x45
 
#define FWUP_DEFAULT_SLICE_SIZE   (64)
 
#define FWUP_FINISHED   (unsigned char)0x46
 
#define FWUP_HEADER   (unsigned char)0x53
 
#define FWUP_OK   (unsigned char)0x53
 
#define FWUP_OTHER   (unsigned char)0x4F
 
#define FWUP_PAGE   (unsigned char)0x50
 
#define FWUP_PAGESLICE   (unsigned char)0x54
 
#define FWUP_READY   (unsigned char)0x52
 Firmware updater commands. More...
 
#define FWUP_STARTED   (unsigned char)0x41
 
#define LOG(...)
 
#define XMID_FIRMWARE_UPDATE   (0xF2)
 

Functions

const char * ackToString (uint8_t command)
 Helper function for converting a firmware updater command acknowledge to a string. More...
 
const char * commandToString (uint8_t command)
 Helper function for converting a firmware updater command to a string. More...
 
static void enterNewSection (FwUpdate *thisPtr)
 Enter the next section of the xff file. More...
 
void FwUpdate_handleXbus (FwUpdate *thisPtr, uint8_t const *xbusMessage)
 Handle xbus message coming from the module. More...
 
void FwUpdate_init (FwUpdate *thisPtr)
 Initialize a FwUpdate instance. More...
 
void FwUpdate_start (FwUpdate *thisPtr)
 Start a firmware update. More...
 
uint16_t readUint16 (FwUpdate *thisPtr)
 Read a uint16_t from the current position in the xff. More...
 
uint32_t readUint32 (FwUpdate *thisPtr)
 Read a uint32_t from the current position in the xff. More...
 
uint8_t readUint8 (FwUpdate *thisPtr)
 Read a uint8_t from the current position in the xff. More...
 
static void readXffHeader (FwUpdate *thisPtr)
 Read an Xff header from the current position in the xff. More...
 
static void sendFinished (FwUpdate *thisPtr)
 Send a FWUP_FINISHED command. More...
 
static void sendHeader (FwUpdate *thisPtr)
 Send a FWUP_HEADER command. More...
 
static void sendOther (FwUpdate *thisPtr)
 Send a FWUP_OTHER command. More...
 
static void sendReady (FwUpdate *thisPtr)
 Send a FWUP_READY command. More...
 
static void sendSlice (FwUpdate *thisPtr)
 Send a page slice. More...
 

Macro Definition Documentation

◆ FWUP_CRITICAL

#define FWUP_CRITICAL   (unsigned char)0x46

Definition at line 83 of file fwupdate.c.

◆ FWUP_CSERROR

#define FWUP_CSERROR   (unsigned char)0x45

Definition at line 82 of file fwupdate.c.

◆ FWUP_DEFAULT_SLICE_SIZE

#define FWUP_DEFAULT_SLICE_SIZE   (64)

Definition at line 75 of file fwupdate.c.

◆ FWUP_FINISHED

#define FWUP_FINISHED   (unsigned char)0x46

Definition at line 84 of file fwupdate.c.

◆ FWUP_HEADER

#define FWUP_HEADER   (unsigned char)0x53

Definition at line 86 of file fwupdate.c.

◆ FWUP_OK

#define FWUP_OK   (unsigned char)0x53

Definition at line 81 of file fwupdate.c.

◆ FWUP_OTHER

#define FWUP_OTHER   (unsigned char)0x4F

Definition at line 89 of file fwupdate.c.

◆ FWUP_PAGE

#define FWUP_PAGE   (unsigned char)0x50

Definition at line 85 of file fwupdate.c.

◆ FWUP_PAGESLICE

#define FWUP_PAGESLICE   (unsigned char)0x54

Definition at line 87 of file fwupdate.c.

◆ FWUP_READY

#define FWUP_READY   (unsigned char)0x52

Firmware updater commands.

Definition at line 80 of file fwupdate.c.

◆ FWUP_STARTED

#define FWUP_STARTED   (unsigned char)0x41

Definition at line 88 of file fwupdate.c.

◆ LOG

#define LOG (   ...)

Definition at line 70 of file fwupdate.c.

◆ XMID_FIRMWARE_UPDATE

#define XMID_FIRMWARE_UPDATE   (0xF2)

Definition at line 73 of file fwupdate.c.

Function Documentation

◆ ackToString()

const char* ackToString ( uint8_t  command)

Helper function for converting a firmware updater command acknowledge to a string.

Definition at line 120 of file fwupdate.c.

◆ commandToString()

const char* commandToString ( uint8_t  command)

Helper function for converting a firmware updater command to a string.

Definition at line 94 of file fwupdate.c.

◆ enterNewSection()

static void enterNewSection ( FwUpdate thisPtr)
static

Enter the next section of the xff file.

Definition at line 338 of file fwupdate.c.

◆ FwUpdate_handleXbus()

void FwUpdate_handleXbus ( FwUpdate thisPtr,
uint8_t const *  xbusMessage 
)

Handle xbus message coming from the module.

Parameters
xbusMessageThe xbus message from the module to be handled

Definition at line 382 of file fwupdate.c.

◆ FwUpdate_init()

void FwUpdate_init ( FwUpdate thisPtr)

Initialize a FwUpdate instance.

Definition at line 352 of file fwupdate.c.

◆ FwUpdate_start()

void FwUpdate_start ( FwUpdate thisPtr)

Start a firmware update.

Definition at line 361 of file fwupdate.c.

◆ readUint16()

uint16_t readUint16 ( FwUpdate thisPtr)

Read a uint16_t from the current position in the xff.

Definition at line 167 of file fwupdate.c.

◆ readUint32()

uint32_t readUint32 ( FwUpdate thisPtr)

Read a uint32_t from the current position in the xff.

Definition at line 148 of file fwupdate.c.

◆ readUint8()

uint8_t readUint8 ( FwUpdate thisPtr)

Read a uint8_t from the current position in the xff.

Definition at line 186 of file fwupdate.c.

◆ readXffHeader()

static void readXffHeader ( FwUpdate thisPtr)
static

Read an Xff header from the current position in the xff.

Definition at line 205 of file fwupdate.c.

◆ sendFinished()

static void sendFinished ( FwUpdate thisPtr)
static

Send a FWUP_FINISHED command.

Definition at line 325 of file fwupdate.c.

◆ sendHeader()

static void sendHeader ( FwUpdate thisPtr)
static

Send a FWUP_HEADER command.

Definition at line 268 of file fwupdate.c.

◆ sendOther()

static void sendOther ( FwUpdate thisPtr)
static

Send a FWUP_OTHER command.

Definition at line 311 of file fwupdate.c.

◆ sendReady()

static void sendReady ( FwUpdate thisPtr)
static

Send a FWUP_READY command.

Definition at line 257 of file fwupdate.c.

◆ sendSlice()

static void sendSlice ( FwUpdate thisPtr)
static

Send a page slice.

Definition at line 289 of file fwupdate.c.



xsens_mti_driver
Author(s):
autogenerated on Sun Sep 3 2023 02:43:20