MySensors Library & Examples  2.3.2
Classes | Macros | Functions
+ Collaboration diagram for MyOTAFirmwareUpdate:

Detailed Description

API declaration for MyOTAFirmwareUpdate.

MyOTAFirmwareUpdate-related log messages, format: [!]SYSTEM:[SUB SYSTEM:]MESSAGE

MyOTAFirmwareUpdate debug log messages:

E SYS SUB Message Comment
OTA FWP UPDATE FW update initiated
! OTA FWP UPDO FW config response received, FW update already ongoing
! OTA FWP FLASH INIT FAIL Failed to initialise flash
OTA FWP UPDATE SKIPPED FW update skipped, no newer version available
OTA FWP RECV B=%04X Received FW block (B)
! OTA FWP WRONG FWB Wrong FW block received
OTA FWP FW END FW received, proceed to CRC verification
OTA FWP CRC OK FW CRC verification OK
! OTA FWP CRC FAIL FW CRC verification failed
OTA FRQ FW REQ,T=%04X,V=%04X,B=%04X Request FW update, FW type (T), version (V), block (B)
! OTA FRQ FW UPD FAIL FW update failed
OTA CRC B=%04X,C=%04X,F=%04X FW CRC verification. FW blocks (B), calculated CRC (C), FW CRC (F)


struct  __attribute__
 FW config structure, stored in eeprom. More...


#define LOCAL   static
#define FIRMWARE_BLOCK_SIZE   (16u)
 Size of each firmware block.
#define MY_OTA_RETRY   (5u)
 Number of times to request a fw block before giving up.
#define MY_OTA_RETRY_DELAY   (500u)
 Number of milliseconds before re-requesting a FW block.
 Start offset for firmware in flash (DualOptiboot wants to keeps a signature first)
 Bootloader version major.
 Bootloader version minor.
 Bootloader version.
#define OTA_DEBUG(x, ...)
 debug NULL
 Enabled FOTA 3.1 protocol extensions. More...


LOCAL void readFirmwareSettings (void)
 Read firmware settings from EEPROM. More...
LOCAL void firmwareOTAUpdateRequest (void)
 Handle OTA FW update requests.
LOCAL bool firmwareOTAUpdateProcess (void)
 Handle OTA FW update responses. More...
LOCAL bool transportIsValidFirmware (void)
 Validate uploaded FW CRC. More...
LOCAL void presentBootloaderInformation (void)
 Present bootloader/FW information upon startup.

Macro Definition Documentation



Enabled FOTA 3.1 protocol extensions.

Supports smaller FIRMWARE_BLOCK_SIZE, RLE and NVM for nRF5 with mcuboot. The extension is enabled per default when mcuboot is present or full FIRMWARE_BLOCK_SIZE exeeds MAX_PAYLOAD_SIZE.

Definition at line 111 of file MyOTAFirmwareUpdate.h.

Function Documentation

◆ firmwareOTAUpdateProcess()

LOCAL bool firmwareOTAUpdateProcess ( void  )

Handle OTA FW update responses.

This function handles incoming OTA FW packets and stores them to external flash (Sensebender)

◆ readFirmwareSettings()

LOCAL void readFirmwareSettings ( void  )

Read firmware settings from EEPROM.

Current firmware settings (type, version, crc, blocks) are read into _fc

◆ transportIsValidFirmware()

LOCAL bool transportIsValidFirmware ( void  )

Validate uploaded FW CRC.

This function verifies if uploaded FW CRC is valid