|
NetBurner 3.5.8
PDF Version |
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. | |
#include< nbupdate.h>
| int ProgramApplication | ( | uint32_t | where, |
| uint8_t * | pAppImage ) |
#include <nbupdate.h>
Program an appliction image into Flash memory.
| where | Location in Flash memory |
| pAppImage | Pointer to the application image to program |
| 0 | Success |
| -1 | Application image pointer invalid |
| -2 | Invalid platform header |
| 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.
| pKey | Pointer to the public key to register |
| 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.
| fd | File descriptor of data stream |
| pu | Application record |
| timeout | Maximum duration of the entire transfer, in system time ticks (eg TICKS_PER_SECOND * 10) |
| inactivityTimeout | Maximum 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. |
| 0 | Success |
| -1 | Application image pointer invalid |
| -2 | Invalid platform header |