|
HF-BNO08x
0.1.0-dev
|
#include <HcBin.h>
Public Attributes | |
| int(* | open )(void) |
| int(* | close )(void) |
| const char *(* | getMeta )(const char *key) |
| uint32_t(* | getAppLen )(void) |
| uint32_t(* | getPacketLen )(void) |
| int(* | getAppData )(uint8_t *packet, uint32_t offset, uint32_t len) |
Abstract Data Type for Hillcrest Binary Files.
Function pointers provide open, close and other operations. Note restrictions on calling order among these operations. Open must be called first, followed by calls to getMeta, getAppLen and getPacketLen. Only then should getAppData be called, starting from offset 0 and increasing continuously. close may be called at any time to terminate the session.
| int(* HcBin_s::close) (void) |
Close a session with the HcBin object.
| int(* HcBin_s::getAppData) (uint8_t *packet, uint32_t offset, uint32_t len) |
Get App Data. Copies len bytes of application data, starting from offset, into buffer pointed to by packet. After first call to getAppData, the user should not access other functions except close. (This is to facilitate streaming HcBin data via a serial protocol.)
| uint32_t(* HcBin_s::getAppLen) (void) |
Get length of application code.
| const char *(* HcBin_s::getMeta) (const char *key) |
Get metadata value for a given key.
| key | The key (string) to look up. |
| uint32_t(* HcBin_s::getPacketLen) (void) |
Get preferred packet length for getAppData calls. During DFU protocol, data is read in chunks, via the getAppData() function. If the HcBin implementation has a preferred packet len (e.g. due to serial line protocol or decompression method) it should return that value through this function. If the HcBin implementation places no restriction on len in the getAppData() method, it should return 0
| int(* HcBin_s::open) (void) |
Open a session with the HcBin object.