Events Server#

API and Callbacks for the Events Server Cluster Component.

Modules#

sl_zigbee_af_zcl_event_t

Events Server

API#

bool
sl_zigbee_af_events_server_clear_event_log(uint8_t endpoint, sl_zigbee_af_event_log_id_t logId)

Clear all events in the specified event log.

void
sl_zigbee_af_events_server_print_event_log(uint8_t endpoint, sl_zigbee_af_event_log_id_t logId)

Print all events in the specified event log.

void
sl_zigbee_af_events_server_print_event(const sl_zigbee_af_zcl_event_t *event)

Print an event.

bool
sl_zigbee_af_events_server_get_event(uint8_t endpoint, sl_zigbee_af_event_log_id_t logId, uint8_t index, sl_zigbee_af_zcl_event_t *event)

Get an event from the specified event log.

bool
sl_zigbee_af_events_server_set_event(uint8_t endpoint, sl_zigbee_af_event_log_id_t logId, uint8_t index, const sl_zigbee_af_zcl_event_t *event)

Store an event in the specified event log.

uint8_t
sl_zigbee_af_events_server_add_event(uint8_t endpoint, sl_zigbee_af_event_log_id_t logId, const sl_zigbee_af_zcl_event_t *event)

Add an event to the specified event log.

void
sl_zigbee_af_events_server_publish_event_message(sl_802154_short_addr_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, sl_zigbee_af_event_log_id_t logId, uint8_t index, uint8_t eventControl)

Publish an event.

Macros#

API Documentation#

sl_zigbee_af_events_server_clear_event_log#

bool sl_zigbee_af_events_server_clear_event_log (uint8_t endpoint, sl_zigbee_af_event_log_id_t logId)

Clear all events in the specified event log.

Parameters
N/Aendpoint

The endpoint for which the event log will be cleared.

N/AlogId

The log to be cleared.

Returns

  • True if the log was successfully cleared or false if logId is invalid.


Definition at line 75 of file app/framework/plugin/events-server/events-server.h

sl_zigbee_af_events_server_print_event_log#

void sl_zigbee_af_events_server_print_event_log (uint8_t endpoint, sl_zigbee_af_event_log_id_t logId)

Print all events in the specified event log.

Parameters
N/Aendpoint

The endpoint for which the event log will be printed.

N/AlogId

The log to be printed.


Definition at line 84 of file app/framework/plugin/events-server/events-server.h

sl_zigbee_af_events_server_print_event#

void sl_zigbee_af_events_server_print_event (const sl_zigbee_af_zcl_event_t * event)

Print an event.

Parameters
N/Aevent

The event to print.


Definition at line 92 of file app/framework/plugin/events-server/events-server.h

sl_zigbee_af_events_server_get_event#

bool sl_zigbee_af_events_server_get_event (uint8_t endpoint, sl_zigbee_af_event_log_id_t logId, uint8_t index, sl_zigbee_af_zcl_event_t * event)

Get an event from the specified event log.

Parameters
N/Aendpoint

The relevant endpoint.

N/AlogId

The relevant log.

N/Aindex

The index in the event log.

N/Aevent

The sl_zigbee_af_zcl_event_t structure describing the event.

This function can be used to get an event at a specific location in the specified log.

Returns

  • True if the event was found or false if the index is invalid.


Definition at line 106 of file app/framework/plugin/events-server/events-server.h

sl_zigbee_af_events_server_set_event#

bool sl_zigbee_af_events_server_set_event (uint8_t endpoint, sl_zigbee_af_event_log_id_t logId, uint8_t index, const sl_zigbee_af_zcl_event_t * event)

Store an event in the specified event log.

Parameters
N/Aendpoint

The relevant endpoint.

N/AlogId

The relevant log.

N/Aindex

The index in the event log.

N/Aevent

The sl_zigbee_af_zcl_event_t structure describing the event. If NULL, the event is removed from the server.

This function is used to set an event at a specific location in the specified log.

Returns

  • True if the event was set or removed or false if the index is invalid.


Definition at line 124 of file app/framework/plugin/events-server/events-server.h

sl_zigbee_af_events_server_add_event#

uint8_t sl_zigbee_af_events_server_add_event (uint8_t endpoint, sl_zigbee_af_event_log_id_t logId, const sl_zigbee_af_zcl_event_t * event)

Add an event to the specified event log.

Parameters
N/Aendpoint

The relevant endpoint.

N/AlogId

The relevant log.

N/Aevent

The sl_zigbee_af_zcl_event_t structure describing the event.

This function is used to add an event at the next available location in the specified log. After the event log is full, new events will start overwriting old events at the beginning of the table.

Returns

  • the index of the location in the log where the event was added or ZCL_EVENTS_INVALID_INDEX if the specified event log is full.


Definition at line 142 of file app/framework/plugin/events-server/events-server.h

sl_zigbee_af_events_server_publish_event_message#

void sl_zigbee_af_events_server_publish_event_message (sl_802154_short_addr_t nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, sl_zigbee_af_event_log_id_t logId, uint8_t index, uint8_t eventControl)

Publish an event.

Parameters
N/AnodeId

The destination nodeId.

N/AsrcEndpoint

The source endpoint.

N/AdstEndpoint

The destination endpoint.

N/AlogId

The relevant log.

N/Aindex

The index in the event log.

N/AeventControl

Actions to be taken regarding this event. For example, Report event to HAN and/or Report event to WAN.

This function will locate the event in the specified log at the specified location and using the information from the event build and send a PublishEvent command.


Definition at line 161 of file app/framework/plugin/events-server/events-server.h

Macro Definition Documentation#

ZCL_EVENTS_INVALID_INDEX#

#define ZCL_EVENTS_INVALID_INDEX
Value:
0xFF

Definition at line 45 of file app/framework/plugin/events-server/events-server.h