NetBurner 3.5.8
PDF Version
Signed Application Update

Topics

 NBUpdate Function Return Values

Functions

void RegisterAppSigningPublicKey (const char *pKey)
 Enable APP Signing by registering a RSA PEM or DER format public key.
int ProgramApplication (uint32_t where, uint8_t *pAppImage)
 Program an appliction image into Flash memory.
int UpdateFromStream (int fd, AppUpdateRecord *&pu, uint32_t timeout, uint32_t inactivityTimeout=0)
 Program/update an appliction image from a data stream.

Detailed Description

#include< nbupdate.h>


Function Documentation

◆ ProgramApplication()

int ProgramApplication ( uint32_t where,
uint8_t * pAppImage )

#include <nbupdate.h>

Program an appliction image into Flash memory.

Parameters
whereLocation in Flash memory
pAppImagePointer to the application image to program
Return values
0Success
-1Application image pointer invalid
-2Invalid platform header

◆ RegisterAppSigningPublicKey()

void RegisterAppSigningPublicKey ( const char * pKey)

#include <nbupdate.h>

Enable APP Signing by registering a RSA PEM or DER format public key.

This function should be called BEFORE the init() function if you want to guarantee security. It is ok to register a temporary text blob early, then overwrite it once the key via other means.

Parameters
pKeyPointer to the public key to register

◆ UpdateFromStream()

int UpdateFromStream ( int fd,
AppUpdateRecord *& pu,
uint32_t timeout,
uint32_t inactivityTimeout = 0 )

#include <nbupdate.h>

Program/update an appliction image from a data stream.

Parameters
fdFile descriptor of data stream
puApplication record
timeoutMaximum duration of the entire transfer, in system time ticks (eg TICKS_PER_SECOND * 10)
inactivityTimeoutMaximum number of ticks to wait for the next data to arrive. If no data is received within this window the update fails with NBUP_ERR_TIMEOUT, so a stalled stream does not hold the calling task for the full timeout duration. The default of 0 waits the full timeout, which suits streams that start on the far end's schedule, such as a serial update.
Return values
0Success
-1Application image pointer invalid
-2Invalid platform header