Zigbee Protocol Controller 1.6.0
zigpc_common_zigbee.c File Reference
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "sl_status.h"
#include "zigpc_common_zigbee.h"
#include "zigpc_common_unid.h"

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...
 
bool is_valid_zcl_attribute (const zcl_attribute_t attribute)
 checks if a given ZCL attribute is valid or not More...
 
bool is_valid_zcl_cluster (const zcl_cluster_type_t cluster)
 checks if a given ZCL cluster is valid or not 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...
 
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_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...
 
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...
 
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...
 
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 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...