Zigbee Protocol Controller 1.6.0
zigpc_gateway_notify.c File Reference
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <sl_log.h>
#include <sl_status.h>
#include <zigpc_common_observable.h>
#include "zigpc_gateway_notify.h"
#include "zigpc_gateway_int.h"

Functions

sl_status_t zigpc_gateway_register_observer (enum zigpc_gateway_notify_event event, zigpc_observer_callback_t callback)
 Register an observer to be informed of ZigbeeHost updates. If the observer is already registered, nothing will be done. More...
 
sl_status_t zigpc_gateway_unregister_observer (enum zigpc_gateway_notify_event event, zigpc_observer_callback_t callback)
 Unregister an observer from ZigbeeHost updates. If the observer is not found, nothing will be done. More...
 
sl_status_t zigpc_gateway_reset_observers (void)
 Clear registered observers. More...
 
void zigpc_gateway_hdl_on_network_initialized (const sl_zigbee_network_parameters_t *network)
 ZigbeeHost handler for network initialization. More...
 
void zigpc_gateway_hdl_on_node_add_start (const sl_802154_long_addr_t eui64_le)
 ZigbeeHost callback handler when a node has started joining the network. This handler will notify any listening components of the node that has started the join process. More...
 
void zigpc_gateway_hdl_on_node_add_complete (const sl_802154_long_addr_t eui64_le)
 ZigbeeHost callback handler when a node has finished joining the network. This handler will notify any listening components of the node that has completed the join process. More...
 
void zigpc_gateway_hdl_on_node_removed (const sl_802154_long_addr_t eui64_le)
 Notify handler for device removal complete callback. More...
 
void zigpc_gateway_hdl_on_device_endpoints_discovered (const sl_802154_long_addr_t eui64_le, uint8_t endpointCount, const uint8_t *endpointList)
 Notify handler for device discovery containing endpoint count. More...
 
void zigpc_gateway_hdl_on_endpoint_clusters_discovered (const sl_802154_long_addr_t eui64_le, const sl_zigbee_af_cluster_list_t *endpointInfo)
 Notify handler for ZDO simple descriptor response containing endpoint discovery information. More...
 
void zigpc_gateway_hdl_on_reported_attribute (const sl_802154_long_addr_t eui64_le, uint8_t endpoint, uint16_t clusterId, uint8_t *attribute_status_records, uint16_t attribute_status_records_size)
 
void zigpc_gateway_hdl_on_read_attributes (const sl_802154_long_addr_t eui64_le, uint8_t endpoint, uint16_t clusterId, uint8_t *attribute_status_records, uint16_t attribute_status_records_size)
 
void zigpc_gateway_hdl_on_configure_response (const sl_802154_long_addr_t eui64_le, uint8_t endpoint, uint16_t clusterId, uint8_t *attribute_status_records, uint16_t attribute_status_records_size)
 
sl_zigbee_af_status_t zigpc_gateway_hdl_on_cmd_received (const sl_802154_long_addr_t eui64_le, uint8_t endpoint, uint16_t clusterId, uint8_t commandId, bool commandFromServerToClient, const uint8_t *buffer, uint16_t bufferLength, uint8_t bufferPayloadStartIndex)
 
void zigpc_gateway_hdl_on_ota_update_started (const sl_802154_long_addr_t eui64, uint16_t manufacturerId, uint16_t imageTypeId, uint32_t firmwareVersion)
 
void zigpc_gateway_hdl_on_ota_update_completed (const sl_802154_long_addr_t eui64, uint16_t manufacturerId, uint16_t imageTypeId, uint32_t firmwareVersion, sl_zigbee_af_status_t otaStatus)
 
void zigpc_gateway_hdl_bind_unbind_response (const sl_802154_long_addr_t sourceEui64, uint8_t sourceEndpoint, uint16_t clusterId, const sl_802154_long_addr_t destEui64, uint8_t destEndpoint, bool isBindResponse, uint8_t zdoStatus)
 

Variables

struct zigpc_observable zigpc_gateway_observable
 Reference to Registered Gateway Observers. More...
 
struct zigbeeHostCallbacks zigpc_gateway_zigbee_host_callbacks
 

Function Documentation

◆ zigpc_gateway_hdl_bind_unbind_response()

void zigpc_gateway_hdl_bind_unbind_response ( const sl_802154_long_addr_t  sourceEui64,
uint8_t  sourceEndpoint,
uint16_t  clusterId,
const sl_802154_long_addr_t  destEui64,
uint8_t  destEndpoint,
bool  isBindResponse,
uint8_t  zdoStatus 
)

◆ zigpc_gateway_hdl_on_cmd_received()

sl_zigbee_af_status_t zigpc_gateway_hdl_on_cmd_received ( const sl_802154_long_addr_t  eui64_le,
uint8_t  endpoint,
uint16_t  clusterId,
uint8_t  commandId,
bool  commandFromServerToClient,
const uint8_t *  buffer,
uint16_t  bufferLength,
uint8_t  bufferPayloadStartIndex 
)

◆ zigpc_gateway_hdl_on_configure_response()

void zigpc_gateway_hdl_on_configure_response ( const sl_802154_long_addr_t  eui64_le,
uint8_t  endpoint,
uint16_t  clusterId,
uint8_t *  attribute_status_records,
uint16_t  attribute_status_records_size 
)

◆ zigpc_gateway_hdl_on_device_endpoints_discovered()

void zigpc_gateway_hdl_on_device_endpoints_discovered ( const sl_802154_long_addr_t  eui64_le,
uint8_t  endpointCount,
const uint8_t *  endpointList 
)

Notify handler for device discovery containing endpoint count.

Parameters
eui64_leDevice identifier.
endpointCountNumber of endpoints discovery events to expect.
endpointListList of endpoints discovered.

◆ zigpc_gateway_hdl_on_endpoint_clusters_discovered()

void zigpc_gateway_hdl_on_endpoint_clusters_discovered ( const sl_802154_long_addr_t  eui64_le,
const sl_zigbee_af_cluster_list_t *  endpointInfo 
)

Notify handler for ZDO simple descriptor response containing endpoint discovery information.

Parameters
eui64_leDevice identifier
endpointInfoDiscovered endpoint information

◆ zigpc_gateway_hdl_on_network_initialized()

void zigpc_gateway_hdl_on_network_initialized ( const sl_zigbee_network_parameters_t *  network)

ZigbeeHost handler for network initialization.

Parameters
networkNetwork properties.

◆ zigpc_gateway_hdl_on_node_add_complete()

void zigpc_gateway_hdl_on_node_add_complete ( const sl_802154_long_addr_t  eui64_le)

ZigbeeHost callback handler when a node has finished joining the network. This handler will notify any listening components of the node that has completed the join process.

Parameters
eui64_leJoined node identifier in little endian

◆ zigpc_gateway_hdl_on_node_add_start()

void zigpc_gateway_hdl_on_node_add_start ( const sl_802154_long_addr_t  eui64_le)

ZigbeeHost callback handler when a node has started joining the network. This handler will notify any listening components of the node that has started the join process.

Parameters
eui64_leJoining node identifier in little endian

◆ zigpc_gateway_hdl_on_node_removed()

void zigpc_gateway_hdl_on_node_removed ( const sl_802154_long_addr_t  eui64_le)

Notify handler for device removal complete callback.

Parameters
eui64_leDevice identifier

◆ zigpc_gateway_hdl_on_ota_update_completed()

void zigpc_gateway_hdl_on_ota_update_completed ( const sl_802154_long_addr_t  eui64,
uint16_t  manufacturerId,
uint16_t  imageTypeId,
uint32_t  firmwareVersion,
sl_zigbee_af_status_t  otaStatus 
)

◆ zigpc_gateway_hdl_on_ota_update_started()

void zigpc_gateway_hdl_on_ota_update_started ( const sl_802154_long_addr_t  eui64,
uint16_t  manufacturerId,
uint16_t  imageTypeId,
uint32_t  firmwareVersion 
)

◆ zigpc_gateway_hdl_on_read_attributes()

void zigpc_gateway_hdl_on_read_attributes ( const sl_802154_long_addr_t  eui64_le,
uint8_t  endpoint,
uint16_t  clusterId,
uint8_t *  attribute_status_records,
uint16_t  attribute_status_records_size 
)

◆ zigpc_gateway_hdl_on_reported_attribute()

void zigpc_gateway_hdl_on_reported_attribute ( const sl_802154_long_addr_t  eui64_le,
uint8_t  endpoint,
uint16_t  clusterId,
uint8_t *  attribute_status_records,
uint16_t  attribute_status_records_size 
)

◆ zigpc_gateway_reset_observers()

sl_status_t zigpc_gateway_reset_observers ( void  )

Clear registered observers.

Variable Documentation

◆ zigpc_gateway_observable

struct zigpc_observable zigpc_gateway_observable

Reference to Registered Gateway Observers.

Internal API for notify system

◆ zigpc_gateway_zigbee_host_callbacks

struct zigbeeHostCallbacks zigpc_gateway_zigbee_host_callbacks
Initial value:
= {
.onEmberAfStackInitalized = NULL,
.onEmberAfNcpPreReset = zigpc_gateway_on_ncp_pre_reset,
.onEmberAfNcpPostReset = zigpc_gateway_on_ncp_post_reset,
.onNetworkDeviceJoin = zigpc_gateway_hdl_on_node_add_start,
.onTrustCenterDeviceJoinComplete = zigpc_gateway_hdl_on_node_add_complete,
.onNetworkDeviceLeaveResponse = zigpc_gateway_hdl_on_node_removed,
.onZdoActiveEndpointsResponse
.onZdoSimpleDescriptorResponse
.onReportedAttributeChange = zigpc_gateway_hdl_on_reported_attribute,
.onReadAttributesResponse = zigpc_gateway_hdl_on_read_attributes,
.onConfigureReportingResponse = zigpc_gateway_hdl_on_configure_response,
.onClusterCommandReceived = zigpc_gateway_hdl_on_cmd_received,
}
#define NULL
Definition: list.c:50
void zigpc_gateway_on_ncp_post_reset(void)
ZigbeeHost callback handler called after NCP resets and is going through initialization.
void zigpc_gateway_on_ncp_pre_reset(sl_zigbee_ezsp_status_t resetStatus)
Z3Gatway callback handler to be called before NCP resets.
void zigpc_gateway_hdl_bind_unbind_response(const sl_802154_long_addr_t sourceEui64, uint8_t sourceEndpoint, uint16_t clusterId, const sl_802154_long_addr_t destEui64, uint8_t destEndpoint, bool isBindResponse, uint8_t zdoStatus)
Definition: zigpc_gateway_notify.c:576
void zigpc_gateway_hdl_on_configure_response(const sl_802154_long_addr_t eui64_le, uint8_t endpoint, uint16_t clusterId, uint8_t *attribute_status_records, uint16_t attribute_status_records_size)
Definition: zigpc_gateway_notify.c:413
void zigpc_gateway_hdl_on_node_add_complete(const sl_802154_long_addr_t eui64_le)
ZigbeeHost callback handler when a node has finished joining the network. This handler will notify an...
Definition: zigpc_gateway_notify.c:143
sl_zigbee_af_status_t zigpc_gateway_hdl_on_cmd_received(const sl_802154_long_addr_t eui64_le, uint8_t endpoint, uint16_t clusterId, uint8_t commandId, bool commandFromServerToClient, const uint8_t *buffer, uint16_t bufferLength, uint8_t bufferPayloadStartIndex)
Definition: zigpc_gateway_notify.c:460
void zigpc_gateway_hdl_on_endpoint_clusters_discovered(const sl_802154_long_addr_t eui64_le, const sl_zigbee_af_cluster_list_t *endpointInfo)
Notify handler for ZDO simple descriptor response containing endpoint discovery information.
Definition: zigpc_gateway_notify.c:246
void zigpc_gateway_hdl_on_ota_update_completed(const sl_802154_long_addr_t eui64, uint16_t manufacturerId, uint16_t imageTypeId, uint32_t firmwareVersion, sl_zigbee_af_status_t otaStatus)
Definition: zigpc_gateway_notify.c:549
void zigpc_gateway_hdl_on_node_add_start(const sl_802154_long_addr_t eui64_le)
ZigbeeHost callback handler when a node has started joining the network. This handler will notify any...
Definition: zigpc_gateway_notify.c:117
void zigpc_gateway_hdl_on_read_attributes(const sl_802154_long_addr_t eui64_le, uint8_t endpoint, uint16_t clusterId, uint8_t *attribute_status_records, uint16_t attribute_status_records_size)
Definition: zigpc_gateway_notify.c:368
void zigpc_gateway_hdl_on_reported_attribute(const sl_802154_long_addr_t eui64_le, uint8_t endpoint, uint16_t clusterId, uint8_t *attribute_status_records, uint16_t attribute_status_records_size)
Definition: zigpc_gateway_notify.c:322
void zigpc_gateway_hdl_on_device_endpoints_discovered(const sl_802154_long_addr_t eui64_le, uint8_t endpointCount, const uint8_t *endpointList)
Notify handler for device discovery containing endpoint count.
Definition: zigpc_gateway_notify.c:192
void zigpc_gateway_hdl_on_ota_update_started(const sl_802154_long_addr_t eui64, uint16_t manufacturerId, uint16_t imageTypeId, uint32_t firmwareVersion)
Definition: zigpc_gateway_notify.c:524
void zigpc_gateway_hdl_on_network_initialized(const sl_zigbee_network_parameters_t *network)
ZigbeeHost handler for network initialization.
Definition: zigpc_gateway_notify.c:84
void zigpc_gateway_hdl_on_node_removed(const sl_802154_long_addr_t eui64_le)
Notify handler for device removal complete callback.
Definition: zigpc_gateway_notify.c:166