HF-BNO08x  0.1.0-dev
Loading...
Searching...
No Matches
HcBin_s Struct Reference

#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)
 

Detailed Description

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.

Member Data Documentation

◆ close

int(* HcBin_s::close) (void)

Close a session with the HcBin object.

Returns
0 on success, non-zero on error.

◆ getAppData

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.)

Returns
0 on success, Non-zero on error.

◆ getAppLen

uint32_t(* HcBin_s::getAppLen) (void)

Get length of application code.

Returns
application length in bytes.

◆ getMeta

const char *(* HcBin_s::getMeta) (const char *key)

Get metadata value for a given key.

Parameters
keyThe key (string) to look up.
Returns
The value (string) associated with the key or NULL.

◆ getPacketLen

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

Returns
preferred packet len or 0, if no preferred value.

◆ open

int(* HcBin_s::open) (void)

Open a session with the HcBin object.

Returns
0 on success, non-zero on error.

The documentation for this struct was generated from the following file: