network-diagnostics API Callbacks

Functions

void emberDiagnosticAnswerHandler ( EmberStatus status, const EmberIpv6Address *remoteAddress, const uint8_t *payload, uint16_t payloadLength)
Application callback for emberSendDiagnosticQuery() and emberSendDiagnosticGet() .
bool emberBatteryLevelHandler (uint8_t *batteryLevel)
Application callback for the stack to obtain the battery level to use in a response to a network diagnostic request. From the Thread spec: "The battery level is an 8-bit unsigned integer that indicates remaining battery energy in the Thread device as an integer percentage value 0-100 (0x00-0x64).".
void emberSetVendorTlvsReturn ( EmberStatus status, uint16_t length)
Application callback for emberSetVendorTlvs() .
void emberManagementGetResponseHandler ( EmberCoapStatus status, EmberCoapCode code, EmberCoapReadOptions *options, uint8_t *payload, uint16_t payloadLength, EmberCoapResponseInfo *info)
The response to a management get request previous sent via emberSendManagementGetRequest() .

Detailed Description

These callbacks were contributed by the network-diagnostics API.

Function Documentation

bool emberBatteryLevelHandler ( uint8_t * batteryLevel )
Parameters
batteryLevel The battery level value to return to the stack.

This handler should return false if the battery level is not measured, unknown, or the device does not operate on battery power. If a valid battery level is being supplied, it must return true.

The application must define EMBER_APPLICATION_HAS_BATTERY_LEVEL_HANDLER in its CONFIGURATION_HEADER to use this.

This is an SOC-only API.

void emberDiagnosticAnswerHandler ( EmberStatus status,
const EmberIpv6Address * remoteAddress,
const uint8_t * payload,
uint16_t payloadLength
)
Parameters
status Status of the query result.
remoteAddress The remote address that sent the answer.
payload The returned payload.
payloadLength The returned payload length.
void emberManagementGetResponseHandler ( EmberCoapStatus status,
EmberCoapCode code,
EmberCoapReadOptions * options,
uint8_t * payload,
uint16_t payloadLength,
EmberCoapResponseInfo * info
)
void emberSetVendorTlvsReturn ( EmberStatus status,
uint16_t length
)
Parameters
status EMBER_SUCCESS if the supplied TLVs were valid and successfully installed, EMBER_BAD_ARGUMENT otherwise. See emberSetVendorTlvs for validity requirements.
length The number of bytes in the supplied network data.