Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
UpdateHub Firmware Over-the-Air

UpdateHub Firmware Over-the-Air for Zephyr Project. More...

Enumerations

enum  updatehub_response {
  UPDATEHUB_NETWORKING_ERROR = 0 , UPDATEHUB_INCOMPATIBLE_HARDWARE , UPDATEHUB_UNCONFIRMED_IMAGE , UPDATEHUB_METADATA_ERROR ,
  UPDATEHUB_DOWNLOAD_ERROR , UPDATEHUB_INSTALL_ERROR , UPDATEHUB_FLASH_INIT_ERROR , UPDATEHUB_OK ,
  UPDATEHUB_HAS_UPDATE , UPDATEHUB_NO_UPDATE
}
 Responses messages from UpdateHub. More...
 

Functions

void updatehub_autohandler (void)
 Runs UpdateHub probe and UpdateHub update automatically.
 
enum updatehub_response updatehub_probe (void)
 The UpdateHub probe verify if there is some update to be performed.
 
enum updatehub_response updatehub_update (void)
 Apply the update package.
 
int updatehub_confirm (void)
 Confirm that image is running as expected.
 
int updatehub_reboot (void)
 Request system to reboot.
 

Detailed Description

UpdateHub Firmware Over-the-Air for Zephyr Project.

Enumeration Type Documentation

◆ updatehub_response

#include <include/zephyr/mgmt/updatehub.h>

Responses messages from UpdateHub.

These messages are used to inform the server and the user about the process status of the UpdateHub and also used to standardize the errors that may occur.

Enumerator
UPDATEHUB_NETWORKING_ERROR 
UPDATEHUB_INCOMPATIBLE_HARDWARE 
UPDATEHUB_UNCONFIRMED_IMAGE 
UPDATEHUB_METADATA_ERROR 
UPDATEHUB_DOWNLOAD_ERROR 
UPDATEHUB_INSTALL_ERROR 
UPDATEHUB_FLASH_INIT_ERROR 
UPDATEHUB_OK 
UPDATEHUB_HAS_UPDATE 
UPDATEHUB_NO_UPDATE 

Function Documentation

◆ updatehub_autohandler()

void updatehub_autohandler ( void  )

#include <include/zephyr/mgmt/updatehub.h>

Runs UpdateHub probe and UpdateHub update automatically.

The updatehub_autohandler handles the whole process in pre-determined time intervals.

◆ updatehub_confirm()

int updatehub_confirm ( void  )

#include <include/zephyr/mgmt/updatehub.h>

Confirm that image is running as expected.

Must be used before the UpdateHub probe. It should be one of first actions after reboot.

Returns
Return 0 if success otherwise a negative 'errno' value.

◆ updatehub_probe()

enum updatehub_response updatehub_probe ( void  )

#include <include/zephyr/mgmt/updatehub.h>

The UpdateHub probe verify if there is some update to be performed.

Returns
UPDATEHUB_HAS_UPDATE has an update available.
UPDATEHUB_NO_UPDATE no update available.
UPDATEHUB_NETWORKING_ERROR fail to connect to the UpdateHub server.
UPDATEHUB_INCOMPATIBLE_HARDWARE if Incompatible hardware.
UPDATEHUB_METADATA_ERROR fail to parse or to encode the metadata.

◆ updatehub_reboot()

int updatehub_reboot ( void  )

#include <include/zephyr/mgmt/updatehub.h>

Request system to reboot.

Returns
Return 0 if success otherwise a negative 'errno' value.

◆ updatehub_update()

enum updatehub_response updatehub_update ( void  )

#include <include/zephyr/mgmt/updatehub.h>

Apply the update package.

Must be used after the UpdateHub probe, if you have updates to be made, will perform the installation of the new image and the hardware will rebooting.

Returns
Return UPDATEHUB_OK if success
UPDATEHUB_NETWORKING_ERROR if fail to connect to the server.
UPDATEHUB_DOWNLOAD_ERROR fail while downloading the update package.
UPDATEHUB_INSTALL_ERROR fail while installing the update package.
UPDATEHUB_FLASH_INIT_ERROR fail to initialize the flash.