Zigbee Protocol Controller 1.6.0

This header contains definitions that represent the Zigbee data types used in the Geko SDK,. More...

Classes

struct  zcl_frame_t
 
struct  zcl_command
 
struct  zcl_attribute
 
struct  zcl_cluster_type_t
 
struct  zigbee_endpoint_t
 a model for a zigbee ZCL endpoint More...
 
struct  zcl_profile
 
struct  zigbee_binding_t
 
struct  zigbee_node_t
 A model for a Zigbee End Node. More...
 

Macros

#define ZIGBEE_EUI64_SIZE   8
 Size of EUI64 (an IEEE address) in bytes (8) More...
 
#define ZIGBEE_NULL_EUI64
 EUI64 Invalid Identifier. More...
 
#define ZIGBEE_NULL_EUI64_UINT   0xFFFFFFFFFFFFFFFF
 EUI64 Invalid Identifier (int variant) More...
 
#define ZIGBEE_EUI64_HEX_STR_LENGTH   ((ZIGBEE_EUI64_SIZE * 2) + 1)
 Size of EUI64 string buffer. More...
 
#define ZIGBEE_EXTENDED_PAN_ID_SIZE   8
 Size of an extended PAN identifier in bytes (8). More...
 
#define ZIGBEE_INSTALL_CODE_LENGTH   (16 + 2)
 
#define ZIGBEE_MAX_ENDPOINT_COUNT   255
 
#define ZIGBEE_INVALID_APP_ENDPOINT_ID   0
 The default identifier for non-application endpoint identifier also known as the ZDO endpoint. More...
 
#define ZIGBEE_DEFAULT_APP_ENDPOINT_ID   1
 
#define ZCL_DEFAULT_STR_LENGTH   256
 Default string length for strings used in ZCL. More...
 
#define ZCL_DEFAULT_ARR_LENGTH   16
 Default string length for strings used in ZCL. More...
 
#define ZCL_GROUP_NAME_LENGTH   16
 Expected length of a zigbee group name, as supported in the ZCL specification. More...
 
#define ZCL_MIN_CLUSTER_ID   0x0000
 
#define ZCL_MIN_CLUSTER_ID   0x0000
 
#define ZCL_MAX_CLUSTER_ID   0x7fff
 
#define ZCL_MAX_CLUSTER_ID   0x7fff
 
#define ZCL_MIN_MFCTR_ID   0xfc00
 
#define ZCL_MIN_MFCTR_ID   0xfc00
 
#define ZCL_MAX_MFCTR_ID   0xffff
 
#define ZCL_MAX_MFCTR_ID   0xffff
 
#define ZCL_MIN_COMMAND_ID   0x00
 
#define ZCL_MIN_COMMAND_ID   0x00
 
#define ZCL_MAX_COMMAND_ID   0x7f
 
#define ZCL_MAX_COMMAND_ID   0x7f
 
#define ZCL_MIN_STD_ATTR_ID   0x0000
 
#define ZCL_MAX_STD_ATTR_ID   0x4fff
 
#define ZCL_MIN_GLOB_ATTR_ID   0xf000
 
#define ZCL_MAX_GLOB_ATTR_ID   0xfffe
 
#define ZCL_INVALID_CLUSTER_ID   (ZCL_MAX_CLUSTER_ID + 1)
 
#define ZCL_INVALID_ATTR_ID   (ZCL_MAX_STD_ATTR_ID + 1)
 
#define ZCL_INVALID_COMMAND_ID   0x80
 
#define ZCL_FRAME_BUFFER_SIZE_MAX   255
 
#define ZCL_FRAME_CONTROL_FRAME_TYPE_GLOBAL_COMMAND   ((uint8_t)(0x0 << 0))
 ZCL frame will be set as being a ZCL global command frame type. More...
 
#define ZCL_FRAME_CONTROL_FRAME_TYPE_CLUSTER   ((uint8_t)(0x1 << 0))
 ZCL frame will be set as being a cluster frame type. More...
 
#define ZCL_FRAME_CONTROL_DIRECTION_CLIENT_TO_SERVER   ((uint8_t)(0x0 << 3))
 ZCL frame will be sent as a client to server message. More...
 
#define ZCL_GLOBAL_COMMAND_ID_READ_ATTRIBUTES   (0x00)
 
#define ZCL_GLOBAL_COMMAND_ID_WRITE_ATTRIBUTES   (0x02)
 
#define ZCL_ATTRIBUTE_RESPONSE_RECORDS_MAX   20
 

Typedefs

typedef uint8_t zigbee_eui64_t[ZIGBEE_EUI64_SIZE]
 Zigbee Device EUI64 ID. More...
 
typedef uint64_t zigbee_eui64_uint_t
 Zigbee Device Identifier (stored as integer) More...
 
typedef uint8_t zigbee_install_code_t[ZIGBEE_INSTALL_CODE_LENGTH]
 Zigbee 3.0 Install Code. More...
 
typedef uint16_t zigbee_panid_t
 Zigbee Network PAN ID. More...
 
typedef uint8_t zigbee_ext_panid_t[ZIGBEE_EXTENDED_PAN_ID_SIZE]
 Zigbee Network Extended PAN ID. More...
 
typedef uint8_t zigbee_radio_channel_t
 Zigbee Network Radio Channel. More...
 
typedef uint16_t zigbee_group_id_t
 Zigbee Group Id The internal representation of a group_id. More...
 
typedef uint16_t zigbee_multicast_id_t
 
typedef uint8_t zigbee_endpoint_id_t
 A representation of the endpoint id used on the Zigbee protocol. More...
 
typedef uint16_t zcl_cluster_id_t
 A representation of the endpoint cluster id used in ZCL. More...
 
typedef uint16_t zcl_attribute_id_t
 A representation of the endpoint cluster attribute ID used in ZCL. More...
 
typedef uint8_t zcl_command_id_t
 
typedef uint8_t zcl_command_field_t
 
typedef struct zcl_command zcl_command_t
 
typedef enum e_zcl_cluster_side zcl_cluster_side_t
 An enum representing the role of the cluster on the network. More...
 
typedef struct zcl_attribute zcl_attribute_t
 
typedef struct zcl_profile zcl_profile_t
 
typedef enum zigbee_node_network_status zigbee_node_network_status_t
 The possible states that a Zigbee node can be in. More...
 

Enumerations

enum  zcl_command_type_t { ZCL_CLUSTER_GENERATED_COMMAND = 1 , ZCL_CLUSTER_RECEIVED_COMMAND = 2 }
 
enum  zcl_status_type { ZCL_OP_STATUS_SUCCESS = 0 }
 
enum  zcl_frame_data_type {
  ZCL_DATA_TYPE_UNKNOWN = 0 , ZCL_DATA_TYPE_BOOL = 0x10 , ZCL_DATA_TYPE_MAP8 = 0x18 , ZCL_DATA_TYPE_UINT8 = 0x20 ,
  ZCL_DATA_TYPE_UINT16 = 0x21 , ZCL_DATA_TYPE_UINT32 = 0x23 , ZCL_DATA_TYPE_INT8 = 0x28 , ZCL_DATA_TYPE_INT16 = 0x29 ,
  ZCL_DATA_TYPE_INT32 = 0x2A , ZCL_DATA_TYPE_ENUM8 = 0x30 , ZCL_DATA_TYPE_ENUM16 = 0x31 , ZCL_DATA_TYPE_MAX_VAL
}
 
enum  e_zcl_cluster_side { ZCL_CLUSTER_SERVER_SIDE = 1 , ZCL_CLUSTER_CLIENT_SIDE = 2 }
 An enum representing the role of the cluster on the network. More...
 
enum  e_zcl_attribute_type {
  ZCL_ATTR_TYPE_INVALID = -1 , ZCL_ATTR_TYPE_BOOL = 0x10 , ZCL_ATTR_TYPE_MAP8 = 0x18 , ZCL_ATTR_TYPE_UINT8 = 0x20 ,
  ZCL_ATTR_TYPE_UINT16 = 0x21 , ZCL_ATTR_TYPE_INT16 = 0x29 , ZCL_ATTR_TYPE_ENUM8 = 0x30 , ZCL_ATTR_TYPE_FLOAT = 0x38
}
 
enum  zigbee_node_network_status {
  ZIGBEE_NODE_STATUS_INVALID = 0 , ZIGBEE_NODE_STATUS_NODEID_ASSIGNED , ZIGBEE_NODE_STATUS_INCLUDED , ZIGBEE_NODE_STATUS_INTERVIEW_FAIL ,
  ZIGBEE_NODE_STATUS_INTERVIEWING , ZIGBEE_NODE_STATUS_OFFLINE , ZIGBEE_NODE_STATUS_UNAVAILABLE , ZIGBEE_NODE_STATUS_MAX_VAL
}
 The possible states that a Zigbee node can be in. More...
 
enum  zdo_status_t { ZDO_SUCCESS = 0x00 , ZDO_TABLE_FULL = 0x8c , ZDO_DEVICE_BIND_TABLE_FULL = 0x8e }
 

Functions

zigbee_eui64_uint_t zigbee_eui64_to_uint (const zigbee_eui64_t eui64)
 Convert the array EUI64 representation into 64-bit uint representation. More...
 
sl_status_t zigbee_uint_to_eui64 (zigbee_eui64_uint_t src, zigbee_eui64_t dest)
 Convert the 64-bit uint EUI64 representation into array representation. More...
 
void zigbee_eui64_copy_switch_endian (zigbee_eui64_t dst, const zigbee_eui64_t src)
 Copy EUI64 and switch endianness (BE<->LE) If the src EUI64 is LE, the populated dst EUI64 will be BE If the src EUI64 is BE, the populated dst EUI64 will be LE. More...
 
void zigpc_common_switch_endian (uint8_t *source, uint8_t *dest, size_t size)
 Copy a given buffer of data to another destination, inverting the endianness. More...
 
sl_status_t zigbee_eui64_to_str (const zigbee_eui64_t eui64, char *str_buf, const size_t str_length)
 Convert EUI64 (in BE) into string format based on the hex representation. More...
 
sl_status_t str_to_zigbee_eui64 (const char *str_buf, const size_t str_length, zigbee_eui64_t eui64)
 Extract the Zigbee EUI64 from a UNID string. Only the last 8 bytes of the number are considered. More...
 
sl_status_t zigpc_common_eui64_to_unid (const zigbee_eui64_t eui64, char *dest_unid, const size_t dest_unid_length)
 Convert the Zigbee EUI64 to a UNID string with the UNID prefix configured. More...
 
bool is_valid_zcl_command (const zcl_command_t command)
 check if a given zcl command is valid or not More...
 
sl_status_t copy_command (const zcl_command_t source, zcl_command_t *dest)
 Performs a deep copy of a ZCL Command. Does not require a "free"-ing of memory, as the zcl_command_t data structure is simple. More...
 
bool is_valid_zcl_attribute (const zcl_attribute_t attribute)
 checks if a given ZCL attribute is valid or not More...
 
sl_status_t copy_attribute_list (const zcl_attribute_t *const source, zcl_attribute_t *dest, unsigned int list_size)
 Performs a deep copy of a ZCL Attribute. Does not require a "free"-ing of memory, as the zcl_attribute_t data structure is simple. More...
 
bool is_valid_zcl_cluster (const zcl_cluster_type_t cluster)
 checks if a given ZCL cluster is valid or not More...
 
sl_status_t copy_cluster_list (const zcl_cluster_type_t *const source, zcl_cluster_type_t *dest, unsigned int list_size)
 Allocates memory and performs a deep copy of a ZCL Cluster Type. Memory allocated here must be freed. More...
 
bool is_valid_zigbee_node (const zigbee_node_t node)
 checks if a given zigbee node is valid or not. A zigbee node is considered valid if it has a valid EUI64, at least one valid endpoint and is active. More...
 
sl_status_t copy_node (const zigbee_node_t source, zigbee_node_t *dest)
 Allocates memory and performs a deep copy of a Zigbee Node. Memory allocated here must be freed. More...
 
bool is_valid_zigbee_endpoint (const zigbee_endpoint_t endpoint)
 checks if a given zigbee endpoint is valid or not. For now all endpoints are considered valid More...
 
sl_status_t copy_endpoint (const zigbee_endpoint_t source, zigbee_endpoint_t *dest)
 Allocates memory and performs a deep copy of a Zigbee Endpoint. Memory allocated here must be freed. More...
 
sl_status_t copy_endpoint_list (const zigbee_endpoint_t *const source, zigbee_endpoint_t *dest, unsigned int list_size)
 
sl_status_t zigpc_common_zcl_frame_init_command (zcl_frame_t *const frame, zcl_command_id_t command_id, uint8_t frame_control)
 Initialize the ZCL Frame for sending ZCL command. More...
 
sl_status_t zigpc_common_zcl_frame_fill_data (zcl_frame_t *const frame, enum zcl_frame_data_type type, const void *data)
 Populate the given ZCL frame with data. The data copied is dictated by the type passed in. Once successfully copied into the frame, the buffer size is incremented based on the size of the data type passed in. More...
 
sl_status_t zigpc_common_zcl_frame_fill_raw (zcl_frame_t *const frame, const uint8_t *const data, unsigned int data_size)
 Populate the given ZCL frame with data. Copies raw data from a buffer of a specified size. More...
 

Variables

static const zigbee_group_id_t ZIGBEE_NULL_GROUP_ID = 0
 ZIGBEE_NULL_GROUP_ID The NULL group id, usually used for unicast zigbee operations. More...
 
static const bool ATTR_DIRECTION_REPORTED = true
 
static const bool ATTR_DIRECTION_DESIRED = !ATTR_DIRECTION_REPORTED
 
static const zcl_command_t null_command
 a static data structure representing an NULL or INVALID value for ZCL commands More...
 
static const zigbee_binding_t NULL_BINDING = {0}
 

Detailed Description

This header contains definitions that represent the Zigbee data types used in the Geko SDK,.

Macro Definition Documentation

◆ ZCL_ATTRIBUTE_RESPONSE_RECORDS_MAX

#define ZCL_ATTRIBUTE_RESPONSE_RECORDS_MAX   20

◆ ZCL_DEFAULT_ARR_LENGTH

#define ZCL_DEFAULT_ARR_LENGTH   16

Default string length for strings used in ZCL.

◆ ZCL_DEFAULT_STR_LENGTH

#define ZCL_DEFAULT_STR_LENGTH   256

Default string length for strings used in ZCL.

◆ ZCL_FRAME_BUFFER_SIZE_MAX

#define ZCL_FRAME_BUFFER_SIZE_MAX   255

Maximum size of ZCL frame supported by ZigbeeHost.

◆ ZCL_FRAME_CONTROL_DIRECTION_CLIENT_TO_SERVER

#define ZCL_FRAME_CONTROL_DIRECTION_CLIENT_TO_SERVER   ((uint8_t)(0x0 << 3))

ZCL frame will be sent as a client to server message.

◆ ZCL_FRAME_CONTROL_FRAME_TYPE_CLUSTER

#define ZCL_FRAME_CONTROL_FRAME_TYPE_CLUSTER   ((uint8_t)(0x1 << 0))

ZCL frame will be set as being a cluster frame type.

◆ ZCL_FRAME_CONTROL_FRAME_TYPE_GLOBAL_COMMAND

#define ZCL_FRAME_CONTROL_FRAME_TYPE_GLOBAL_COMMAND   ((uint8_t)(0x0 << 0))

ZCL frame will be set as being a ZCL global command frame type.

◆ ZCL_GLOBAL_COMMAND_ID_READ_ATTRIBUTES

#define ZCL_GLOBAL_COMMAND_ID_READ_ATTRIBUTES   (0x00)

◆ ZCL_GLOBAL_COMMAND_ID_WRITE_ATTRIBUTES

#define ZCL_GLOBAL_COMMAND_ID_WRITE_ATTRIBUTES   (0x02)

◆ ZCL_GROUP_NAME_LENGTH

#define ZCL_GROUP_NAME_LENGTH   16

Expected length of a zigbee group name, as supported in the ZCL specification.

◆ ZCL_INVALID_ATTR_ID

#define ZCL_INVALID_ATTR_ID   (ZCL_MAX_STD_ATTR_ID + 1)

ZCL Invalid Command ID A number outside the recognized range of command ID's The expected range of ZCL command ID's is 0x00 - 0x7f ZCL Invalid Attribute ID A number outside the recognized range of attribute ID's

◆ ZCL_INVALID_CLUSTER_ID

#define ZCL_INVALID_CLUSTER_ID   (ZCL_MAX_CLUSTER_ID + 1)

ZCL Invalid Cluster ID A number outside the recognized range of cluster ID's The expected range of ZCL cluster ID's is 0x0000 - 0x7fff (0xfc00 - 0xffff is manufacturer reserved)

◆ ZCL_INVALID_COMMAND_ID

#define ZCL_INVALID_COMMAND_ID   0x80

◆ ZCL_MAX_CLUSTER_ID [1/2]

#define ZCL_MAX_CLUSTER_ID   0x7fff

◆ ZCL_MAX_CLUSTER_ID [2/2]

#define ZCL_MAX_CLUSTER_ID   0x7fff

◆ ZCL_MAX_COMMAND_ID [1/2]

#define ZCL_MAX_COMMAND_ID   0x7f

◆ ZCL_MAX_COMMAND_ID [2/2]

#define ZCL_MAX_COMMAND_ID   0x7f

◆ ZCL_MAX_GLOB_ATTR_ID

#define ZCL_MAX_GLOB_ATTR_ID   0xfffe

◆ ZCL_MAX_MFCTR_ID [1/2]

#define ZCL_MAX_MFCTR_ID   0xffff

◆ ZCL_MAX_MFCTR_ID [2/2]

#define ZCL_MAX_MFCTR_ID   0xffff

◆ ZCL_MAX_STD_ATTR_ID

#define ZCL_MAX_STD_ATTR_ID   0x4fff

◆ ZCL_MIN_CLUSTER_ID [1/2]

#define ZCL_MIN_CLUSTER_ID   0x0000

ZCL Cluster ID Standard Ranges Definitions representing the standard range of ZCL Cluster ID's

◆ ZCL_MIN_CLUSTER_ID [2/2]

#define ZCL_MIN_CLUSTER_ID   0x0000

ZCL Cluster ID Standard Ranges Definitions representing the standard range of ZCL Cluster ID's

◆ ZCL_MIN_COMMAND_ID [1/2]

#define ZCL_MIN_COMMAND_ID   0x00

ZCL Command ID Standard Range Definitions representing the standard range of ZCL Command ID's

◆ ZCL_MIN_COMMAND_ID [2/2]

#define ZCL_MIN_COMMAND_ID   0x00

ZCL Command ID Standard Range Definitions representing the standard range of ZCL Command ID's

◆ ZCL_MIN_GLOB_ATTR_ID

#define ZCL_MIN_GLOB_ATTR_ID   0xf000

◆ ZCL_MIN_MFCTR_ID [1/2]

#define ZCL_MIN_MFCTR_ID   0xfc00

◆ ZCL_MIN_MFCTR_ID [2/2]

#define ZCL_MIN_MFCTR_ID   0xfc00

◆ ZCL_MIN_STD_ATTR_ID

#define ZCL_MIN_STD_ATTR_ID   0x0000

ZCL Attribute ID Standard Ranges Definitions representing the standard range of ZCL Attribute ID's

◆ ZIGBEE_DEFAULT_APP_ENDPOINT_ID

#define ZIGBEE_DEFAULT_APP_ENDPOINT_ID   1

◆ ZIGBEE_EUI64_HEX_STR_LENGTH

#define ZIGBEE_EUI64_HEX_STR_LENGTH   ((ZIGBEE_EUI64_SIZE * 2) + 1)

Size of EUI64 string buffer.

◆ ZIGBEE_EUI64_SIZE

#define ZIGBEE_EUI64_SIZE   8

Size of EUI64 (an IEEE address) in bytes (8)

◆ ZIGBEE_EXTENDED_PAN_ID_SIZE

#define ZIGBEE_EXTENDED_PAN_ID_SIZE   8

Size of an extended PAN identifier in bytes (8).

◆ ZIGBEE_INSTALL_CODE_LENGTH

#define ZIGBEE_INSTALL_CODE_LENGTH   (16 + 2)

Zigbee Install Code length

  • 6, 8, 12, or 16 bytes plus two-byte CRC

◆ ZIGBEE_INVALID_APP_ENDPOINT_ID

#define ZIGBEE_INVALID_APP_ENDPOINT_ID   0

The default identifier for non-application endpoint identifier also known as the ZDO endpoint.

◆ ZIGBEE_MAX_ENDPOINT_COUNT

#define ZIGBEE_MAX_ENDPOINT_COUNT   255

Maximum number of endpoints supported in the Zigbee protocol (1-254).

◆ ZIGBEE_NULL_EUI64

#define ZIGBEE_NULL_EUI64
Value:
{ \
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF \
}

EUI64 Invalid Identifier.

◆ ZIGBEE_NULL_EUI64_UINT

#define ZIGBEE_NULL_EUI64_UINT   0xFFFFFFFFFFFFFFFF

EUI64 Invalid Identifier (int variant)

Typedef Documentation

◆ zcl_attribute_id_t

typedef uint16_t zcl_attribute_id_t

A representation of the endpoint cluster attribute ID used in ZCL.

◆ zcl_attribute_t

zcl_attribute_t

◆ zcl_cluster_id_t

typedef uint16_t zcl_cluster_id_t

A representation of the endpoint cluster id used in ZCL.

zcl_cluster_id_t

◆ zcl_cluster_side_t

An enum representing the role of the cluster on the network.

e_zcl_cluster_role

◆ zcl_command_field_t

typedef uint8_t zcl_command_field_t

◆ zcl_command_id_t

typedef uint8_t zcl_command_id_t

◆ zcl_command_t

typedef struct zcl_command zcl_command_t

zcl_command_t

◆ zcl_profile_t

typedef struct zcl_profile zcl_profile_t

◆ zigbee_endpoint_id_t

typedef uint8_t zigbee_endpoint_id_t

A representation of the endpoint id used on the Zigbee protocol.

zigbee_endpoint_id_t

◆ zigbee_eui64_t

typedef uint8_t zigbee_eui64_t[ZIGBEE_EUI64_SIZE]

Zigbee Device EUI64 ID.

NOTE: This is stored in big-endian format

◆ zigbee_eui64_uint_t

typedef uint64_t zigbee_eui64_uint_t

Zigbee Device Identifier (stored as integer)

◆ zigbee_ext_panid_t

typedef uint8_t zigbee_ext_panid_t[ZIGBEE_EXTENDED_PAN_ID_SIZE]

Zigbee Network Extended PAN ID.

◆ zigbee_group_id_t

typedef uint16_t zigbee_group_id_t

Zigbee Group Id The internal representation of a group_id.

◆ zigbee_install_code_t

typedef uint8_t zigbee_install_code_t[ZIGBEE_INSTALL_CODE_LENGTH]

Zigbee 3.0 Install Code.

NOTE: This is stored in big-endian format

◆ zigbee_multicast_id_t

typedef uint16_t zigbee_multicast_id_t

◆ zigbee_node_network_status_t

The possible states that a Zigbee node can be in.

◆ zigbee_panid_t

typedef uint16_t zigbee_panid_t

Zigbee Network PAN ID.

◆ zigbee_radio_channel_t

typedef uint8_t zigbee_radio_channel_t

Zigbee Network Radio Channel.

Enumeration Type Documentation

◆ e_zcl_attribute_type

Enumerator
ZCL_ATTR_TYPE_INVALID 
ZCL_ATTR_TYPE_BOOL 
ZCL_ATTR_TYPE_MAP8 
ZCL_ATTR_TYPE_UINT8 
ZCL_ATTR_TYPE_UINT16 
ZCL_ATTR_TYPE_INT16 
ZCL_ATTR_TYPE_ENUM8 
ZCL_ATTR_TYPE_FLOAT 

◆ e_zcl_cluster_side

An enum representing the role of the cluster on the network.

e_zcl_cluster_role

Enumerator
ZCL_CLUSTER_SERVER_SIDE 
ZCL_CLUSTER_CLIENT_SIDE 

◆ zcl_command_type_t

Enumerator
ZCL_CLUSTER_GENERATED_COMMAND 

(Out) Command generated by cluster

ZCL_CLUSTER_RECEIVED_COMMAND 

(In) Command parsed by cluster

◆ zcl_frame_data_type

Enumerator
ZCL_DATA_TYPE_UNKNOWN 
ZCL_DATA_TYPE_BOOL 
ZCL_DATA_TYPE_MAP8 
ZCL_DATA_TYPE_UINT8 
ZCL_DATA_TYPE_UINT16 
ZCL_DATA_TYPE_UINT32 
ZCL_DATA_TYPE_INT8 
ZCL_DATA_TYPE_INT16 
ZCL_DATA_TYPE_INT32 
ZCL_DATA_TYPE_ENUM8 
ZCL_DATA_TYPE_ENUM16 
ZCL_DATA_TYPE_MAX_VAL 

◆ zcl_status_type

Enumerator
ZCL_OP_STATUS_SUCCESS 

◆ zdo_status_t

Enumerator
ZDO_SUCCESS 
ZDO_TABLE_FULL 
ZDO_DEVICE_BIND_TABLE_FULL 

◆ zigbee_node_network_status

The possible states that a Zigbee node can be in.

Enumerator
ZIGBEE_NODE_STATUS_INVALID 
ZIGBEE_NODE_STATUS_NODEID_ASSIGNED 

This state corresponds to when the node has completed joining the protocol controller network.

ZIGBEE_NODE_STATUS_INCLUDED 

This state corresponds to when the node has completed interviewing and ready to be serviced by the protocol controller.

ZIGBEE_NODE_STATUS_INTERVIEW_FAIL 

This state corresponds to when the node has timed out from the interview process.

ZIGBEE_NODE_STATUS_INTERVIEWING 

This state corresponds to when the node is in the process of being interviewed by the protocol controller.

ZIGBEE_NODE_STATUS_OFFLINE 

This state corresponds to when the node has not been reachable by the protocol controller for a long time.

ZIGBEE_NODE_STATUS_UNAVAILABLE 

This state corresponds to when the node is not accepting any commands from the protocol controller.

ZIGBEE_NODE_STATUS_MAX_VAL 

Function Documentation

◆ copy_attribute_list()

sl_status_t copy_attribute_list ( const zcl_attribute_t *const  source,
zcl_attribute_t dest,
unsigned int  list_size 
)

Performs a deep copy of a ZCL Attribute. Does not require a "free"-ing of memory, as the zcl_attribute_t data structure is simple.

copy_attribute

Parameters
source- the source zcl_attribute_t that we want to copy. expected to have valid data
dest- the destination zcl_attribute where we are copying to
list_size- capacity of the destination zcl_attribute list
Returns
the status of the operation. fails if we are trying to copy an invalid ZCL attribute or if the destination is NULL

◆ copy_cluster_list()

sl_status_t copy_cluster_list ( const zcl_cluster_type_t *const  source,
zcl_cluster_type_t dest,
unsigned int  list_size 
)

Allocates memory and performs a deep copy of a ZCL Cluster Type. Memory allocated here must be freed.

copy_cluster

Parameters
source- the source zcl_cluster_type_t that we want to copy. expected to have valid data
dest- the destination zcl_cluster_type_t where we are copying to
list_size- capacity of the destination zcl_cluster_type_t list
Returns
the status of the operation. fails if we are trying to copy an invalid ZCL cluster or if we run out of memory

◆ copy_command()

sl_status_t copy_command ( const zcl_command_t  source,
zcl_command_t dest 
)

Performs a deep copy of a ZCL Command. Does not require a "free"-ing of memory, as the zcl_command_t data structure is simple.

copy_command

Parameters
source- the source zcl_command_t that we want to copy. expected to have valid data
dest- the destination zcl_command where we are copying to
Returns
the status of the operation. fails if we are trying to copy an invalid ZCL command or if the destination is NULL

◆ copy_endpoint()

sl_status_t copy_endpoint ( const zigbee_endpoint_t  source,
zigbee_endpoint_t dest 
)

Allocates memory and performs a deep copy of a Zigbee Endpoint. Memory allocated here must be freed.

copy_endpoint

Parameters
source- the source zigbee_endpoint_t that we want to copy. expected to have valid data
dest- the destination zigbee_endpoint_t where we are copying to
Returns
the status of the operation. fails if we are trying to copy an invalid Zigbee Endpoint or if we run out of memory

◆ copy_endpoint_list()

sl_status_t copy_endpoint_list ( const zigbee_endpoint_t *const  source,
zigbee_endpoint_t dest,
unsigned int  list_size 
)

◆ copy_node()

sl_status_t copy_node ( const zigbee_node_t  source,
zigbee_node_t dest 
)

Allocates memory and performs a deep copy of a Zigbee Node. Memory allocated here must be freed.

copy_node

Parameters
source- the source zigbee_node that we want to copy. expected to have valid data
dest- the destination zigbee_node where we are copying to
Returns
the status of the operation. fails if we are trying to copy invalid data or if we run out of memory

◆ is_valid_zcl_attribute()

bool is_valid_zcl_attribute ( const zcl_attribute_t  attribute)

checks if a given ZCL attribute is valid or not

is_valid_zcl_attribute

Parameters
attribute- the attribute to check
Returns
true if the attribute is valid, otherwise false

◆ is_valid_zcl_cluster()

bool is_valid_zcl_cluster ( const zcl_cluster_type_t  cluster)

checks if a given ZCL cluster is valid or not

is_valid_zcl_cluster

Parameters
cluster- the cluster to check
Returns
true if the cluster type is valid, otherwise false

◆ is_valid_zcl_command()

bool is_valid_zcl_command ( const zcl_command_t  command)

check if a given zcl command is valid or not

is_valid_zcl_command

Checks if a a given ZCL command has a valid cluster ID and command ID.

Parameters
command- the ZCL command to check
Returns
true if the command is valid, otherwise false

◆ is_valid_zigbee_endpoint()

bool is_valid_zigbee_endpoint ( const zigbee_endpoint_t  endpoint)

checks if a given zigbee endpoint is valid or not. For now all endpoints are considered valid

is_valid_zigbee_endpoint

Parameters
endpoint- the endpoint to check
Returns
true if the endpoint is valid, otherwise false

◆ is_valid_zigbee_node()

bool is_valid_zigbee_node ( const zigbee_node_t  node)

checks if a given zigbee node is valid or not. A zigbee node is considered valid if it has a valid EUI64, at least one valid endpoint and is active.

is_valid_zigbee_node

Parameters
node- the node to check
Returns
true if the node is valid, otherwise false

◆ str_to_zigbee_eui64()

sl_status_t str_to_zigbee_eui64 ( const char *  str_buf,
const size_t  str_length,
zigbee_eui64_t  eui64 
)

Extract the Zigbee EUI64 from a UNID string. Only the last 8 bytes of the number are considered.

For example: "11111110123456789abcdef" string is converted to {0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef} = {1, 35, 69, 103, 137, 171, 205, 239}

Parameters
str_bufsource string
str_lengthsource string length
eui64destination EUI64 to populate
Returns
sl_status_t SL_STATUS_OK or SL_STATUS_FAIL if string contains characters that cannot be translated to an EUI64 identifier

◆ zigbee_eui64_copy_switch_endian()

void zigbee_eui64_copy_switch_endian ( zigbee_eui64_t  dst,
const zigbee_eui64_t  src 
)

Copy EUI64 and switch endianness (BE<->LE) If the src EUI64 is LE, the populated dst EUI64 will be BE If the src EUI64 is BE, the populated dst EUI64 will be LE.

Parameters
dstdestination EUI64 with switched endianness
srcsource EUI64 to copy from

◆ zigbee_eui64_to_str()

sl_status_t zigbee_eui64_to_str ( const zigbee_eui64_t  eui64,
char *  str_buf,
const size_t  str_length 
)

Convert EUI64 (in BE) into string format based on the hex representation.

For example: EUI64 of {0x0, 0x1, 0x2, 0x3, 0x4, 0x0, 0x0, 0x0} will be transformed into "0001020304000000".

Parameters
eui64source EUI64
str_bufdestination buffer
str_lengthdestination buffer length, should be equal to ZIGBEE_EUI64_HEX_STR_LENGTH
Returns
sl_status_t SL_STATUS_OK or SL_STATUS_WOULD_OVERFLOW if insufficient space is in str_buf

◆ zigbee_eui64_to_uint()

zigbee_eui64_uint_t zigbee_eui64_to_uint ( const zigbee_eui64_t  eui64)

Convert the array EUI64 representation into 64-bit uint representation.

Parameters
eui64EUI64 array to convert
Returns
zigbee_eui64_uint_t 0xFFFFFFFFFFFFFFFF if the conversion is unsuccessful, else the int representation.

◆ zigbee_uint_to_eui64()

sl_status_t zigbee_uint_to_eui64 ( zigbee_eui64_uint_t  src,
zigbee_eui64_t  dest 
)

Convert the 64-bit uint EUI64 representation into array representation.

Parameters
srcEUI64 uint representation.
destEUI64 array to populate.
Returns
sl_status_t SL_STATUS_OK if successful, SL_STATUS_NULL_POINTER if invalid destination pointer is given.

◆ zigpc_common_eui64_to_unid()

sl_status_t zigpc_common_eui64_to_unid ( const zigbee_eui64_t  eui64,
char *  dest_unid,
const size_t  dest_unid_length 
)

Convert the Zigbee EUI64 to a UNID string with the UNID prefix configured.

Parameters
eui64source EUI64
dest_unidDestination character array
dest_unid_lengthDestination array capacity
Returns
sl_status_t SL_STATUS_OK on successful conversion, SL_STATUS_NULL_POINTER on invalid inputs, or SL_STATUS_WOULD_OVERFLOW if destination character array is too small to fit the UNID string.

◆ zigpc_common_switch_endian()

void zigpc_common_switch_endian ( uint8_t *  source,
uint8_t *  dest,
size_t  size 
)

Copy a given buffer of data to another destination, inverting the endianness.

Parameters
source- the source data
dest- the destination to copy
size- the size of the destination buffer

◆ zigpc_common_zcl_frame_fill_data()

sl_status_t zigpc_common_zcl_frame_fill_data ( zcl_frame_t *const  frame,
enum zcl_frame_data_type  type,
const void *  data 
)

Populate the given ZCL frame with data. The data copied is dictated by the type passed in. Once successfully copied into the frame, the buffer size is incremented based on the size of the data type passed in.

Parameters
framePointer to the ZCL frame to be populated.
typeType of data to be transferred to the frame.
dataPointer to the data to be transferred.
Returns
sl_status_t SL_STATUS_OK on success, SL_STATUS_NULL_POINTER if if invalid pointers are passed in.

◆ zigpc_common_zcl_frame_fill_raw()

sl_status_t zigpc_common_zcl_frame_fill_raw ( zcl_frame_t *const  frame,
const uint8_t *const  data,
unsigned int  data_size 
)

Populate the given ZCL frame with data. Copies raw data from a buffer of a specified size.

Parameters
framePointer to the ZCL frame to be populated.
dataPointer to the data to be transferred.
data_sizeThe size of data
Returns
sl_status_t SL_STATUS_OK on success, SL_STATUS_NULL_POINTER if if invalid pointers are passed in. Fails if attempting to copy more data than can be stored in frame

◆ zigpc_common_zcl_frame_init_command()

sl_status_t zigpc_common_zcl_frame_init_command ( zcl_frame_t *const  frame,
zcl_command_id_t  command_id,
uint8_t  frame_control 
)

Initialize the ZCL Frame for sending ZCL command.

Parameters
framePointer to frame to be initialized.
command_idZCL Command ID to be populated in the frame.
frame_controlZCL frame control field to be populated.
Returns
sl_status_t SL_STATUS_OK on success, SL_STATUS_NULL_POINTER if if invalid pointers are passed in.

Variable Documentation

◆ ATTR_DIRECTION_DESIRED

const bool ATTR_DIRECTION_DESIRED = !ATTR_DIRECTION_REPORTED
static

◆ ATTR_DIRECTION_REPORTED

const bool ATTR_DIRECTION_REPORTED = true
static

◆ NULL_BINDING

const zigbee_binding_t NULL_BINDING = {0}
static

◆ null_command

const zcl_command_t null_command
static
Initial value:
= {
.cluster_id = ZCL_INVALID_CLUSTER_ID, .command_id = ZCL_INVALID_COMMAND_ID}
#define ZCL_INVALID_COMMAND_ID
Definition: zigpc_common_zigbee.h:149
#define ZCL_INVALID_CLUSTER_ID
Definition: zigpc_common_zigbee.h:136

a static data structure representing an NULL or INVALID value for ZCL commands

null_command

◆ ZIGBEE_NULL_GROUP_ID

const zigbee_group_id_t ZIGBEE_NULL_GROUP_ID = 0
static

ZIGBEE_NULL_GROUP_ID The NULL group id, usually used for unicast zigbee operations.