Modules#

EmberAfEvent

Events Server

Events Server#

API and Callbacks for the Events Server Cluster Component.

API#

bool
emberAfEventsServerClearEventLog(uint8_t endpoint, EmberAfEventLogId logId)

Clear all events in the specified event log.

void
emberAfEventsServerPrintEventLog(uint8_t endpoint, EmberAfEventLogId logId)

Print all events in the specified event log.

void
emberAfEventsServerPrintEvent(const EmberAfEvent *event)

Print an event.

bool
emberAfEventsServerGetEvent(uint8_t endpoint, EmberAfEventLogId logId, uint8_t index, EmberAfEvent *event)

Get an event from the specified event log.

bool
emberAfEventsServerSetEvent(uint8_t endpoint, EmberAfEventLogId logId, uint8_t index, const EmberAfEvent *event)

Store an event in the specified event log.

uint8_t
emberAfEventsServerAddEvent(uint8_t endpoint, EmberAfEventLogId logId, const EmberAfEvent *event)

Add an event to the specified event log.

void
emberAfEventsServerPublishEventMessage(EmberNodeId nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, EmberAfEventLogId logId, uint8_t index, uint8_t eventControl)

Publish an event.

Macros#

#define
ZCL_EVENTS_INVALID_INDEX 0xFF

API Documentation#

emberAfEventsServerClearEventLog#

bool emberAfEventsServerClearEventLog (uint8_t endpoint, EmberAfEventLogId logId)

Clear all events in the specified event log.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint for which the event log will be cleared.

EmberAfEventLogIdN/AlogId

The log to be cleared.

Returns

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


emberAfEventsServerPrintEventLog#

void emberAfEventsServerPrintEventLog (uint8_t endpoint, EmberAfEventLogId logId)

Print all events in the specified event log.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The endpoint for which the event log will be printed.

EmberAfEventLogIdN/AlogId

The log to be printed.


emberAfEventsServerPrintEvent#

void emberAfEventsServerPrintEvent (const EmberAfEvent * event)

Print an event.

Parameters
TypeDirectionArgument NameDescription
const EmberAfEvent *N/Aevent

The event to print.


emberAfEventsServerGetEvent#

bool emberAfEventsServerGetEvent (uint8_t endpoint, EmberAfEventLogId logId, uint8_t index, EmberAfEvent * event)

Get an event from the specified event log.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

EmberAfEventLogIdN/AlogId

The relevant log.

uint8_tN/Aindex

The index in the event log.

EmberAfEvent *N/Aevent

The EmberAfEvent 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.


emberAfEventsServerSetEvent#

bool emberAfEventsServerSetEvent (uint8_t endpoint, EmberAfEventLogId logId, uint8_t index, const EmberAfEvent * event)

Store an event in the specified event log.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

EmberAfEventLogIdN/AlogId

The relevant log.

uint8_tN/Aindex

The index in the event log.

const EmberAfEvent *N/Aevent

The EmberAfEvent 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.


emberAfEventsServerAddEvent#

uint8_t emberAfEventsServerAddEvent (uint8_t endpoint, EmberAfEventLogId logId, const EmberAfEvent * event)

Add an event to the specified event log.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/Aendpoint

The relevant endpoint.

EmberAfEventLogIdN/AlogId

The relevant log.

const EmberAfEvent *N/Aevent

The EmberAfEvent 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.


emberAfEventsServerPublishEventMessage#

void emberAfEventsServerPublishEventMessage (EmberNodeId nodeId, uint8_t srcEndpoint, uint8_t dstEndpoint, EmberAfEventLogId logId, uint8_t index, uint8_t eventControl)

Publish an event.

Parameters
TypeDirectionArgument NameDescription
EmberNodeIdN/AnodeId

The destination nodeId.

uint8_tN/AsrcEndpoint

The source endpoint.

uint8_tN/AdstEndpoint

The destination endpoint.

EmberAfEventLogIdN/AlogId

The relevant log.

uint8_tN/Aindex

The index in the event log.

uint8_tN/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.