The connect stack internally accounts several types of events, like number of transmitted / received packets, number of successful / unsuccessful ACKs, transmission retries, etc.
These counters can be advantageous for application debugging / profiling, hence Connect makes them accessible by the applications.
To get access to the counters the Stack Packet Counters plugin must be enabled in AppBuilder (Plugins tab, Connect Debug section):
Stack counters enabled by default.
To retrieve the counter values use the
emberGetCounter() API function:
EmberStatus status = emberGetCounter(counterType, &counter);
counterType the stack counter type is passed, which is an
EmberCounterType enum and declared in
ember-types.h where the meaning of the counter types are explained.
The counter value returns in
counter as a
The API function return value can indicate success or indicating fail as the type is invalid (no such counter) or library not present (can happen if Stack Packet Counters Stub).
The provided Connect example projects contains query of counters from CLI using the
Library not present is the result of enabling Stack Packet Counters Stub instead of Stack Packet Counters which makes sense to reduce the stack footprint).
EMBER_ASH_V3* are related to NCP, these values are always remain zero for SoC applications.