Counters#

API and Callbacks for the Counters Component.

This component provides support for reading and manipulating counters that record different events in the stack.

API#

EmberStatus
emberAfPluginCountersSendRequest(EmberNodeId destination, bool clearCounters)
bool
emberAfPluginCountersIsIncomingRequest(EmberApsFrame *apsFrame, EmberNodeId sender)
bool
bool
emberAfPluginCountersIsOutgoingResponse(EmberApsFrame *apsFrame, EmberStatus status)

Macros#

API Documentation#

emberAfPluginCountersSendRequest#

EmberStatus emberAfPluginCountersSendRequest (EmberNodeId destination, bool clearCounters)
Parameters
N/Adestination

the address of the node to send the request to.

N/AclearCounters

whether or not the destination should reset its counters to zero after successfully reporting them back to the requester. Because of technical constraints, counters are always cleared on a network coprocessor, such as the EM260.

Send an request to the specified destination to send back a report of the non-zero counters.

Returns

  • EMBER_SUCCESS if the request was successfully submitted for sending. See ::emberSendUnicast() or ::ezspSendUnicast for possible failure statuses.


Definition at line 88 of file app/framework/plugin/counters/counters-ota.h

emberAfPluginCountersIsIncomingRequest#

bool emberAfPluginCountersIsIncomingRequest (EmberApsFrame *apsFrame, EmberNodeId sender)
Parameters
N/AapsFrame

the APS frame passed to the incoming message handler.

N/Asender

the node ID of the sender of the request.

Call this function at the beginning of the incoming message handler. It returns true if the incoming message was a counter's request and should be ignored by the rest of the incoming message handler.

Returns

  • true if the message was a counters request and should be ignored by the rest of the incoming message handler.


Definition at line 101 of file app/framework/plugin/counters/counters-ota.h

emberAfPluginCountersIsIncomingResponse#

bool emberAfPluginCountersIsIncomingResponse (EmberApsFrame *apsFrame)
Parameters
N/AapsFrame

the APS frame passed to the incoming message handler.

Call this function within the incoming message handler to determine if the message is a counter's response. If so, it is up to the application to decode the payload whose format is described above.

Returns

  • true if the message is a counters response.


Definition at line 112 of file app/framework/plugin/counters/counters-ota.h

emberAfPluginCountersIsOutgoingResponse#

bool emberAfPluginCountersIsOutgoingResponse (EmberApsFrame *apsFrame, EmberStatus status)
Parameters
N/AapsFrame

the APS frame passed to the message sent handler.

N/Astatus

the status passed to the message sent handler.

N/Areturn

true if the message was a counters response and should be ignored by the rest of the message sent handler.

Call this function at the beginning of the message sent handler. It returns true if the message was a counters response and should be ignored by the rest of the handler.


Definition at line 123 of file app/framework/plugin/counters/counters-ota.h

Macro Definition Documentation#

MAX_PAYLOAD_LENGTH#

#define MAX_PAYLOAD_LENGTH
Value:
48

To ensure the counters response does not exceed the maximum payload length, they are divided into separate messages if necessary. The maximum length of 48 leaves sufficient room for headers, all security modes, and source routing subframes if present. It should not be necessary to change this value, but if you do, make sure you understand the process.


Definition at line 69 of file app/framework/plugin/counters/counters-ota.h