Tunneling Server#

Callbacks for Tunneling Server Component.

Callbacks#

bool
sl_zigbee_af_tunneling_server_is_protocol_supported_cb(uint8_t protocolId, uint16_t manufacturerCode)

Notify whether a protocol is supported.

void
sl_zigbee_af_tunneling_server_tunnel_opened_cb(uint16_t tunnelIndex, uint8_t protocolId, uint16_t manufacturerCode, bool flowControlSupport, uint16_t maximumIncomingTransferSize)

Tunnel opened.

void
sl_zigbee_af_tunneling_server_data_received_cb(uint16_t tunnelIndex, uint8_t *data, uint16_t dataLen)

Data received.

void
sl_zigbee_af_tunneling_server_data_error_cb(uint16_t tunnelIndex, sl_zigbee_af_tunneling_transfer_data_status_t transferDataStatus)

Data error.

void
sl_zigbee_af_tunneling_server_tunnel_closed_cb(uint16_t tunnelIndex, bool clientInitiated)

Tunnel closed.

Callbacks Documentation#

sl_zigbee_af_tunneling_server_is_protocol_supported_cb#

bool sl_zigbee_af_tunneling_server_is_protocol_supported_cb (uint8_t protocolId, uint16_t manufacturerCode)

Notify whether a protocol is supported.

Parameters
TypeDirectionArgument NameDescription
uint8_tN/AprotocolId

The identifier of the metering communication protocol for which the tunnel is requested. Ver.: always

uint16_tN/AmanufacturerCode

The manufacturer code for manufacturer-defined protocols or 0xFFFF in unused. Ver.: always

This function is called by the Tunneling server plugin whenever a Request Tunnel command is received. The application should return true if the protocol is supported and false otherwise.


sl_zigbee_af_tunneling_server_tunnel_opened_cb#

void sl_zigbee_af_tunneling_server_tunnel_opened_cb (uint16_t tunnelIndex, uint8_t protocolId, uint16_t manufacturerCode, bool flowControlSupport, uint16_t maximumIncomingTransferSize)

Tunnel opened.

Parameters
TypeDirectionArgument NameDescription
uint16_tN/AtunnelIndex

The index to the tunnel table entry that has been opened. Ver.: always

uint8_tN/AprotocolId

The identifier of the metering communication protocol for the tunnel. Ver.: always

uint16_tN/AmanufacturerCode

The manufacturer code for manufacturer-defined protocols or 0xFFFF in unused. Ver.: always

boolN/AflowControlSupport

true is flow control support is requested or false if it is not. Ver.: always

uint16_tN/AmaximumIncomingTransferSize

The maximum incoming transfer size of the client. Ver.: always

This function is called by the Tunneling server plugin whenever a tunnel is opened. Clients may open tunnels by sending a Request Tunnel command.


sl_zigbee_af_tunneling_server_data_received_cb#

void sl_zigbee_af_tunneling_server_data_received_cb (uint16_t tunnelIndex, uint8_t * data, uint16_t dataLen)

Data received.

Parameters
TypeDirectionArgument NameDescription
uint16_tN/AtunnelIndex

The identifier of the tunnel through which the data was received. Ver.: always

uint8_t *N/Adata

Buffer containing the raw octets of the data. Ver.: always

uint16_tN/AdataLen

The length in octets of the data. Ver.: always

This function is called by the Tunneling server plugin whenever data is received from a client through a tunnel.


sl_zigbee_af_tunneling_server_data_error_cb#

void sl_zigbee_af_tunneling_server_data_error_cb (uint16_t tunnelIndex, sl_zigbee_af_tunneling_transfer_data_status_t transferDataStatus)

Data error.

Parameters
TypeDirectionArgument NameDescription
uint16_tN/AtunnelIndex

The identifier of the tunnel on which this data error occurred. Ver.: always

sl_zigbee_af_tunneling_transfer_data_status_tN/AtransferDataStatus

The error that occurred. Ver.: always

This function is called by the Tunneling server plugin whenever a data error occurs on a tunnel. Errors occur if a device attempts to send data on tunnel that is no longer active or if the tunneling does not belong to the device.


sl_zigbee_af_tunneling_server_tunnel_closed_cb#

void sl_zigbee_af_tunneling_server_tunnel_closed_cb (uint16_t tunnelIndex, bool clientInitiated)

Tunnel closed.

Parameters
TypeDirectionArgument NameDescription
uint16_tN/AtunnelIndex

The identifier of the tunnel that has been closed. Ver.: always

boolN/AclientInitiated

true if the client initiated the closing of the tunnel or false if the server closed the tunnel due to inactivity. Ver.: always

This function is called by the Tunneling server plugin whenever a tunnel is closed. Clients may close tunnels by sending a Close Tunnel command. The server can preemptively close inactive tunnels after a timeout.