Modules#

EmberReleaseTypeStruct

EmberVersion

EmberZigbeeNetwork

EmberNetworkInitStruct

EmberBeaconSurvey

EmberBeaconData

EmberBeaconIterator

EmberNetworkParameters

EmberMultiPhyRadioParameters

EmberApsFrame

EmberChildData

EmberBindingTableEntry

EmberNeighborTableEntry

EmberRouteTableEntry

EmberMulticastTableEntry

EmberMultiprotocolPriorities

EmberCounterInfo

EmberExtraCounterInfo

EmberEventControl

EmberEventData

EmberTaskControl

EmberKeyData

EmberCertificateData

EmberPublicKeyData

EmberPrivateKeyData

EmberSmacData

EmberSignatureData

EmberMessageDigest

EmberAesMmoHashContext

EmberCertificate283k1Data

EmberPublicKey283k1Data

EmberPrivateKey283k1Data

EmberSignature283k1Data

EmberInitialSecurityState

EmberCurrentSecurityState

EmberTransientKeyData

EmberKeyStruct

EmberMfgSecurityStruct

EmberDutyCycleLimits

EmberPerDeviceDutyCycle

sl_nwk_packet_exchange_t

EmberMacFilterMatchStruct

SourceRouteTableEntry

EmberBeaconClassificationParams

EmberTokenInfo

EmberTokenData

EmberTagMapEntry

Ember data type definitions.

See Ember Common Data Types for details.

License#

Copyright 2018 Silicon Laboratories Inc. www.silabs.com

The licensor of this software is Silicon Laboratories Inc. Your use of this software is governed by the terms of Silicon Labs Master Software License Agreement (MSLA) available at www.silabs.com/about-us/legal/master-software-license-agreement. This software is distributed to you in Source Code format and is governed by the sections of the MSLA applicable to Source Code.

/***************************************************************************/
#ifndef SILABS_EMBER_TYPES_H
#define SILABS_EMBER_TYPES_H

// TODO: temporary hack
#define SIGNED_ENUM

#ifdef PLATFORM_HEADER
 #include PLATFORM_HEADER
#endif // PLATFORM_HEADER

#ifndef DOXYGEN_SHOULD_SKIP_THIS
#include "stack/config/ember-configuration-defaults.h"
#include "stack/include/ember-static-struct.h"
#endif //DOXYGEN_SHOULD_SKIP_THIS

#include "mac-types.h"


#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberVersionType
#else
typedef uint8_t EmberVersionType;
enum
#endif
{
  EMBER_VERSION_TYPE_PRE_RELEASE = 0x00,

  //Alpha, should be used rarely
  EMBER_VERSION_TYPE_ALPHA_1     = 0x11,
  EMBER_VERSION_TYPE_ALPHA_2     = 0x12,
  EMBER_VERSION_TYPE_ALPHA_3     = 0x13,
  // Leave space in case we decide to add other types in the future.
  EMBER_VERSION_TYPE_BETA_1      = 0x21,
  EMBER_VERSION_TYPE_BETA_2      = 0x22,
  EMBER_VERSION_TYPE_BETA_3      = 0x23,

  // Anything other than 0xAA is considered pre-release
  // Silicon Labs may define other types in the future (e.g. beta, alpha)
  // Silicon Labs chose an arbitrary number (0xAA) to allow for expansion, but
  // to prevent ambiguity in case 0x00 or 0xFF is accidentally retrieved
  // as the version type.
  EMBER_VERSION_TYPE_GA = 0xAA,
};

typedef struct {
  EmberVersionType typeNum;
  const char * typeString;
} EmberReleaseTypeStruct;

#define EMBER_RELEASE_TYPE_TO_STRING_STRUCT_DATA     \
  { EMBER_VERSION_TYPE_PRE_RELEASE, "Pre-Release" }, \
  { EMBER_VERSION_TYPE_ALPHA_1, "Alpha 1" },         \
  { EMBER_VERSION_TYPE_ALPHA_2, "Alpha 2" },         \
  { EMBER_VERSION_TYPE_ALPHA_3, "Alpha 3" },         \
  { EMBER_VERSION_TYPE_BETA_1, "Beta 1" },           \
  { EMBER_VERSION_TYPE_BETA_2, "Beta 2" },           \
  { EMBER_VERSION_TYPE_BETA_3, "Beta 3" },           \
  { EMBER_VERSION_TYPE_GA, "GA" },                   \
  { 0xFF, NULL },

typedef struct {
  uint16_t build;
  uint8_t major;
  uint8_t minor;
  uint8_t patch;
  uint8_t special;
  EmberVersionType type;
} EmberVersion;

extern const EmberVersion emberVersion;

#ifdef ZIGBEE_STACK_ON_HOST

typedef struct {
  const char * date;
  const char * time;
} EmberStackBuildDateTime;

extern const EmberStackBuildDateTime emberStackBuildDateTime;

#endif //ZIGBEE_STACK_ON_HOST

#define EUI64_SIZE 8

#define EXTENDED_PAN_ID_SIZE 8

#define EMBER_ENCRYPTION_KEY_SIZE 16

#define EMBER_CERTIFICATE_SIZE 48

#define EMBER_PUBLIC_KEY_SIZE 22

#define EMBER_PRIVATE_KEY_SIZE 21

#define EMBER_SMAC_SIZE 16

#define EMBER_SIGNATURE_SIZE 42

#define EMBER_AES_HASH_BLOCK_SIZE 16

#define EMBER_CERTIFICATE_283K1_SIZE 74

#define EMBER_PUBLIC_KEY_283K1_SIZE 37

#define EMBER_PRIVATE_KEY_283K1_SIZE 36

#define EMBER_SIGNATURE_283K1_SIZE 72

#ifndef __EMBERSTATUS_TYPE__
#define __EMBERSTATUS_TYPE__
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef uint8_t EmberStatus;
#endif
#endif // __EMBERSTATUS_TYPE__

#include "stack/include/error.h"
#include "buffer_manager/buffer-management.h"

//typedef uint8_t EmberEUI64[EUI64_SIZE];

//typedef uint16_t EmberMessageBuffer;
//typedef uint16_t Buffer;

#define NULL_BUFFER 0x0000u

//typedef uint16_t EmberNodeId;

typedef uint16_t EmberMulticastId;

//typedef uint16_t EmberPanId;

typedef uint16_t EmberDutyCycleHectoPct;

#define EMBER_MAX_802_15_4_CHANNEL_NUMBER 26

#define EMBER_MIN_802_15_4_CHANNEL_NUMBER 11

#define EMBER_MIN_SUBGHZ_CHANNEL_NUMBER 0

#define EMBER_ACTIVE_SCAN_DURATION  3

#define EMBER_SUB_GHZ_SCAN_DURATION 5

#define EMBER_NUM_802_15_4_CHANNELS \
  (EMBER_MAX_802_15_4_CHANNEL_NUMBER - EMBER_MIN_802_15_4_CHANNEL_NUMBER + 1)

#define EMBER_ALL_802_15_4_CHANNELS_MASK 0x07FFF800UL

#define EMBER_MAX_CHANNELS_PER_PAGE   27

#define EMBER_ALL_SUBGHZ_CHANNELS_MASK_FOR_PAGES_28_30_31 0x07FFFFFFUL

#define EMBER_MAX_SUBGHZ_CHANNEL_NUMBER_ON_PAGES_28_30_31   26

#define EMBER_ALL_SUBGHZ_CHANNELS_MASK_FOR_PAGES_29 0x1FF

#define EMBER_MAX_SUBGHZ_CHANNEL_NUMBER_ON_PAGE_29   8

#define EMBER_MIN_SUGBHZ_PAGE_NUMBER  28

#define EMBER_MAX_SUGBHZ_PAGE_NUMBER  31

#define EMBER_ALL_CHANNEL_PAGE_MASK 0xF8000000UL

#define EMBER_PAGE_CHANNEL_MASK_FROM_CHANNEL_MASK(page, mask)                          \
  (((((uint32_t)(page)) << EMBER_MAX_CHANNELS_PER_PAGE) & EMBER_ALL_CHANNEL_PAGE_MASK) \
   | (((uint32_t)(mask)) & ~EMBER_ALL_CHANNEL_PAGE_MASK))

#define EMBER_PAGE_CHANNEL_MASK_FROM_CHANNEL_NUMBER(page, channel) \
  EMBER_PAGE_CHANNEL_MASK_FROM_CHANNEL_MASK(page, BIT32(channel))

#define EMBER_ZIGBEE_COORDINATOR_ADDRESS 0x0000u

#define EMBER_NULL_NODE_ID 0xFFFFu

#define EMBER_NO_CHANNEL_PAGE_IN_USE           0

#define EMBER_NULL_EUI64 { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }

#define EMBER_NULL_BINDING 0xFFu

#define EMBER_TABLE_ENTRY_UNUSED_NODE_ID  0xFFFFu

#define EMBER_MULTICAST_NODE_ID           0xFFFEu

#define EMBER_UNKNOWN_NODE_ID             0xFFFDu

#define EMBER_DISCOVERY_ACTIVE_NODE_ID    0xFFFCu

#define EMBER_NULL_ADDRESS_TABLE_INDEX 0xFFu

#define EMBER_ZDO_ENDPOINT 0u

#define EMBER_BROADCAST_ENDPOINT 0xFFu

#define EMBER_ZDO_PROFILE_ID  0x0000u

#define EMBER_WILDCARD_PROFILE_ID  0xFFFFu

#define EMBER_MAXIMUM_STANDARD_PROFILE_ID  0x7FFFu

#define EMBER_BROADCAST_TABLE_TIMEOUT_QS (20 * 4)

#define EMBER_MANUFACTURER_ID 0x1002u

#define EMBER_NULL_NETWORK_INDEX 0xFFu

#define EMBER_DC_LIMIT_USE_DEFAULT 0

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberStackProfile
#else
typedef uint8_t EmberStackProfile;
enum
#endif
{
  EMBER_STACK_PROFILE_NONE       = 0x00,
  EMBER_STACK_PROFILE_ZIGBEE_PRO = 0x02,
};

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberSecurityLevel
#else
typedef uint8_t EmberSecurityLevel;
enum
#endif
{
  EMBER_SECURITY_LEVEL_NONE = 0x00,
  EMBER_SECURITY_LEVEL_Z3   = 0x05,
};

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberLeaveRequestFlags
#else
typedef uint8_t EmberLeaveRequestFlags;
enum
#endif
{
  EMBER_ZIGBEE_LEAVE_AND_REJOIN     = 0x80,

  // Note: removeChildren is treated to be deprecated and should not be used!
  // CCB 2047
  // - CCB makes the first step to deprecate the 'leave and remove children' functionality.
  // - We were proactive here and deprecated it right away.
  // EMBER_ZIGBEE_LEAVE_AND_REMOVE_CHILDREN = 0x40,

  EMBER_ZIGBEE_LEAVE_WITHOUT_REJOIN = 0x00,
};

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberLeaveReason
#else
typedef uint8_t EmberLeaveReason;
enum
#endif
{
  EMBER_LEAVE_REASON_NONE               = 0,
  EMBER_LEAVE_DUE_TO_NWK_LEAVE_MESSAGE  = 1,
  EMBER_LEAVE_DUE_TO_APS_REMOVE_MESSAGE = 2,
  // Currently, the stack does not process the ZDO leave message since it is optional.
  EMBER_LEAVE_DUE_TO_ZDO_LEAVE_MESSAGE  = 3,
  EMBER_LEAVE_DUE_TO_ZLL_TOUCHLINK      = 4,

  EMBER_LEAVE_DUE_TO_APP_EVENT_1        = 0xFF,
};


#define EMBER_BROADCAST_ADDRESS 0xFFFCu

#define EMBER_RX_ON_WHEN_IDLE_BROADCAST_ADDRESS 0xFFFDu

#define EMBER_SLEEPY_BROADCAST_ADDRESS 0xFFFFu

// From table 3.51 of 053474r14
// When sending many-to-one route requests, the following
// addresses are used
// 0xFFF9 indicates a non-memory-constrained many-to-one route request
// 0xFFF8 indicates a memory-constrained many-to-one route request
#define EMBER_MIN_BROADCAST_ADDRESS 0xFFF8u

#define emberIsZigbeeBroadcastAddress(address) \
  (EMBER_MIN_BROADCAST_ADDRESS <= ((uint16_t) (address)))

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberNodeType
#else
typedef uint8_t EmberNodeType;
enum
#endif
{
  EMBER_UNKNOWN_DEVICE = 0,
  EMBER_COORDINATOR = 1,
  EMBER_ROUTER = 2,
  EMBER_END_DEVICE = 3,
  EMBER_SLEEPY_END_DEVICE = 4,
  EMBER_S2S_INITIATOR_DEVICE = 5,
  EMBER_S2S_TARGET_DEVICE = 6,
};

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberEndDeviceConfiguration
#else
typedef uint8_t EmberEndDeviceConfiguration;
enum
#endif
{
  EMBER_END_DEVICE_CONFIG_NONE                   = 0x00,
  EMBER_END_DEVICE_CONFIG_PERSIST_DATA_ON_PARENT = 0x01,
};

typedef struct {
  uint16_t panId;
  uint8_t channel;
  bool allowingJoin;
  uint8_t extendedPanId[EXTENDED_PAN_ID_SIZE];
  uint8_t stackProfile;
  uint8_t nwkUpdateId;
} EmberZigbeeNetwork;

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberNetworkInitBitmask
#else
typedef uint16_t EmberNetworkInitBitmask;
enum
#endif
{
  EMBER_NETWORK_INIT_NO_OPTIONS           = 0x0000,
  EMBER_NETWORK_INIT_PARENT_INFO_IN_TOKEN = 0x0001,
  EMBER_NETWORK_INIT_END_DEVICE_REJOIN_ON_REBOOT = 0x0002,
};

typedef struct {
  EmberNetworkInitBitmask bitmask;
} EmberNetworkInitStruct;

typedef struct {
  uint16_t nodeId;
  int8_t rssi;
  uint8_t classificationMask;
} EmberBeaconSurvey;

typedef struct {
  uint8_t channel;
  uint8_t lqi;
  int8_t rssi;
  uint8_t depth;
  uint8_t nwkUpdateId;
  int8_t power;           // Only valid if enhanced beacon
  int8_t parentPriority;  // TC connectivity and long uptime from capacity field
  bool enhanced     : 1;  // Enhanced or regular beacon
  bool permitJoin   : 1;
  bool hasCapacity  : 1;
  EmberPanId panId;
  EmberNodeId sender;
  uint8_t extendedPanId[EXTENDED_PAN_ID_SIZE];
} EmberBeaconData;

typedef struct {
  // Public fields
  EmberBeaconData beacon;

  // Private fields - Do not write to these variables
  uint8_t index;
} EmberBeaconIterator;

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberApsRejoinMode
#else
typedef uint8_t EmberApsRejoinMode;
enum
#endif
{
  NO_REJOIN,
  REJOIN_ANY_LINK_KEY,
  REJOIN_NON_DEFAULT_LINK_KEY
};

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberApsOption
#else
typedef uint16_t EmberApsOption;
enum
#endif
{
  EMBER_APS_OPTION_NONE                     = 0x0000,

#ifndef DOXYGEN_SHOULD_SKIP_THIS
  EMBER_APS_OPTION_ENCRYPT_WITH_TRANSIENT_KEY = 0x0001,
  EMBER_APS_OPTION_USE_ALIAS_SEQUENCE_NUMBER = 0x0002,
#endif

  EMBER_APS_OPTION_DSA_SIGN                 = 0x0010,
  EMBER_APS_OPTION_ENCRYPTION               = 0x0020,
  EMBER_APS_OPTION_RETRY                    = 0x0040,
  EMBER_APS_OPTION_ENABLE_ROUTE_DISCOVERY   = 0x0100,
  EMBER_APS_OPTION_FORCE_ROUTE_DISCOVERY    = 0x0200,
  EMBER_APS_OPTION_SOURCE_EUI64             = 0x0400,
  EMBER_APS_OPTION_DESTINATION_EUI64        = 0x0800,
  EMBER_APS_OPTION_ENABLE_ADDRESS_DISCOVERY = 0x1000,
  EMBER_APS_OPTION_POLL_RESPONSE            = 0x2000,
  EMBER_APS_OPTION_ZDO_RESPONSE_REQUIRED    = 0x4000,
  EMBER_APS_OPTION_FRAGMENT                 = SIGNED_ENUM 0x8000
};

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberIncomingMessageType
#else
typedef uint8_t EmberIncomingMessageType;
enum
#endif
{
  EMBER_INCOMING_UNICAST,
  EMBER_INCOMING_UNICAST_REPLY,
  EMBER_INCOMING_MULTICAST,
  EMBER_INCOMING_MULTICAST_LOOPBACK,
  EMBER_INCOMING_BROADCAST,
  EMBER_INCOMING_BROADCAST_LOOPBACK
};

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberOutgoingMessageType
#else
typedef uint8_t EmberOutgoingMessageType;
enum
#endif
{
  EMBER_OUTGOING_DIRECT,
  EMBER_OUTGOING_VIA_ADDRESS_TABLE,
  EMBER_OUTGOING_VIA_BINDING,
  EMBER_OUTGOING_MULTICAST,
  EMBER_OUTGOING_MULTICAST_WITH_ALIAS,
  EMBER_OUTGOING_BROADCAST_WITH_ALIAS,
  EMBER_OUTGOING_BROADCAST
};

// OLD API
#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberZigbeeCommandType
#else
typedef uint8_t EmberZigbeeCommandType;
enum
#endif
{
  EMBER_ZIGBEE_COMMAND_TYPE_RAW_MAC,
  EMBER_ZIGBEE_COMMAND_TYPE_MAC_COMMAND,
  EMBER_ZIGBEE_COMMAND_TYPE_NWK,
  EMBER_ZIGBEE_COMMAND_TYPE_APS,
  EMBER_ZIGBEE_COMMAND_TYPE_ZDO,
  EMBER_ZIGBEE_COMMAND_TYPE_ZCL,
  EMBER_ZIGBEE_COMMAND_TYPE_BEACON,
};

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberPacketAction
#else
typedef uint8_t EmberPacketAction;
enum
#endif
{
  EMBER_DROP_PACKET   = 0,
  EMBER_ACCEPT_PACKET = 1,
  EMBER_MANGLE_PACKET,

  EMBER_ACCEPT_PACKET_OVERRIDE_SECURITY,

  EMBER_ACCEPT_PACKET_SKIP_NWK_CRYPTO,
};

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberZigbeePacketType
#else
typedef uint8_t EmberZigbeePacketType;
enum
#endif
{
  EMBER_ZIGBEE_PACKET_TYPE_RAW_MAC,
  EMBER_ZIGBEE_PACKET_TYPE_MAC_COMMAND,
  EMBER_ZIGBEE_PACKET_TYPE_NWK_DATA,
  EMBER_ZIGBEE_PACKET_TYPE_NWK_COMMAND,
  EMBER_ZIGBEE_PACKET_TYPE_APS_DATA,
  EMBER_ZIGBEE_PACKET_TYPE_APS_COMMAND,
  EMBER_ZIGBEE_PACKET_TYPE_ZDO,
  EMBER_ZIGBEE_PACKET_TYPE_ZCL,
  EMBER_ZIGBEE_PACKET_TYPE_BEACON,
  EMBER_ZIGBEE_PACKET_TYPE_INTERPAN,
  EMBER_ZIGBEE_PACKET_TYPE_NWK_DATA_PRE_DECRYPTION,
  EMBER_ZIGBEE_PACKET_TYPE_NWK_COMMAND_PRE_DECRYPTION,
};

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberNetworkStatus
#else
typedef uint8_t EmberNetworkStatus;
enum
#endif
{
  EMBER_NO_NETWORK,
  EMBER_JOINING_NETWORK,
  EMBER_JOINED_NETWORK,
  EMBER_JOINED_NETWORK_NO_PARENT,
  EMBER_JOINED_NETWORK_S2S_INITIATOR,
  EMBER_JOINED_NETWORK_S2S_TARGET,
  EMBER_LEAVING_NETWORK
};

// The RADIO_OFF scan is not really a scan at all.  It is used to
// temporarily turn off the radio to use the TX and RX
// buffers for other purposes.
// Start the scan with:
//   emberStartScan(EMBER_START_RADIO_OFF_SCAN, 0, 0);
// Call emberStopScan() to restart the radio and the MAC.

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberNetworkScanType
#else
typedef uint8_t EmberNetworkScanType;
enum
#endif
{
  EMBER_ENERGY_SCAN,
  EMBER_ACTIVE_SCAN,
  EMBER_START_RADIO_OFF_SCAN,
  EMBER_STACK_GP_CHANNEL_DELIVERY_SCAN,
  EMBER_ACTIVE_SCAN_ROUTER,
  EMBER_LAST_SCAN_TYPE = EMBER_ACTIVE_SCAN_ROUTER
};

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberBindingType
#else
typedef uint8_t EmberBindingType;
enum
#endif
{
  EMBER_UNUSED_BINDING         = 0,
  EMBER_UNICAST_BINDING        = 1,
  EMBER_MANY_TO_ONE_BINDING    = 2,
  EMBER_MULTICAST_BINDING      = 3,
};

#define EMBER_LOW_RAM_CONCENTRATOR 0xFFF8u

#define EMBER_HIGH_RAM_CONCENTRATOR 0xFFF9u


#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberAssumeTrustCenterConcentratorType
#else
typedef uint8_t EmberAssumeTrustCenterConcentratorType;
enum
#endif
{
  EMBER_ASSUME_TRUST_CENTER_IS_NOT_A_CONCENTRATOR = 0,
  EMBER_ASSUME_TRUST_CENTER_IS_LOW_RAM_CONCENTRATOR = 1,
  EMBER_ASSUME_TRUST_CENTER_IS_HIGH_RAM_CONCENTRATOR = 2
};

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberJoinDecision
#else
typedef uint8_t EmberJoinDecision;
enum
#endif
{
  EMBER_USE_PRECONFIGURED_KEY = 0,
  EMBER_SEND_KEY_IN_THE_CLEAR,
  EMBER_DENY_JOIN,
  EMBER_NO_ACTION,
  EMBER_ALLOW_REJOINS_ONLY
};

#define EMBER_JOIN_DECISION_STRINGS \
  "use preconfigured key",          \
  "send key in the clear",          \
  "deny join",                      \
  "no action",                      \
  "allow rejoins only",

// These map to the actual values within the APS Command frame so they cannot
// be arbitrarily changed.
#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberDeviceUpdate
#else
typedef uint8_t EmberDeviceUpdate;
enum
#endif
{
  EMBER_STANDARD_SECURITY_SECURED_REJOIN   = 0,
  EMBER_STANDARD_SECURITY_UNSECURED_JOIN   = 1,
  EMBER_DEVICE_LEFT                        = 2,
  EMBER_STANDARD_SECURITY_UNSECURED_REJOIN = 3,
};

#define EMBER_DEVICE_UPDATE_STRINGS \
  "secured rejoin",                 \
  "UNsecured join",                 \
  "device left",                    \
  "UNsecured rejoin",

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberRejoinReason
#else
typedef uint8_t EmberRejoinReason;
enum
#endif
{
  EMBER_REJOIN_REASON_NONE           = 0,
  EMBER_REJOIN_DUE_TO_NWK_KEY_UPDATE = 1,
  EMBER_REJOIN_DUE_TO_LEAVE_MESSAGE  = 2,
  EMBER_REJOIN_DUE_TO_NO_PARENT      = 3,
  EMBER_REJOIN_DUE_TO_ZLL_TOUCHLINK  = 4,
  EMBER_REJOIN_DUE_TO_END_DEVICE_REBOOT = 5,

  // App. Framework events
  // 0xA0 - 0xE0
  // See af.h for a subset of defined rejoin reasons

  // Customer-defined Events
  //   These are numbered down from 0xFF so their assigned values
  //   need not change if more application events are needed.
  EMBER_REJOIN_DUE_TO_APP_EVENT_5       = 0xFB,
  EMBER_REJOIN_DUE_TO_APP_EVENT_4       = 0xFC,
  EMBER_REJOIN_DUE_TO_APP_EVENT_3       = 0xFD,
  EMBER_REJOIN_DUE_TO_APP_EVENT_2       = 0xFE,
  EMBER_REJOIN_DUE_TO_APP_EVENT_1       = 0xFF,
};

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberClusterListId
#else
typedef uint8_t EmberClusterListId;
enum
#endif
{
  EMBER_INPUT_CLUSTER_LIST            = 0,
  EMBER_OUTPUT_CLUSTER_LIST           = 1
};

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberEventUnits
#else
typedef uint8_t EmberEventUnits;
enum
#endif
{
  EMBER_EVENT_INACTIVE = 0,
  EMBER_EVENT_MS_TIME,
  EMBER_EVENT_QS_TIME,
  EMBER_EVENT_MINUTE_TIME,
  EMBER_EVENT_ZERO_DELAY
};

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberJoinMethod
#else
typedef uint8_t EmberJoinMethod;
enum
#endif
{
  EMBER_USE_MAC_ASSOCIATION         = 0,

  EMBER_USE_NWK_REJOIN              = 1,

  /* For networks where the "permit joining" flag is never turned
   * on, devices will need to use a NWK Rejoin.  If those devices have been
   * preconfigured with the  NWK key (including sequence number), they can use
   * a secured rejoin.  This is only necessary for end devices since they need
   * a parent.  Routers can simply use the ::EMBER_USE_CONFIGURED_NWK_STATE
   * join method below.
   */
  EMBER_USE_NWK_REJOIN_HAVE_NWK_KEY = 2,

  EMBER_USE_CONFIGURED_NWK_STATE    = 3,
};

typedef struct {
  uint8_t   extendedPanId[EXTENDED_PAN_ID_SIZE];
  uint16_t  panId;
  int8_t   radioTxPower;
  uint8_t   radioChannel;
  EmberJoinMethod joinMethod;

  EmberNodeId nwkManagerId;
  uint8_t nwkUpdateId;
  uint32_t channels;
} EmberNetworkParameters;

#ifdef DOXYGEN_SHOULD_SKIP_THIS
#define emberInitializeNetworkParameters(parameters) \
  (MEMSET(parameters, 0, sizeof(EmberNetworkParameters)))
#else
void emberInitializeNetworkParameters(EmberNetworkParameters* parameters);
#endif

typedef struct {
  int8_t radioTxPower;
  uint8_t radioPage;
  uint8_t radioChannel;
} EmberMultiPhyRadioParameters;

typedef struct {
  uint16_t profileId;
  uint16_t clusterId;
  uint8_t sourceEndpoint;
  uint8_t destinationEndpoint;
  EmberApsOption options;
  uint16_t groupId;
  uint8_t sequence;
  uint8_t radius;
} EmberApsFrame;

typedef struct {
  EmberEUI64 eui64;
  EmberNodeType type;
  EmberNodeId id;
  uint8_t phy;
  uint8_t power;
  uint8_t timeout;
} EmberChildData;

typedef struct {
  EmberBindingType type;
  uint8_t local;
  uint16_t clusterId;
  uint8_t remote;
  EmberEUI64 identifier;
  uint8_t networkIndex;
} EmberBindingTableEntry;

typedef struct {
  uint16_t shortId;
  uint8_t  averageLqi;
  uint8_t  inCost;
  uint8_t  outCost;
  uint8_t  age;
  EmberEUI64 longId;
} EmberNeighborTableEntry;

typedef struct {
  uint16_t destination;
  uint16_t nextHop;
  uint8_t status;
  uint8_t age;
  uint8_t concentratorType;
  uint8_t routeRecordState;
} EmberRouteTableEntry;

typedef struct {
  EmberMulticastId multicastId;
  uint8_t endpoint;
  uint8_t networkIndex;
} EmberMulticastTableEntry;

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberCounterType
#else
typedef uint8_t EmberCounterType;
enum
#endif
{
  EMBER_COUNTER_MAC_RX_BROADCAST = 0,
  EMBER_COUNTER_MAC_TX_BROADCAST = 1,
  EMBER_COUNTER_MAC_RX_UNICAST = 2,
  EMBER_COUNTER_MAC_TX_UNICAST_SUCCESS = 3,
  EMBER_COUNTER_MAC_TX_UNICAST_RETRY = 4,
  EMBER_COUNTER_MAC_TX_UNICAST_FAILED = 5,

  EMBER_COUNTER_APS_DATA_RX_BROADCAST = 6,
  EMBER_COUNTER_APS_DATA_TX_BROADCAST = 7,
  EMBER_COUNTER_APS_DATA_RX_UNICAST = 8,
  EMBER_COUNTER_APS_DATA_TX_UNICAST_SUCCESS = 9,
  EMBER_COUNTER_APS_DATA_TX_UNICAST_RETRY = 10,
  EMBER_COUNTER_APS_DATA_TX_UNICAST_FAILED = 11,

  EMBER_COUNTER_ROUTE_DISCOVERY_INITIATED = 12,

  EMBER_COUNTER_NEIGHBOR_ADDED = 13,
  EMBER_COUNTER_NEIGHBOR_REMOVED = 14,
  EMBER_COUNTER_NEIGHBOR_STALE = 15,

  EMBER_COUNTER_JOIN_INDICATION = 16,
  EMBER_COUNTER_CHILD_REMOVED = 17,

  EMBER_COUNTER_ASH_OVERFLOW_ERROR = 18,
  EMBER_COUNTER_ASH_FRAMING_ERROR = 19,
  EMBER_COUNTER_ASH_OVERRUN_ERROR = 20,

  EMBER_COUNTER_NWK_FRAME_COUNTER_FAILURE = 21,

  EMBER_COUNTER_APS_FRAME_COUNTER_FAILURE = 22,

  EMBER_COUNTER_ASH_XOFF = 23,

  EMBER_COUNTER_APS_LINK_KEY_NOT_AUTHORIZED = 24,

  EMBER_COUNTER_NWK_DECRYPTION_FAILURE = 25,

  EMBER_COUNTER_APS_DECRYPTION_FAILURE = 26,

  EMBER_COUNTER_ALLOCATE_PACKET_BUFFER_FAILURE = 27,

  EMBER_COUNTER_RELAYED_UNICAST = 28,

  EMBER_COUNTER_PHY_TO_MAC_QUEUE_LIMIT_REACHED = 29,

  EMBER_COUNTER_PACKET_VALIDATE_LIBRARY_DROPPED_COUNT = 30,

  EMBER_COUNTER_TYPE_NWK_RETRY_OVERFLOW = 31,

  EMBER_COUNTER_PHY_CCA_FAIL_COUNT = 32,

  EMBER_COUNTER_BROADCAST_TABLE_FULL = 33,

  EMBER_COUNTER_PTA_LO_PRI_REQUESTED = 34,

  EMBER_COUNTER_PTA_HI_PRI_REQUESTED = 35,

  EMBER_COUNTER_PTA_LO_PRI_DENIED = 36,

  EMBER_COUNTER_PTA_HI_PRI_DENIED = 37,

  EMBER_COUNTER_PTA_LO_PRI_TX_ABORTED = 38,

  EMBER_COUNTER_PTA_HI_PRI_TX_ABORTED = 39,

  EMBER_COUNTER_ADDRESS_CONFLICT_SENT = 40,

  EMBER_COUNTER_TYPE_COUNT = 41,
};

typedef struct {
  uint8_t backgroundRx;
  uint8_t tx;
  uint8_t activeRx;
} EmberMultiprotocolPriorities;

#define EMBER_COUNTER_STRINGS        \
  "Mac Rx Bcast",                    \
  "Mac Tx Bcast",                    \
  "Mac Rx Ucast",                    \
  "Mac Tx Ucast",                    \
  "Mac Tx Ucast Retry",              \
  "Mac Tx Ucast Fail",               \
  "APS Rx Bcast",                    \
  "APS Tx Bcast",                    \
  "APS Rx Ucast",                    \
  "APS Tx Ucast Success",            \
  "APS Tx Ucast Retry",              \
  "APS Tx Ucast Fail",               \
  "Route Disc Initiated",            \
  "Neighbor Added",                  \
  "Neighbor Removed",                \
  "Neighbor Stale",                  \
  "Join Indication",                 \
  "Child Moved",                     \
  "ASH Overflow",                    \
  "ASH Frame Error",                 \
  "ASH Overrun Error",               \
  "NWK FC Failure",                  \
  "APS FC Failure",                  \
  "ASH XOff",                        \
  "APS Unauthorized Key",            \
  "NWK Decrypt Failures",            \
  "APS Decrypt Failures",            \
  "Packet Buffer Allocate Failures", \
  "Relayed Ucast",                   \
  "Phy to MAC queue limit reached",  \
  "Packet Validate drop count",      \
  "NWK retry overflow",              \
  "CCA Failures",                    \
  "Broadcast table full",            \
  "PTA Lo Pri Req",                  \
  "PTA Hi Pri Req",                  \
  "PTA Lo Pri Denied",               \
  "PTA Hi Pri Denied",               \
  "PTA Lo Pri Tx Abrt",              \
  "PTA Hi Pri Tx Abrt",              \
  "Address Conflict Sent",           \
  NULL

typedef struct {
  uint8_t data;   // For now, might be number of retries or other values that previously were assigned to data.
  void* otherFields;  // For now, this might be destination nodeId, or phyIndex or both(extraCounterInfo).
} EmberCounterInfo;

typedef struct {
  uint8_t phy_index;
  EmberNodeId destinationNodeId;
  void* otherExtraFields;   //For now, this is NULL.
} EmberExtraCounterInfo;

typedef uint8_t EmberTaskId;

//----------------------------------------------------------------
// Events and event queues.

typedef struct {
  EmberEventUnits status;
  EmberTaskId taskid;
  uint32_t timeToExecute;
} EmberEventControl;

typedef struct {
  EmberEventControl *control;
  void (*handler)(void);
} EmberEventData;

typedef struct {
  // The time when the next event associated with this task will fire.
  uint32_t nextEventTime;
  // The list of events associated with this task.
  EmberEventData *events;
  // A flag that indicates the task has something to do other than events.
  bool busy;
} EmberTaskControl;


#define EMBER_TX_POWER_MODE_DEFAULT             0x0000

#define EMBER_TX_POWER_MODE_BOOST               0x0001

#define EMBER_TX_POWER_MODE_ALTERNATE           0x0002

#define EMBER_TX_POWER_MODE_BOOST_AND_ALTERNATE (EMBER_TX_POWER_MODE_BOOST \
                                                 | EMBER_TX_POWER_MODE_ALTERNATE)
#ifndef DOXYGEN_SHOULD_SKIP_THIS
// The application does not ever need to call emberSetTxPowerMode() with the
// txPowerMode parameter set to this value.  This value is used internally by
// the stack to indicate that the default token configuration has not been
// overridden by a prior call to emberSetTxPowerMode().
#define EMBER_TX_POWER_MODE_USE_TOKEN           0x8000
#endif //DOXYGEN_SHOULD_SKIP_THIS



#define EMBER_PRIVATE_PROFILE_ID  0xC00Eu

#define EMBER_PRIVATE_PROFILE_ID_START 0xC00Du

#define EMBER_PRIVATE_PROFILE_ID_END   0xC016u

#define EMBER_REPORT_COUNTERS_REQUEST 0x0003u

#define EMBER_REPORT_COUNTERS_RESPONSE 0x8003u

#define EMBER_REPORT_AND_CLEAR_COUNTERS_REQUEST 0x0004u

#define EMBER_REPORT_AND_CLEAR_COUNTERS_RESPONSE 0x8004u

#define EMBER_OTA_CERTIFICATE_UPGRADE_CLUSTER 0x0005u


typedef struct {
  uint8_t contents[EMBER_ENCRYPTION_KEY_SIZE];
} EmberKeyData;

typedef struct {
  uint8_t contents[EMBER_CERTIFICATE_SIZE];
} EmberCertificateData;

typedef struct {
  uint8_t contents[EMBER_PUBLIC_KEY_SIZE];
} EmberPublicKeyData;

typedef struct {
  uint8_t contents[EMBER_PRIVATE_KEY_SIZE];
} EmberPrivateKeyData;

typedef struct {
  uint8_t contents[EMBER_SMAC_SIZE];
} EmberSmacData;

typedef struct {
  uint8_t contents[EMBER_SIGNATURE_SIZE];
} EmberSignatureData;

typedef struct {
  uint8_t contents[EMBER_AES_HASH_BLOCK_SIZE];
} EmberMessageDigest;

typedef struct {
  uint8_t result[EMBER_AES_HASH_BLOCK_SIZE];
  uint32_t length;
} EmberAesMmoHashContext;

typedef struct {
  /* This is the certificate byte data. */
  uint8_t contents[EMBER_CERTIFICATE_283K1_SIZE];
} EmberCertificate283k1Data;

typedef struct {
  uint8_t contents[EMBER_PUBLIC_KEY_283K1_SIZE];
} EmberPublicKey283k1Data;

typedef struct {
  uint8_t contents[EMBER_PRIVATE_KEY_283K1_SIZE];
} EmberPrivateKey283k1Data;

typedef struct {
  uint8_t contents[EMBER_SIGNATURE_283K1_SIZE];
} EmberSignature283k1Data;

#define EMBER_STANDARD_SECURITY_MODE 0x0000

#define EMBER_TRUST_CENTER_NODE_ID 0x0000u

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberInitialSecurityBitmask
#else
typedef uint16_t EmberInitialSecurityBitmask;
enum
#endif
{
  EMBER_DISTRIBUTED_TRUST_CENTER_MODE       = 0x0002,
  EMBER_TRUST_CENTER_GLOBAL_LINK_KEY        = 0x0004,
  EMBER_PRECONFIGURED_NETWORK_KEY_MODE      = 0x0008,

#if !defined DOXYGEN_SHOULD_SKIP_THIS
  // Hidden fields used internally.
  EMBER_HAVE_TRUST_CENTER_UNKNOWN_KEY_TOKEN = 0x0010,
  EMBER_HAVE_TRUST_CENTER_LINK_KEY_TOKEN    = 0x0020,
#endif

  EMBER_HAVE_TRUST_CENTER_EUI64             = 0x0040,

  EMBER_TRUST_CENTER_USES_HASHED_LINK_KEY   = 0x0084,

  EMBER_HAVE_PRECONFIGURED_KEY              = 0x0100,
  EMBER_HAVE_NETWORK_KEY                    = 0x0200,
  EMBER_GET_LINK_KEY_WHEN_JOINING           = 0x0400,
  EMBER_REQUIRE_ENCRYPTED_KEY               = 0x0800,
  EMBER_NO_FRAME_COUNTER_RESET              = 0x1000,
  EMBER_GET_PRECONFIGURED_KEY_FROM_INSTALL_CODE = 0x2000,

#if !defined DOXYGEN_SHOULD_SKIP_THIS
  // Internal data
  EM_SAVED_IN_TOKEN                         = 0x4000,
  #define EM_SECURITY_INITIALIZED           0x00008000L
#else
  /* All other bits are reserved and must be zero. */
#endif
};

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberExtendedSecurityBitmask
#else
typedef uint16_t EmberExtendedSecurityBitmask;
enum
#endif
{
#ifndef DOXYGEN_SHOULD_SKIP_THIS
  // If this bit is set, the 'key token data' field is set in the Initial
  // Security Bitmask to 0 (No Preconfig Key token). Otherwise, the
  // field is left as is.
  EMBER_PRECONFIG_KEY_NOT_VALID       = 0x0001,
#endif

  // bits 2-3 are unused.
  EMBER_SECURE_NETWORK_KEY_ROTATION   = 0x0002,

  EMBER_JOINER_GLOBAL_LINK_KEY        = 0x0010,

  EMBER_EXT_NO_FRAME_COUNTER_RESET    = 0x0020,

  EMBER_NWK_LEAVE_WITHOUT_REJOIN_NOT_ALLOWED = 0x0040,

  // Bit 7 reserved for future use (stored in TOKEN).

  EMBER_NWK_LEAVE_REQUEST_NOT_ALLOWED = 0x0100,

#ifndef DOXYGEN_SHOULD_SKIP_THIS

  EMBER_R18_STACK_BEHAVIOR            = 0x0200,
#endif

  // Bit 10 is reserved for future use (stored in TOKEN).
  // Bit 11 is reserved for future use(stored in RAM).
  // Bits 12-15 are unused.
};

#define EMBER_NO_TRUST_CENTER_MODE   EMBER_DISTRIBUTED_TRUST_CENTER_MODE

#define EMBER_GLOBAL_LINK_KEY   EMBER_TRUST_CENTER_GLOBAL_LINK_KEY

#if !defined DOXYGEN_SHOULD_SKIP_THIS
  #define NO_TRUST_CENTER_KEY_TOKEN        0x0000
  #define TRUST_CENTER_KEY_TOKEN_MASK      0x0030
  #define SECURITY_BIT_TOKEN_MASK          0x71FF
// If this bit is on, it indicates that the TC token does not hold the TC key
// It lives in PSA at a fixed ID (see ZB SM)
  #define TRUST_CENTER_KEY_LIVES_IN_PSA    0x8000

  #define SECURITY_LOWER_BIT_MASK          0x000000FF  // ""
  #define SECURITY_UPPER_BIT_MASK          0x00FF0000L // ""
#endif

typedef struct {
  uint16_t bitmask;
  EmberKeyData preconfiguredKey;
  EmberKeyData networkKey;
  uint8_t networkKeySequenceNumber;
  EmberEUI64 preconfiguredTrustCenterEui64;
} EmberInitialSecurityState;

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberCurrentSecurityBitmask
#else
typedef uint16_t EmberCurrentSecurityBitmask;
enum
#endif
{
#if defined DOXYGEN_SHOULD_SKIP_THIS
  // These options are the same for Initial and Current Security state.

  EMBER_STANDARD_SECURITY_MODE_             = 0x0000,
  EMBER_DISTRIBUTED_TRUST_CENTER_MODE_      = 0x0002,
  EMBER_TRUST_CENTER_GLOBAL_LINK_KEY_       = 0x0004,
#else
  // Bit 3 reserved
#endif

  EMBER_HAVE_TRUST_CENTER_LINK_KEY          = 0x0010,

  EMBER_TRUST_CENTER_USES_HASHED_LINK_KEY_   = 0x0084,

  // Bits 1, 5, 6, and 8-15 reserved.
};

#if !defined DOXYGEN_SHOULD_SKIP_THIS
  #define INITIAL_AND_CURRENT_BITMASK         0x00FF
#endif

typedef struct {
  EmberCurrentSecurityBitmask bitmask;
  EmberEUI64 trustCenterLongAddress;
} EmberCurrentSecurityState;

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberKeyStructBitmask
#else
typedef uint16_t EmberKeyStructBitmask;
enum
#endif
{
  EMBER_KEY_HAS_SEQUENCE_NUMBER        = 0x0001,
  EMBER_KEY_HAS_OUTGOING_FRAME_COUNTER = 0x0002,
  EMBER_KEY_HAS_INCOMING_FRAME_COUNTER = 0x0004,
  EMBER_KEY_HAS_PARTNER_EUI64          = 0x0008,
  EMBER_KEY_IS_AUTHORIZED              = 0x0010,
  EMBER_KEY_PARTNER_IS_SLEEPY          = 0x0020,
  EMBER_UNCONFIRMED_TRANSIENT_KEY      = 0x0040,
  EMBER_KEY_HAS_PSA_ID                 = 0x0080,
  EMBER_KEY_HAS_KEY_DATA               = 0x0100,
};

typedef struct {
  EmberEUI64 eui64;
  uint32_t incomingFrameCounter;
  EmberKeyStructBitmask bitmask;
  uint16_t remainingTimeSeconds;
  uint8_t networkIndex;
  union {
    EmberKeyData keyData; // valid only if bitmask & EMBER_KEY_HAS_KEY_DATA (on some parts, keys are stored in secure storage and not RAM)
    uint32_t psa_id;      // valid only if bitmask & EMBER_KEY_HAS_PSA_ID (on some parts, keys are stored in secure storage and not RAM)
  };
} EmberTransientKeyData;

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberKeyType
#else
typedef uint8_t EmberKeyType;
enum
#endif
{
  EMBER_TRUST_CENTER_LINK_KEY         = 1,
  EMBER_CURRENT_NETWORK_KEY           = 3,
  EMBER_NEXT_NETWORK_KEY              = 4,
  EMBER_APPLICATION_LINK_KEY          = 5,
};

typedef struct {
  EmberKeyStructBitmask bitmask;
  EmberKeyType type;
  union {
    EmberKeyData key;
    uint32_t psa_id;
  };
  uint32_t outgoingFrameCounter;
  uint32_t incomingFrameCounter;
  uint8_t sequenceNumber;
  EmberEUI64 partnerEUI64;
} EmberKeyStruct;

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberKeyStatus
#else
typedef uint8_t EmberKeyStatus;
enum
#endif
{
  EMBER_KEY_STATUS_NONE                    = 0x00,
  EMBER_APP_LINK_KEY_ESTABLISHED           = 0x01,
  EMBER_TRUST_CENTER_LINK_KEY_ESTABLISHED  = 0x03,

  EMBER_KEY_ESTABLISHMENT_TIMEOUT          = 0x04,
  EMBER_KEY_TABLE_FULL                     = 0x05,

  // These are success status values applying only to the
  // Trust Center answering key requests.
  EMBER_TC_RESPONDED_TO_KEY_REQUEST        = 0x06,
  EMBER_TC_APP_KEY_SENT_TO_REQUESTER       = 0x07,

  // These are failure status values applying only to the
  // Trust Center answering key requests.
  EMBER_TC_RESPONSE_TO_KEY_REQUEST_FAILED  = 0x08,
  EMBER_TC_REQUEST_KEY_TYPE_NOT_SUPPORTED  = 0x09,
  EMBER_TC_NO_LINK_KEY_FOR_REQUESTER       = 0x0A,
  EMBER_TC_REQUESTER_EUI64_UNKNOWN         = 0x0B,
  EMBER_TC_RECEIVED_FIRST_APP_KEY_REQUEST  = 0x0C,
  EMBER_TC_TIMEOUT_WAITING_FOR_SECOND_APP_KEY_REQUEST = 0x0D,
  EMBER_TC_NON_MATCHING_APP_KEY_REQUEST_RECEIVED      = 0x0E,
  EMBER_TC_FAILED_TO_SEND_APP_KEYS         = 0x0F,
  EMBER_TC_FAILED_TO_STORE_APP_KEY_REQUEST = 0x10,
  EMBER_TC_REJECTED_APP_KEY_REQUEST        = 0x11,
  EMBER_TC_FAILED_TO_GENERATE_NEW_KEY      = 0x12,
  EMBER_TC_FAILED_TO_SEND_TC_KEY           = 0x13,

  // These are generic status values for a key requester.
  EMBER_TRUST_CENTER_IS_PRE_R21            = 0x1E,

  // These are status values applying only to the Trust Center
  // verifying link keys.
  EMBER_TC_REQUESTER_VERIFY_KEY_TIMEOUT    = 0x32,
  EMBER_TC_REQUESTER_VERIFY_KEY_FAILURE    = 0x33,
  EMBER_TC_REQUESTER_VERIFY_KEY_SUCCESS    = 0x34,

  // These are status values applying only to the key requester
  // verifying link keys.
  EMBER_VERIFY_LINK_KEY_FAILURE            = 0x64,
  EMBER_VERIFY_LINK_KEY_SUCCESS            = 0x65,
};

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberTcLinkKeyRequestPolicy
#else
typedef uint8_t EmberTcLinkKeyRequestPolicy;
enum
#endif
{
  EMBER_DENY_TC_LINK_KEY_REQUESTS  = 0x00,
  EMBER_ALLOW_TC_LINK_KEY_REQUEST_AND_SEND_CURRENT_KEY = 0x01,
  // When using the following mode a unique random link key is created.
  // The key which is generated due to this mode is added to the link
  // key table. Therefore make sure that the link key table size is not
  // zero as this can result in the newly generated key not being saved
  // and communication breaking between the trust center and the nodes.
  EMBER_ALLOW_TC_LINK_KEY_REQUEST_AND_GENERATE_NEW_KEY = 0x02
};

#ifdef DOXYGEN_SHOULD_SKIP_THIS
enum EmberAppLinkKeyRequestPolicy
#else
typedef uint8_t EmberAppLinkKeyRequestPolicy;
enum
#endif
{
  EMBER_DENY_APP_LINK_KEY_REQUESTS  = 0x00,
  EMBER_ALLOW_APP_LINK_KEY_REQUEST = 0x01
};

#if defined DOXYGEN_SHOULD_SKIP_THIS
uint8_t* emberKeyContents(EmberKeyData* key);
#else
#define emberKeyContents(key) ((key)->contents)
#endif

#if defined DOXYGEN_SHOULD_SKIP_THIS
uint8_t* emberCertificateContents(EmberCertificateData* cert);
#else
#define emberCertificateContents(cert) ((cert)->contents)
#endif

#if defined DOXYGEN_SHOULD_SKIP_THIS
uint8_t* emberPublicKeyContents(EmberPublicKeyData* key);
#else
#define emberPublicKeyContents(key) ((key)->contents)
#endif

#if defined DOXYGEN_SHOULD_SKIP_THIS
uint8_t* emberPrivateKeyContents(EmberPrivateKeyData* key);
#else
#define emberPrivateKeyContents(key) ((key)->contents)
#endif

#if defined DOXYGEN_SHOULD_SKIP_THIS
uint8_t* emberSmacContents(EmberSmacData* key);
#else
#define emberSmacContents(key) ((key)->contents)
#endif

#if defined DOXYGEN_SHOULD_SKIP_THIS
uint8_t* emberSignatureContents(EmberSignatureData* sig);
#else
#define emberSignatureContents(sig) ((sig)->contents)
#endif

#if defined DOXYGEN_SHOULD_SKIP_THIS
uint8_t* emberCertificate283k1Contents(EmberCertificate283k1Data* cert);
#else
#define emberCertificate283k1Contents(cert) ((cert)->contents)
#endif

#if defined DOXYGEN_SHOULD_SKIP_THIS
uint8_t* emberPublicKey283k1Contents(EmberPublicKey283k1Data* key);
#else
#define emberPublicKey283k1Contents(key) ((key)->contents)
#endif

#if defined DOXYGEN_SHOULD_SKIP_THIS
uint8_t* emberPrivateKey283k1Contents(EmberPrivateKey283k1Data* key);
#else
#define emberPrivateKey283k1Contents(key) ((key)->contents)
#endif

#if defined DOXYGEN_SHOULD_SKIP_THIS
uint8_t* ember283k1SignatureContents(EmberSignature283k1Data* sig)