Functions

EmberStatus emberAfPluginXncpIncomingCustomFrameCallback (uint8_t messageLength, uint8_t *messagePayload, uint8_t *replyPayloadLength, uint8_t *replyPayload)
Called when the NCP receives a custom EZSP message from the HOST.
bool emberAfIncomingMessageCallback ( EmberIncomingMessageType type, EmberApsFrame *apsFrame, EmberMessageBuffer message)
Called when the NCP receives an incoming Zigbee PRO message.
bool emberAfPluginCommandHandlerPermitNcpToHostFrameCallback (uint8_t frameId, uint8_t payloadLength, uint8_t *payload)
Called when the NCP wants to inform the HOST of a callback that has been called on the NCP.
bool emberAfPluginCommandHandlerPermitHostToNcpFrameCallback (uint8_t frameId, uint8_t payloadLength, uint8_t *payload)
Enables or disables the processing of EZSP commands on the NCP.
void emberAfPluginXncpGetXncpInformation (uint16_t *manufacturerId, uint16_t *versionNumber)
Gets XNCP information.

Detailed Description

These callbacks are contributed by the XNCP Library plugin.

Function Documentation

bool emberAfIncomingMessageCallback ( EmberIncomingMessageType type,
EmberApsFrame * apsFrame,
EmberMessageBuffer message
)

Called when the NCP receives an incoming Zigbee PRO message.

This handling is done before any other action is taken by the NCP on the callback. If the function returns true, the incoming message is done being handled, and the NCP does not need to record the callback or report it to the HOST.

Parameters
type The EmberIncomingMessageType of the incoming message. Ver.: always
apsFrame The EmberApsFrame recieved in the incoming message. Ver.: always
message The payload of the incoming message, in the form of an EmberMessageBuffer . Ver.: always
Returns
A ::bool value. If this value is true, the NCP will not handle the incoming message any further and it will not report the incoming message to the HOST. If the returned value is false, the NCP will continue to process the incoming message and the callback will also be passed to the HOST.
bool emberAfPluginCommandHandlerPermitHostToNcpFrameCallback ( uint8_t frameId,
uint8_t payloadLength,
uint8_t * payload
)

Enables or disables the processing of EZSP commands on the NCP.

The application can use this callback to enable or disable the processing of EZSP commands on the NCP. If this function returns true, the frame will be handled by the NCP in a normal manner. If this function returns false, the NCP will disregard this command and respond to the HOST that it is an invalid frame.

Parameters
frameId The EZSP frame ID of the message. Ver.: always
payloadLength The length of the payload of the EZSP message. Ver.: always
payload The EZSP message payload. Ver.: always
Returns
A ::bool value indicating whether or not the frame will continue to be handled. If this function returns true, the frame will be handled by the NCP in a normal manner. If this function returns false, then the NCP will disregard this command and respond to the HOST that it is an invalid frame.
bool emberAfPluginCommandHandlerPermitNcpToHostFrameCallback ( uint8_t frameId,
uint8_t payloadLength,
uint8_t * payload
)

Called when the NCP wants to inform the HOST of a callback that has been called on the NCP.

If this function returns false, the NCP will not notify the HOST of the callback. If the function returns true, then the NCP will continue scheduling the notification of the HOST regarding the callback.

Parameters
frameId The frameId of the callback. Ver.: always
payloadLength The length of the payload carried in the callback. Ver.: always
payload The actual payload carried by the callback. Ver.: always
Returns
A ::bool value. If the value is false, then the NCP will not notify the HOST of the callback. If the return value is true, the NCP will continue scheduling the notification of the HOST regarding the callback.
void emberAfPluginXncpGetXncpInformation ( uint16_t * manufacturerId,
uint16_t * versionNumber
)

Gets XNCP information.

This callback enables users to communicate the version number and manufacturer ID of their NCP application to the framework. This information is needed for the EZSP command frame called getXncpInfo. This callback will be called when that frame is received so that the application can report its version number and manufacturer ID to be sent back to the HOST.

Parameters
versionNumber The version number of the NCP application.
manufacturerId The manufacturer ID of the NCP application.
EmberStatus emberAfPluginXncpIncomingCustomFrameCallback ( uint8_t messageLength,
uint8_t * messagePayload,
uint8_t * replyPayloadLength,
uint8_t * replyPayload
)

Called when the NCP receives a custom EZSP message from the HOST.

The message length and payload is passed to the callback in the first two arguments. The implementation can then fill in the replyPayload and set the replayPayloadLength to the number of bytes in the replyPayload. See documentation for the function ezspCustomFrame on sending these messages from the HOST.

Parameters
messageLength The length of the messagePayload.
messagePayload The custom message that was sent from the HOST. Ver.: always
replyPayloadLength The length of the replyPayload. This needs to be set by the implementation for a properly formed response to be sent back to the HOST. Ver.: always
replyPayload The custom message to send back to the HOST in respose to the custom message. Ver.: always
Returns
An EmberStatus indicating the result of the custom message handling. This returned status is always the first byte of the EZSP response.

References EMBER_LIBRARY_NOT_PRESENT .