Digi XBee(R) ANSI C Host Library
Data Structures | Macros | Functions | Variables
ebl_file.h File Reference

Code for decoding headers from Ember firmware images (.EBL files). More...

#include "xbee/platform.h"

Go to the source code of this file.

Data Structures

struct  em3xx_header_t
 Header for EM3XX-based firmware images. More...
 
struct  em2xx_header_t
 Header for EM2XX-based firmware images. More...
 
union  ebl_file_header_t
 Union of header formats for all Ember firmware images. More...
 
struct  micro_info_t
 Structure used to hold table of micro_info values from EM3XX header. More...
 
struct  platform_info_t
 Structure used to hold table of plat_info values from EM3XX header. More...
 

Macros

#define IMAGE_INFO_MAXLEN   32
 
#define EBLTAG_HEADER   0x0000
 
#define IMAGE_SIGNATURE_EM250   0xE250
 signature_be field for EM250 firmware images
 
#define IMAGE_SIGNATURE_EM260   0xE260
 signature_be field for EM260 firmware images
 
#define IMAGE_SIGNATURE_EM350   0xE350
 signature_be field for EM351/EM357 firmware images
 
#define MICRO_INFO_END   { 0xFF, NULL }
 
#define PLATFORM_INFO_END   { 0xFF, NULL }
 
#define EBL_HEADER_DUMP_TARGET_DESC   (1<<0)
 
#define EBL_HEADER_DUMP_PHY_DESC   (1<<1)
 
#define EBL_HEADER_DUMP_EMBER_VER   (1<<2)
 
#define EBL_HEADER_DUMP_TIMESTAMP   (1<<3)
 
#define EBL_HEADER_DUMP_IMAGE_INFO   (1<<4)
 
#define EBL_HEADER_DUMP_EVERYTHING   0xFFFF
 

Functions

const char * ebl_target_desc (uint8_t plat_info, uint8_t micro_info)
 Returns a description of the platform based on the plat_info and micro_info fields in the em3xx_header_t structure. More...
 
const char * ebl_phy_desc (uint8_t phy_info)
 Returns a description of the PHY based on the phy_info field in the em3xx_header_t structure. More...
 
int ebl_header_dump (const void *buffer, uint16_t flags)
 Prints a description of the .EBL file header. More...
 

Variables

const platform_info_t platform_info []
 Table of tables used to decode plat_info and micro_info fields from .EBL file header. More...
 

Detailed Description

Code for decoding headers from Ember firmware images (.EBL files).

Function Documentation

int ebl_header_dump ( const void *  buffer,
uint16_t  flags 
)

Prints a description of the .EBL file header.

Parameters
[in]bufferbuffer with first 128 bytes of .EBL file
[in]flagscombination of the following macros:
  • #EBL_HEADER_DUMP_TARGET_DESC - target description (EM3XX only)
  • #EBL_HEADER_DUMP_PHY_DESC - PHY description (EM3XX only)
  • #EBL_HEADER_DUMP_EMBER_VER - Ember stack version (EM3XX only)
  • #EBL_HEADER_DUMP_TIMESTAMP - build date/timestamp
  • #EBL_HEADER_DUMP_IMAGE_INFO - "image info" string
  • #EBL_HEADER_DUMP_EVERYTHING - information on all possible fields
Return values
-EINVALinvalid parameter passed to function
-EILSEQnot a valid EBL file header
0parsed header and printed info

References be16toh, ebl_file_header_t::common, ebl_file_header_t::ebltag_be, EILSEQ, EINVAL, IMAGE_SIGNATURE_EM250, IMAGE_SIGNATURE_EM260, IMAGE_SIGNATURE_EM350, and ebl_file_header_t::signature_be.

const char* ebl_phy_desc ( uint8_t  phy_info)

Returns a description of the PHY based on the phy_info field in the em3xx_header_t structure.

Parameters
[in]phy_infophy_info field from EM3xx file header
Returns
String describing PHY or, for uknown values, "PHY XX" where XX is phy_info in hex.

References be32toh, ebl_target_desc(), em3xx_header_t::image_info, em2xx_header_t::image_info, le32toh, em3xx_header_t::micro_info, em3xx_header_t::phy_info, em3xx_header_t::plat_info, em2xx_header_t::timestamp_be, em3xx_header_t::timestamp_le, ZCL_TIME_EPOCH_DELTA_1970, em3xx_header_t::znet_build, and em3xx_header_t::znet_release.

const char* ebl_target_desc ( uint8_t  plat_info,
uint8_t  micro_info 
)

Returns a description of the platform based on the plat_info and micro_info fields in the em3xx_header_t structure.

Parameters
[in]plat_infoplat_info field from EM3xx file header
[in]micro_infomicro_info field from EM3xx file header
Returns
String describing platform or, for unknown combinations, "P:XX M:YY" where XX is plat_info in hex and YY is micro_info in hex.

Referenced by ebl_phy_desc().

Variable Documentation

const platform_info_t platform_info[]

Table of tables used to decode plat_info and micro_info fields from .EBL file header.

See ebl_target_desc()