Compact Logger#

API and Callbacks for the Compact Logger Component.

This component manages a compact logger that stores log entries encoded with a 2-byte enumeration. Another component must provide the encoding/decoding of the enumerations. This component stores log messages with the following: UTC Time, Time Synchronization, Log Message ID, and variable log message data. It stores the data in a ring-buffer stored in RAM. When space is needed, the oldest log message entries are deleted.

Modules#

sl_zigbee_af_plugin_compact_logger_message_info_t

Compact Logger

API#

void

Initialize compact logger.

sl_zigbee_af_compact_logger_add(uint16_t logMessageId, uint16_t logDataLength, uint8_t *logData)

Add compact log.

uint16_t

Initialize compact logger iterator.

sl_zigbee_af_compact_logger_get_log_message_info_by_iterator(sl_zigbee_af_plugin_compact_logger_message_info_t *info)

Get log message info by using the iterator.

sl_zigbee_af_compact_logger_get_log_message_data_by_iterator(uint16_t indexIntoEntry, uint16_t maxMessageSize, uint16_t *returnDataSize, uint8_t *returnData)

Get log message data by using the iterator.

Compact logger iterator next entry.

Update all logs with UTC time.

sl_zigbee_af_compact_logger_get_entry_by_number(uint32_t entryNumber, sl_zigbee_af_plugin_compact_logger_message_info_t *info)

Get entry by number.

bool
sl_zigbee_af_compact_logger_check_facility_and_severity(sl_zigbee_compact_logger_severity_t severity, uint16_t facility)

Check facility and severity.

void

Set facility.

sl_zigbee_af_compact_logger_set_severity(sl_zigbee_compact_logger_severity_t severity)

Set severity.

Enumerations#

enum
SL_ZIGBEE_AF_PLUGIN_COMPACT_LOGGER_SEVERITY_CRITICAL
SL_ZIGBEE_AF_PLUGIN_COMPACT_LOGGER_SEVERITY_NOTICE
SL_ZIGBEE_AF_PLUGIN_COMPACT_LOGGER_SEVERITY_DEBUG
}

API Documentation#

sl_zigbee_af_compact_logger_init#

void sl_zigbee_af_compact_logger_init (void )

Initialize compact logger.

Parameters
N/A

Definition at line 73 of file app/framework/plugin/compact-logger/compact-logger.h

sl_zigbee_af_compact_logger_add#

sl_status_t sl_zigbee_af_compact_logger_add (uint16_t logMessageId, uint16_t logDataLength, uint8_t * logData)

Add compact log.

Parameters
N/AlogMessageId

message id Ver.: always

N/AlogDataLength

data length Ver.: always

N/AlogData

data Ver.: always

Returns

  • sl_status_t status


Definition at line 83 of file app/framework/plugin/compact-logger/compact-logger.h

sl_zigbee_af_compact_logger_get_log_count#

uint16_t sl_zigbee_af_compact_logger_get_log_count (void )

Get log count.

Parameters
N/A

Returns

  • uint16_t Log count


Definition at line 91 of file app/framework/plugin/compact-logger/compact-logger.h

sl_zigbee_af_compact_logger_init_iterator#

sl_status_t sl_zigbee_af_compact_logger_init_iterator (void )

Initialize compact logger iterator.

Parameters
N/A

Returns

  • sl_status_t status


Definition at line 98 of file app/framework/plugin/compact-logger/compact-logger.h

sl_zigbee_af_compact_logger_get_log_message_info_by_iterator#

sl_status_t sl_zigbee_af_compact_logger_get_log_message_info_by_iterator (sl_zigbee_af_plugin_compact_logger_message_info_t * info)

Get log message info by using the iterator.

Parameters
N/Ainfo

pointer to struct to store log info

Returns

  • sl_status_t status code


Definition at line 107 of file app/framework/plugin/compact-logger/compact-logger.h

sl_zigbee_af_compact_logger_get_log_message_data_by_iterator#

sl_status_t sl_zigbee_af_compact_logger_get_log_message_data_by_iterator (uint16_t indexIntoEntry, uint16_t maxMessageSize, uint16_t * returnDataSize, uint8_t * returnData)

Get log message data by using the iterator.

Parameters
N/AindexIntoEntry

Ver.: always

N/AmaxMessageSize

Ver.: always

N/AreturnDataSize

Ver.: always

N/AreturnData

Ver.: always

Returns

  • sl_status_t status code


Definition at line 118 of file app/framework/plugin/compact-logger/compact-logger.h

sl_zigbee_af_compact_logger_iterator_next_entry#

sl_status_t sl_zigbee_af_compact_logger_iterator_next_entry (void )

Compact logger iterator next entry.

Parameters
N/A

Returns

  • sl_status_t status code


Definition at line 128 of file app/framework/plugin/compact-logger/compact-logger.h

sl_zigbee_af_compact_logger_update_all_logs_with_utc_time#

sl_status_t sl_zigbee_af_compact_logger_update_all_logs_with_utc_time (uint32_t currentUtcTimeSeconds)

Update all logs with UTC time.

Parameters
N/AcurrentUtcTimeSeconds

UTC time in seconds Ver.: always

Returns

  • sl_status_t status code


Definition at line 137 of file app/framework/plugin/compact-logger/compact-logger.h

sl_zigbee_af_compact_logger_print_all_messages#

void sl_zigbee_af_compact_logger_print_all_messages (void )

Print all messages.

Parameters
N/A

Definition at line 142 of file app/framework/plugin/compact-logger/compact-logger.h

sl_zigbee_af_compact_logger_get_entry_by_number#

sl_status_t sl_zigbee_af_compact_logger_get_entry_by_number (uint32_t entryNumber, sl_zigbee_af_plugin_compact_logger_message_info_t * info)

Get entry by number.

Parameters
N/AentryNumber
N/Ainfo

pointer to struct where info will be stored Ver.: always

Returns

  • sl_status_t status code


Definition at line 151 of file app/framework/plugin/compact-logger/compact-logger.h

sl_zigbee_af_compact_logger_check_facility_and_severity#

bool sl_zigbee_af_compact_logger_check_facility_and_severity (sl_zigbee_compact_logger_severity_t severity, uint16_t facility)

Check facility and severity.

Parameters
N/Aseverity

Ver.: always

N/Afacility

Ver.: always

Returns

  • bool


Definition at line 162 of file app/framework/plugin/compact-logger/compact-logger.h

sl_zigbee_af_compact_logger_set_facility#

void sl_zigbee_af_compact_logger_set_facility (uint16_t facility)

Set facility.

Parameters
N/Afacility

Ver.: always


Definition at line 170 of file app/framework/plugin/compact-logger/compact-logger.h

sl_zigbee_af_compact_logger_set_severity#

sl_status_t sl_zigbee_af_compact_logger_set_severity (sl_zigbee_compact_logger_severity_t severity)

Set severity.

Parameters
N/Aseverity

Ver.: always

Returns

  • sl_status_t status code


Definition at line 178 of file app/framework/plugin/compact-logger/compact-logger.h

Enumeration Documentation#

sl_zigbee_compact_logger_severity_t#

sl_zigbee_compact_logger_severity_t
Enumerator
SL_ZIGBEE_AF_PLUGIN_COMPACT_LOGGER_SEVERITY_CRITICAL
SL_ZIGBEE_AF_PLUGIN_COMPACT_LOGGER_SEVERITY_NOTICE
SL_ZIGBEE_AF_PLUGIN_COMPACT_LOGGER_SEVERITY_DEBUG

Definition at line 55 of file app/framework/plugin/compact-logger/compact-logger.h

Typedef Documentation#

sl_zigbee_af_plugin_compact_logger_message_bitmask_t#

typedef uint8_t sl_zigbee_af_plugin_compact_logger_message_bitmask_t

Definition at line 42 of file app/framework/plugin/compact-logger/compact-logger.h

Macro Definition Documentation#

SL_ZIGBEE_AF_PLUGIN_COMPACT_LOGGER_FACILITY_ALL#

#define SL_ZIGBEE_AF_PLUGIN_COMPACT_LOGGER_FACILITY_ALL
Value:
0xFFFF

Definition at line 61 of file app/framework/plugin/compact-logger/compact-logger.h

SL_ZIGBEE_AF_PLUGIN_COMPACT_LOGGER_BITMASK_UTC_TIME_SYNC#

#define SL_ZIGBEE_AF_PLUGIN_COMPACT_LOGGER_BITMASK_UTC_TIME_SYNC
Value:
0x01

Definition at line 62 of file app/framework/plugin/compact-logger/compact-logger.h

SL_ZIGBEE_AF_PLUGIN_COMPACT_LOGGER_BITMASK_MS_PRECISION#

#define SL_ZIGBEE_AF_PLUGIN_COMPACT_LOGGER_BITMASK_MS_PRECISION
Value:
0x02

Definition at line 63 of file app/framework/plugin/compact-logger/compact-logger.h