Developing with ZBOSS for Zigbee
Tunneling cluster commands

Data Structures

struct  zb_zcl_tunneling_request_tunnel_s
 RequestTunnel command payload More...
 
struct  zb_zcl_tunneling_close_tunnel_s
 CloseTunnel command payload More...
 
struct  zb_zcl_tunneling_transfer_data_hdr_s
 TransferData commands header data. More...
 
struct  zb_zcl_tunneling_srv_rec_s
 
struct  zb_zcl_tunnel_request_params_out_s
 
struct  zb_zcl_tunneling_transfer_data_payload_s
 TransferData payload. This structure presents custom implementation of Transfer Data command payload defined in SE spec. More...
 
struct  zb_zcl_tunneling_transfer_data_error_s
 TransferDataError command payload More...
 
struct  zb_zcl_tunneling_request_tunnel_response_s
 RequestTunnelResponse command payload More...
 
struct  zb_zcl_tunneling_ack_transfer_data_s
 
struct  zb_zcl_tunneling_ready_data_s
 
struct  zb_zcl_tunneling_get_supported_tunnel_protocols_s
 
struct  zb_zcl_tunneling_protocol_field_s
 
struct  zb_zcl_tunneling_supported_tunnel_protocols_response_s
 
struct  zb_zcl_tunneling_tunnel_closure_notification_s
 

Macros

#define ZB_ZCL_TUNNELING_SEND_REQUEST_TUNNEL( _param, _addr, _dst_addr_mode, _dst_ep, _ep, _prfl_id, _def_resp, _cb, _protocol_id, _manufacturer_code, _flow_control_support, _max_incoming_transfer_size)
 Send RequestTunnel command. More...
 
#define ZB_ZCL_TUNNELING_GET_REQUEST_TUNNEL(_data_ptr, _buffer, _status)
 Macro for parsing payload of RequestTunnel command. More...
 
#define ZB_ZCL_TUNNELING_SEND_CLOSE_TUNNEL( _param, _addr, _dst_addr_mode, _dst_ep, _ep, _prfl_id, _def_resp, _cb, _tunnel_id)
 CloseTunnel command More...
 
#define ZB_ZCL_TUNNELING_GET_CLOSE_TUNNEL(_data_ptr, _buffer, _status)
 Macro for parsing payload of CloseTunnel command. More...
 
#define ZB_ZCL_TUNNELING_SERVER_SEND_TRANSFER_DATA( _param, _ep, _prfl_id, _def_resp, _cb, _tunnel_id, _data_size, _image_data)
 
#define ZB_ZCL_TUNNELING_CLIENT_SEND_TRANSFER_DATA( _param, _ep, _prfl_id, _def_resp, _cb, _tunnel_id, _data_size, _image_data)
 
#define ZB_ZCL_TUNNELING_GET_TRANSFER_DATA(_data_ptr, _buffer, _status)
 Macro for parsing payload of TransferData command. More...
 
#define ZB_ZCL_TUNNELING_SEND_TRANSFER_DATA_ERROR( _buffer, _addr, _dst_addr_mode, _dst_ep, _ep, _prfl_id, _def_resp, _cb, _seq_num, _tunnel_id, _transfer_data_status, _command_id, _direction)
 Send client TransferDataError command and server TransferDataError command. More...
 
#define ZB_ZCL_TUNNELING_GET_TRANSFER_DATA_ERROR(_data_ptr, _buffer, _status)
 Macro for parsing payload of TransferDataError command. More...
 
#define ZB_ZCL_TUNNELING_SEND_REQUEST_TUNNEL_RESPONSE( _param, _addr, _dst_addr_mode, _dst_ep, _ep, _prfl_id, _def_resp, _seq_num, _cb, _tunnel_id, _tunnel_status, _max_incoming_transfer_size)
 Macro for sending RequestTunnelResponse command. More...
 
#define ZB_ZCL_TUNNELING_GET_REQUEST_TUNNEL_RESPONSE(_data_ptr, _buffer, _status)
 Macro for parsing payload of RequestTunnelResponse command. More...
 

Typedefs

typedef enum zb_zcl_tunneling_protocol_id_e zb_zcl_tunneling_protocol_id_t
 Tunneling ProtocolID Enumerations. More...
 
typedef struct zb_zcl_tunneling_request_tunnel_s zb_zcl_tunneling_request_tunnel_t
 RequestTunnel command payload More...
 
typedef struct zb_zcl_tunneling_close_tunnel_s zb_zcl_tunneling_close_tunnel_t
 CloseTunnel command payload More...
 
typedef struct zb_zcl_tunneling_transfer_data_hdr_s zb_zcl_tunneling_transfer_data_hdr_t
 TransferData commands header data. More...
 
typedef struct zb_zcl_tunneling_srv_rec_s zb_zcl_tunneling_srv_rec_t
 
typedef struct zb_zcl_tunnel_request_params_out_s zb_zcl_tunnel_request_params_out_t
 
typedef struct zb_zcl_tunneling_transfer_data_payload_s zb_zcl_tunneling_transfer_data_payload_t
 TransferData payload. This structure presents custom implementation of Transfer Data command payload defined in SE spec. More...
 
typedef struct zb_zcl_tunneling_transfer_data_error_s zb_zcl_tunneling_transfer_data_error_t
 TransferDataError command payload More...
 
typedef struct zb_zcl_tunneling_request_tunnel_response_s zb_zcl_tunneling_request_tunnel_response_t
 RequestTunnelResponse command payload More...
 
typedef struct zb_zcl_tunneling_ack_transfer_data_s zb_zcl_tunneling_ack_transfer_data_t
 
typedef struct zb_zcl_tunneling_ready_data_s zb_zcl_tunneling_ready_data_t
 
typedef struct zb_zcl_tunneling_get_supported_tunnel_protocols_s zb_zcl_tunneling_get_supported_tunnel_protocols_t
 
typedef struct zb_zcl_tunneling_protocol_field_s zb_zcl_tunneling_protocol_field_t
 
typedef struct zb_zcl_tunneling_supported_tunnel_protocols_response_s zb_zcl_tunneling_supported_tunnel_protocols_response_t
 
typedef struct zb_zcl_tunneling_tunnel_closure_notification_s zb_zcl_tunneling_tunnel_closure_notification_t
 

Enumerations

enum  zb_zcl_tunneling_cli_cmd_e {
  ZB_ZCL_TUNNELING_CLI_CMD_REQUEST_TUNNEL = 0x00, ZB_ZCL_TUNNELING_CLI_CMD_CLOSE_TUNNEL = 0x01, ZB_ZCL_TUNNELING_CLI_CMD_TRANSFER_DATA = 0x02, ZB_ZCL_TUNNELING_CLI_CMD_TRANSFER_DATA_ERROR = 0x03,
  ZB_ZCL_TUNNELING_CLI_CMD_ACK_TRANSFER_DATA = 0x04, ZB_ZCL_TUNNELING_CLI_CMD_READY_DATA = 0x05, ZB_ZCL_TUNNELING_CLI_CMD_GET_SUPPORTED_TUNNEL_PROTOCOLS = 0x06
}
 Tunnel cluster commands received. More...
 
enum  zb_zcl_tunneling_srv_cmd_e {
  ZB_ZCL_TUNNELING_SRV_CMD_REQUEST_TUNNEL_RESPONSE = 0x00, ZB_ZCL_TUNNELING_SRV_CMD_TRANSFER_DATA = 0x01, ZB_ZCL_TUNNELING_SRV_CMD_TRANSFER_DATA_ERROR = 0x02, ZB_ZCL_TUNNELING_SRV_CMD_ACK_TRANSFER_DATA = 0x03,
  ZB_ZCL_TUNNELING_SRV_CMD_READY_DATA = 0x04, ZB_ZCL_TUNNELING_SRV_CMD_SUPPORTED_TUNNEL_PROTOCOLS_RESPONSE = 0x05, ZB_ZCL_TUNNELING_SRV_CMD_TUNNEL_CLOSURE_NOTIFICATION = 0x06
}
 Tunnel cluster commands generated. More...
 
enum  zb_zcl_tunneling_tunnel_status_e {
  ZB_ZCL_TUNNELING_STATUS_SUCCESS = 0, ZB_ZCL_TUNNELING_STATUS_BUSY = 1, ZB_ZCL_TUNNELING_STATUS_NO_MORE_IDS = 2, ZB_ZCL_TUNNELING_STATUS_PROTOCOL_NOT_SUPPORTED = 3,
  ZB_ZCL_TUNNELING_STATUS_FLOW_CONTROL_NOT_SUPPORTED = 4
}
 TunnelStatus parameter values. More...
 
enum  zb_zcl_tunneling_transfer_data_status_e {
  ZB_ZCL_TUNNELING_TRANSFER_DATA_STATUS_NO_SUCH_TUNNEL = 0x00, ZB_ZCL_TUNNELING_TRANSFER_DATA_STATUS_WRONG_DEVICE = 0x01, ZB_ZCL_TUNNELING_TRANSFER_DATA_STATUS_DATA_OVERFLOW = 0x02, ZB_ZCL_TUNNELING_TRANSFER_DATA_INTERNAL_ERROR = 0xFE,
  ZB_ZCL_TUNNELING_TRANSFER_DATA_STATUS_OK = 0xFF
}
 TransferDataStatus parameter values. More...
 
enum  zb_zcl_tunneling_protocol_id_e {
  ZB_ZCL_TUNNELING_PROTOCOL_DLMS_COSEM = 0, ZB_ZCL_TUNNELING_PROTOCOL_IEC_61107 = 1, ZB_ZCL_TUNNELING_PROTOCOL_ANSI_C12 = 2, ZB_ZCL_TUNNELING_PROTOCOL_M_BUS = 3,
  ZB_ZCL_TUNNELING_PROTOCOL_SML = 4, ZB_ZCL_TUNNELING_PROTOCOL_CLIMATE_TALK = 5, ZB_ZCL_TUNNELING_PROTOCOL_GB_HRGP = 6, ZB_ZCL_TUNNELING_PROTOCOL_IPv4 = 7,
  ZB_ZCL_TUNNELING_PROTOCOL_IPv6 = 8, ZB_ZCL_TUNNELING_PROTOCOL_MANUFACTURER_DEFINED = 200, ZB_ZCL_TUNNELING_PROTOCOL_RESERVED = 255
}
 Tunneling ProtocolID Enumerations. More...
 

Functions

void zb_zcl_tunneling_set_max_incoming_to_cli_transfer_size (zb_uint16_t transfer_size)
 

Detailed Description

Macro Definition Documentation

◆ ZB_ZCL_TUNNELING_CLIENT_SEND_TRANSFER_DATA

#define ZB_ZCL_TUNNELING_CLIENT_SEND_TRANSFER_DATA (   _param,
  _ep,
  _prfl_id,
  _def_resp,
  _cb,
  _tunnel_id,
  _data_size,
  _image_data 
)
Value:
zb_zcl_tunneling_client_send_transfer_data(_param, _ep, _prfl_id, _def_resp, _cb, \
_tunnel_id, _data_size, _image_data)

Send TransferData command from Tunneling client to server

Parameters
_param- Reference to buffer.
_ep- Current endpoint.
_prfl_id- profile identifier
_def_resp- enable/disable default zcl response
_cb- Callback which should be called when the ZCL stack receives APS ack.
_tunnel_id- zb_zcl_tunneling_transfer_data_hdr_t::tunnel_id value
_data_size- zb_zcl_tunneling_transfer_data_payload_t::data_size value
_image_data- tun_data from zb_zcl_tunneling_transfer_data_payload_t::tun_data value
Usage

Example of sending TransferData command
See also
TransferData client command

◆ ZB_ZCL_TUNNELING_GET_CLOSE_TUNNEL

#define ZB_ZCL_TUNNELING_GET_CLOSE_TUNNEL (   _data_ptr,
  _buffer,
  _status 
)
Value:
{ \
zb_zcl_tunneling_close_tunnel_t *src_ptr = \
\
if (zb_buf_len((_buffer)) < sizeof(zb_zcl_tunneling_close_tunnel_t)) \
{ \
} \
else \
{ \
ZB_HTOLE16(&(_data_ptr)->tunnel_id, &(src_ptr->tunnel_id)); \
} \
}

Macro for parsing payload of CloseTunnel command.

Parameters
_data_ptr- pointer to zb_zcl_tunneling_close_tunnel_t structure
_buffer- pointer to buffer where CloseTunnel command's payload is stored.
_status- status of payload parsing

◆ ZB_ZCL_TUNNELING_GET_REQUEST_TUNNEL

#define ZB_ZCL_TUNNELING_GET_REQUEST_TUNNEL (   _data_ptr,
  _buffer,
  _status 
)
Value:
{ \
zb_zcl_tunneling_request_tunnel_t *src_ptr = \
\
if (zb_buf_len((_buffer)) < sizeof(zb_zcl_tunneling_request_tunnel_t)) \
{ \
} \
else \
{ \
(_data_ptr)->protocol_id = src_ptr->protocol_id; \
ZB_HTOLE16(&(_data_ptr)->manufacturer_code, &(src_ptr->manufacturer_code)); \
(_data_ptr)->flow_control_support = src_ptr->flow_control_support; \
ZB_HTOLE16(&(_data_ptr)->max_incoming_transfer_size, \
&(src_ptr->max_incoming_transfer_size)); \
} \
}

Macro for parsing payload of RequestTunnel command.

Parameters
_data_ptr- pointer to zb_zcl_tunneling_request_tunnel_t structure
_buffer- pointer to buffer where RequestTunnel command's payload is stored.
_status- status of payload parsing

◆ ZB_ZCL_TUNNELING_GET_REQUEST_TUNNEL_RESPONSE

#define ZB_ZCL_TUNNELING_GET_REQUEST_TUNNEL_RESPONSE (   _data_ptr,
  _buffer,
  _status 
)
Value:
{ \
zb_zcl_tunneling_request_tunnel_response_t *src_ptr = \
\
{ \
} \
else \
{ \
ZB_HTOLE16(&(_data_ptr)->tunnel_id, &(src_ptr->tunnel_id)); \
(_data_ptr)->tunnel_status = src_ptr->tunnel_status; \
ZB_HTOLE16(&(_data_ptr)->max_incoming_transfer_size, \
&(src_ptr->max_incoming_transfer_size)); \
} \
}

Macro for parsing payload of RequestTunnelResponse command.

Parameters
_data_ptr- pointer to zb_zcl_tunneling_request_tunnel_response_t structure
_buffer- pointer to buffer where RequestTunnelResponse command's payload is stored.
_status- status of payload parsing

◆ ZB_ZCL_TUNNELING_GET_TRANSFER_DATA

#define ZB_ZCL_TUNNELING_GET_TRANSFER_DATA (   _data_ptr,
  _buffer,
  _status 
)
Value:
{ \
zb_uint8_t *src_ptr = (zb_uint8_t*)zb_buf_begin((_buffer)); \
\
{ \
} \
else \
{ \
ZB_HTOLE16(&(_data_ptr)->hdr.tunnel_id, src_ptr); \
(_data_ptr)->data_size = zb_buf_len((_buffer)) - \
(_data_ptr)->tun_data = (zb_uint8_t*)(src_ptr + \
} \
}

Macro for parsing payload of TransferData command.

Parameters
_data_ptr- pointer to zb_zcl_tunneling_transfer_data_payload_t structure
_buffer- pointer to buffer where TransferData command's payload is stored.
_status- status of payload parsing
See also
TransferData client command
TransferData server command

◆ ZB_ZCL_TUNNELING_GET_TRANSFER_DATA_ERROR

#define ZB_ZCL_TUNNELING_GET_TRANSFER_DATA_ERROR (   _data_ptr,
  _buffer,
  _status 
)
Value:
{ \
zb_zcl_tunneling_transfer_data_error_t *src_ptr = \
\
{ \
} \
else \
{ \
ZB_HTOLE16(&(_data_ptr)->tunnel_id, &(src_ptr->tunnel_id)); \
(_data_ptr)->transfer_data_status = src_ptr->transfer_data_status; \
} \
}

Macro for parsing payload of TransferDataError command.

Parameters
_data_ptr- pointer to zb_zcl_tunneling_transfer_data_error_t structure
_buffer- pointer to buffer where TransferDataError command's payload is stored.
_status- status of payload parsing
See also
TransferDataError client command
TransferDataError server command

◆ ZB_ZCL_TUNNELING_SEND_CLOSE_TUNNEL

#define ZB_ZCL_TUNNELING_SEND_CLOSE_TUNNEL (   _param,
  _addr,
  _dst_addr_mode,
  _dst_ep,
  _ep,
  _prfl_id,
  _def_resp,
  _cb,
  _tunnel_id 
)
Value:
{ \
zb_bufid_t _buffer = _param; \
zb_uint8_t* __ptr = zb_zcl_start_command_header(_buffer, \
ZB_ZCL_CONSTRUCT_FRAME_CONTROL(ZB_ZCL_FRAME_TYPE_CLUSTER_SPECIFIC, \
0, /* No manuf_code */ \
ZB_ZCL_PACKET_PUT_DATA16_VAL(__ptr, (_tunnel_id)); \
ZB_ZCL_FINISH_PACKET(_buffer, __ptr) \
ZB_ZCL_SEND_COMMAND_SHORT( \
_buffer, (_addr), (_dst_addr_mode), (_dst_ep), (_ep), (_prfl_id), \
}

CloseTunnel command

Parameters
_param- Reference to buffer.
_addr- Address of the device to send command to.
_dst_addr_mode- Address mode for _dst_addr.
_dst_ep- Destination endpoint.
_ep- Current endpoint.
_prfl_id- profile identifier
_def_resp- enable/disable default zcl response
_cb- Callback which should be called when the ZCL stack receives APS ack.
_tunnel_id- zb_zcl_tunneling_close_tunnel_t::tunnel_id value
Usage

Example of sending CloseTunnel command

◆ ZB_ZCL_TUNNELING_SEND_REQUEST_TUNNEL

#define ZB_ZCL_TUNNELING_SEND_REQUEST_TUNNEL (   _param,
  _addr,
  _dst_addr_mode,
  _dst_ep,
  _ep,
  _prfl_id,
  _def_resp,
  _cb,
  _protocol_id,
  _manufacturer_code,
  _flow_control_support,
  _max_incoming_transfer_size 
)
Value:
{ \
zb_zcl_tunneling_set_max_incoming_to_cli_transfer_size( \
_max_incoming_transfer_size); \
{ \
zb_bufid_t _buffer = _param; \
zb_uint8_t* __ptr = zb_zcl_start_command_header(_buffer, \
ZB_ZCL_CONSTRUCT_FRAME_CONTROL(ZB_ZCL_FRAME_TYPE_CLUSTER_SPECIFIC, \
0, /* No manuf_code */ \
ZB_ZCL_PACKET_PUT_DATA8(__ptr, (_protocol_id)); \
ZB_ZCL_PACKET_PUT_DATA16_VAL(__ptr, (_manufacturer_code)); \
ZB_ZCL_PACKET_PUT_DATA8(__ptr, (_flow_control_support)); \
ZB_ZCL_PACKET_PUT_DATA16_VAL(__ptr, (_max_incoming_transfer_size)); \
ZB_ZCL_FINISH_PACKET(_buffer, __ptr) \
ZB_ZCL_SEND_COMMAND_SHORT( \
_buffer, (_addr), (_dst_addr_mode), (_dst_ep), (_ep), (_prfl_id), \
} \
}

Send RequestTunnel command.

Parameters
_param- Reference to buffer.
_addr- Address of the device to send command to.
_dst_addr_mode- Address mode for _dst_addr.
_dst_ep- Destination endpoint.
_ep- Current endpoint.
_prfl_id- profile identifier
_def_resp- enable/disable default zcl response
_cb- Callback which should be called when the ZCL stack receives APS ack.
_protocol_id- zb_zcl_tunneling_request_tunnel_t::protocol_id value
_manufacturer_code- zb_zcl_tunneling_request_tunnel_t::manufacturer_code value
_flow_control_support- zb_zcl_tunneling_request_tunnel_t::flow_control_support value
_max_incoming_transfer_size- zb_zcl_tunneling_request_tunnel_t::max_incoming_transfer_size value
Usage

Example of sending RequestTunnel command

◆ ZB_ZCL_TUNNELING_SEND_REQUEST_TUNNEL_RESPONSE

#define ZB_ZCL_TUNNELING_SEND_REQUEST_TUNNEL_RESPONSE (   _param,
  _addr,
  _dst_addr_mode,
  _dst_ep,
  _ep,
  _prfl_id,
  _def_resp,
  _seq_num,
  _cb,
  _tunnel_id,
  _tunnel_status,
  _max_incoming_transfer_size 
)
Value:
{ \
zb_bufid_t _buffer = _param; \
zb_uint8_t* __ptr = ZB_ZCL_START_PACKET(_buffer); \
ZB_ZCL_CONSTRUCT_SPECIFIC_COMMAND_RESP_FRAME_CONTROL_A(__ptr, \
ZB_ZCL_CONSTRUCT_COMMAND_HEADER(__ptr, _seq_num, ZB_ZCL_TUNNELING_SRV_CMD_REQUEST_TUNNEL_RESPONSE); \
ZB_ZCL_PACKET_PUT_DATA16_VAL(__ptr, (_tunnel_id)); \
ZB_ZCL_PACKET_PUT_DATA8(__ptr, (_tunnel_status)); \
ZB_ZCL_PACKET_PUT_DATA16_VAL(__ptr, (_max_incoming_transfer_size)); \
ZB_ZCL_FINISH_PACKET(_buffer, __ptr) \
ZB_ZCL_SEND_COMMAND_SHORT( \
_buffer, (_addr), (_dst_addr_mode), (_dst_ep), (_ep), (_prfl_id), \
}

Macro for sending RequestTunnelResponse command.

Parameters
_param- Reference to buffer.
_addr- Address of the device to send command to.
_dst_addr_mode- Address mode for _dst_addr.
_dst_ep- Destination endpoint.
_ep- Current endpoint.
_prfl_id- profile identifier
_def_resp- enable/disable default zcl response
_seq_num- ZCL transaction sequence number
_cb- Callback which should be called when the ZCL stack receives APS ack.
_tunnel_id- zb_zcl_tunneling_request_tunnel_response_t::tunnel_id value
_tunnel_status- zb_zcl_tunneling_request_tunnel_response_t::tunnel_status value
_max_incoming_transfer_size- zb_zcl_tunneling_request_tunnel_response_t::max_incoming_transfer_size value

◆ ZB_ZCL_TUNNELING_SEND_TRANSFER_DATA_ERROR

#define ZB_ZCL_TUNNELING_SEND_TRANSFER_DATA_ERROR (   _buffer,
  _addr,
  _dst_addr_mode,
  _dst_ep,
  _ep,
  _prfl_id,
  _def_resp,
  _cb,
  _seq_num,
  _tunnel_id,
  _transfer_data_status,
  _command_id,
  _direction 
)
Value:
{ \
zb_uint8_t* __ptr = ZB_ZCL_START_PACKET((_buffer)); \
ZB_ZCL_CONSTRUCT_SPECIFIC_COMMAND_RESP_FRAME_CONTROL_A(__ptr, \
_direction, \
ZB_ZCL_CONSTRUCT_COMMAND_HEADER(__ptr, _seq_num, _command_id); \
ZB_ZCL_PACKET_PUT_DATA16_VAL(__ptr, (_tunnel_id)); \
ZB_ZCL_PACKET_PUT_DATA8(__ptr, (_transfer_data_status)); \
ZB_ZCL_FINISH_PACKET((_buffer), __ptr) \
ZB_ZCL_SEND_COMMAND_SHORT( \
(_buffer), (_addr), (_dst_addr_mode), (_dst_ep), (_ep), (_prfl_id), \
}

Send client TransferDataError command and server TransferDataError command.

Parameters
_buffer- pointer to buffer.
_addr- Address of the device to send command to.
_dst_addr_mode- Address mode for _dst_addr.
_dst_ep- Destination endpoint.
_ep- Current endpoint.
_prfl_id- profile identifier
_def_resp- enable/disable default zcl response
_cb- Callback which should be called when the ZCL stack receives APS ack.
_seq_num- ZCL transaction sequence number
_tunnel_id- zb_zcl_tunneling_transfer_data_error_t::tunnel_id value
_transfer_data_status- zb_zcl_tunneling_transfer_data_error_t::transfer_data_status value
_command_id- Tunneling cluster's command identifier.
_direction- command direction.

◆ ZB_ZCL_TUNNELING_SERVER_SEND_TRANSFER_DATA

#define ZB_ZCL_TUNNELING_SERVER_SEND_TRANSFER_DATA (   _param,
  _ep,
  _prfl_id,
  _def_resp,
  _cb,
  _tunnel_id,
  _data_size,
  _image_data 
)
Value:
zb_zcl_tunneling_server_send_transfer_data(_param, _ep, _prfl_id, _def_resp, _cb, \
_tunnel_id, _data_size, _image_data)

Send TransferData command from Tunneling server to client

Parameters
_param- Reference to buffer.
_ep- Current endpoint.
_prfl_id- profile identifier
_def_resp- enable/disable default zcl response
_cb- Callback which should be called when the ZCL stack receives APS ack.
_tunnel_id- zb_zcl_tunneling_transfer_data_hdr_t::tunnel_id value
_data_size- zb_zcl_tunneling_transfer_data_payload_t::data_size value
_image_data- tun_data from zb_zcl_tunneling_transfer_data_payload_t::tun_data value
Usage

Example of sending TransferData command
See also
TransferData server command

Typedef Documentation

◆ zb_zcl_tunneling_ack_transfer_data_t

AckTransferData command payload.

See also
SE spec, subclause D.6.2.4.5.2.
Client AckTransferData command
Server AckTransferData command

◆ zb_zcl_tunneling_close_tunnel_t

CloseTunnel command payload

See also
SE spec, subclause D.6.2.4.2.2.

◆ zb_zcl_tunneling_get_supported_tunnel_protocols_t

◆ zb_zcl_tunneling_protocol_field_t

Supported Tunnel Protocols Response Command Protocol Fields

See also
SE spec, Figure D-112
zb_zcl_tunneling_supported_tunnel_protocols_response_t::protocols

◆ zb_zcl_tunneling_protocol_id_t

Tunneling ProtocolID Enumerations.

See also
SE spec, subclause D.6.2.4.1.2, Table D-124
RequestTunnel
zb_zcl_tunneling_request_tunnel_s::protocol_id

◆ zb_zcl_tunneling_ready_data_t

ReadyData command payload

See also
SE spec, subclause D.6.2.4.6.2
Client ReadyData command
Server ReadyData command

◆ zb_zcl_tunneling_request_tunnel_response_t

RequestTunnelResponse command payload

See also
SE spec, subclause D.6.2.5.1.2

◆ zb_zcl_tunneling_request_tunnel_t

RequestTunnel command payload

See also
SE spec, subclause D.6.2.4.1.2

◆ zb_zcl_tunneling_supported_tunnel_protocols_response_t

◆ zb_zcl_tunneling_transfer_data_error_t

TransferDataError command payload

See also
SE spec, subclause D.6.2.4.4.2
Client TransferDataError command
Server TransferDataError command

◆ zb_zcl_tunneling_transfer_data_hdr_t

TransferData commands header data.

See also
SE spec, subclause D.6.2.4.3.2
zb_zcl_tunneling_transfer_data_payload_t::hdr
TransferData client command
TransferData server command

◆ zb_zcl_tunneling_transfer_data_payload_t

TransferData payload. This structure presents custom implementation of Transfer Data command payload defined in SE spec.

See also
SE spec, subclause D.6.2.4.3.2 and D.6.2.5.2
TransferData client command
TransferData server command

◆ zb_zcl_tunneling_tunnel_closure_notification_t

Enumeration Type Documentation

◆ zb_zcl_tunneling_cli_cmd_e

Tunnel cluster commands received.

See also
SE spec, subclause D.6.2.4
Enumerator
ZB_ZCL_TUNNELING_CLI_CMD_REQUEST_TUNNEL 

RequestTunnel is the client command used to setup a tunnel association with the server. The request payload specifies the protocol identifier for the requested tunnel, a manufacturer code in case of proprietary protocols and the use of flow control for streaming protocols.

See also
zb_zcl_tunneling_request_tunnel_s
ZB_ZCL_TUNNELING_CLI_CMD_CLOSE_TUNNEL 

Client command used to close the tunnel with the server. The parameter in the payload specifies the tunnel identifier of the tunnel that has to be closed. The server leaves the tunnel open and the assigned resources allocated until the client sends the CloseTunnel command or the CloseTunnelTimeout fires.

See also
zb_zcl_tunneling_close_tunnel_s
ZB_ZCL_TUNNELING_CLI_CMD_TRANSFER_DATA 

Command that indicates (if received) that the client has sent data to the server. The data itself is contained within the payload.

See also
zb_zcl_tunneling_transfer_data_payload_s
ZB_ZCL_TUNNELING_CLI_CMD_TRANSFER_DATA_ERROR 

This command is generated by the receiver of a TransferData command if the tunnel status indicates that something is wrong.

There are three cases in which TransferDataError is sent:

  • The TransferData received contains a TunnelID that does not match to any of the active tunnels of the receiving device. This could happen if a (sleeping) device sends a TransferData command to a tunnel that has been closed by the server after the CloseTunnelTimeout.
  • The TransferData received contains a proper TunnelID of an active tunnel, but the device sending the data does not match to it.
  • The TransferData received contains more data MaximumIncomingTransferSize of the receiving device.
See also
zb_zcl_tunneling_transfer_data_error_s
ZB_ZCL_TUNNELING_CLI_CMD_ACK_TRANSFER_DATA 

Command sent in response to each TransferData command in case – and only in case – flow control has been requested by the client in the TunnelRequest command and is supported by both tunnel endpoints. The response payload indicates the number of octets that may still be received by the receiver.

See also
zb_zcl_tunneling_ack_transfer_data_s
ZB_ZCL_TUNNELING_CLI_CMD_READY_DATA 

The ReadyData command is generated – after a receiver had to stop the dataflow using the AckTransferData(0) command – to indicate that the device is now ready to continue receiving data. The parameter NumberOfOctetsLeft gives a hint on how much space is left for the next data transfer. The ReadyData command is only issued if flow control is enabled.

See also
zb_zcl_tunneling_ready_data_s
ZB_ZCL_TUNNELING_CLI_CMD_GET_SUPPORTED_TUNNEL_PROTOCOLS 

Get Supported Tunnel Protocols is the client command used to determine the tunnel protocols supported on another device.

See also
zb_zcl_tunneling_get_supported_tunnel_protocols_s

◆ zb_zcl_tunneling_protocol_id_e

Tunneling ProtocolID Enumerations.

See also
SE spec, subclause D.6.2.4.1.2, Table D-124
RequestTunnel
zb_zcl_tunneling_request_tunnel_s::protocol_id
Enumerator
ZB_ZCL_TUNNELING_PROTOCOL_DLMS_COSEM 

DLMS/COSEM (IEC 62056)

ZB_ZCL_TUNNELING_PROTOCOL_IEC_61107 

IEC 61107

ZB_ZCL_TUNNELING_PROTOCOL_ANSI_C12 

ANSI C12

ZB_ZCL_TUNNELING_PROTOCOL_M_BUS 

M-BUS

ZB_ZCL_TUNNELING_PROTOCOL_SML 

SML

ZB_ZCL_TUNNELING_PROTOCOL_CLIMATE_TALK 

ClimateTalk

ZB_ZCL_TUNNELING_PROTOCOL_GB_HRGP 

GB-HRGP

ZB_ZCL_TUNNELING_PROTOCOL_IPv4 

IP v4

ZB_ZCL_TUNNELING_PROTOCOL_IPv6 

IP v6

ZB_ZCL_TUNNELING_PROTOCOL_MANUFACTURER_DEFINED 

200 to 254 manufacturer-defined protocols

ZB_ZCL_TUNNELING_PROTOCOL_RESERVED 

reserved value

◆ zb_zcl_tunneling_srv_cmd_e

Tunnel cluster commands generated.

See also
SE spec, subclause D.6.2.5
Enumerator
ZB_ZCL_TUNNELING_SRV_CMD_REQUEST_TUNNEL_RESPONSE 

RequestTunnelResponse is sent by the server in response to a RequestTunnel command previously received from the client. The response contains the status of the RequestTunnel command and a tunnel identifier corresponding to the tunnel that has been set-up in the server in case of success.

See also
zb_zcl_tunneling_request_tunnel_response_s
ZB_ZCL_TUNNELING_SRV_CMD_TRANSFER_DATA 

Command that transfers data from server to the client. The data itself has to be placed within the payload.

See also
zb_zcl_tunneling_transfer_data_payload_s
ZB_ZCL_TUNNELING_SRV_CMD_TRANSFER_DATA_ERROR 

This command is generated by the receiver of a TransferData command if the tunnel status indicates that something is wrong.

There are three cases in which TransferDataError is sent:

  • The TransferData received contains a TunnelID that does not match to any of the active tunnels of the receiving device. This could happen if a (sleeping) device sends a TransferData command to a tunnel that has been closed by the server after the CloseTunnelTimeout.
  • The TransferData received contains a proper TunnelID of an active tunnel, but the device sending the data does not match to it.
  • The TransferData received contains more data MaximumIncomingTransferSize of the receiving device.
See also
zb_zcl_tunneling_transfer_data_error_s
ZB_ZCL_TUNNELING_SRV_CMD_ACK_TRANSFER_DATA 

Command sent in response to each TransferData command in case – and only in case – flow control has been requested by the client in the TunnelRequest command and is supported by both tunnel endpoints. The response payload indicates the number of octets that may still be received by the receiver.

See also
zb_zcl_tunneling_ack_transfer_data_s
ZB_ZCL_TUNNELING_SRV_CMD_READY_DATA 

The ReadyData command is generated – after a receiver had to stop the dataflow using the AckTransferData(0) command – to indicate that the device is now ready to continue receiving data. The parameter NumberOfOctetsLeft gives a hint on how much space is left for the next data transfer. The ReadyData command is only issued if flow control is enabled.

See also
zb_zcl_tunneling_ready_data_s
ZB_ZCL_TUNNELING_SRV_CMD_SUPPORTED_TUNNEL_PROTOCOLS_RESPONSE 

Supported Tunnel Protocols Response is sent in response to a Get Supported Tunnel Protocols command previously received. The response contains a list of tunnel protocols supported by the device; the payload of the response should be capable of holding up to 16 protocols.

See also
zb_zcl_tunneling_supported_tunnel_protocols_response_s
ZB_ZCL_TUNNELING_SRV_CMD_TUNNEL_CLOSURE_NOTIFICATION 

TunnelClosureNotification is sent by the server to indicate that a tunnel has been closed due to expiration of a CloseTunnelTimeout.

See also
zb_zcl_tunneling_tunnel_closure_notification_s

◆ zb_zcl_tunneling_transfer_data_status_e

TransferDataStatus parameter values.

See also
SE spec, Table D-125
zb_zcl_tunneling_transfer_data_error_t::transfer_data_status
Enumerator
ZB_ZCL_TUNNELING_TRANSFER_DATA_STATUS_NO_SUCH_TUNNEL 

The TransferData command contains a TunnelID of a non-existent tunnel.

ZB_ZCL_TUNNELING_TRANSFER_DATA_STATUS_WRONG_DEVICE 

The TransferData command contains a TunnelID that does not match the device sending the data.

ZB_ZCL_TUNNELING_TRANSFER_DATA_STATUS_DATA_OVERFLOW 

The TransferData command contains more data than indicated by the MaximumIncomingTransferSize of the receiving device.

◆ zb_zcl_tunneling_tunnel_status_e

TunnelStatus parameter values.

See also
SE spec, Table D-127
RequestTunnelResponse
zb_zcl_tunneling_request_tunnel_response_s::tunnel_status
Enumerator
ZB_ZCL_TUNNELING_STATUS_SUCCESS 

The tunnel has been opened and may now be used to transfer data in both directions.

ZB_ZCL_TUNNELING_STATUS_BUSY 

The server is busy and cannot create a new tunnel at the moment. The client may try again after a recommended timeout of 3 minutes.

ZB_ZCL_TUNNELING_STATUS_NO_MORE_IDS 

The server has no more resources to setup requested tunnel. Clients should close any open tunnels before retrying.

ZB_ZCL_TUNNELING_STATUS_PROTOCOL_NOT_SUPPORTED 

The server does not support the protocol that has been requested in the ProtocolID parameter of the RequestTunnel command.

ZB_ZCL_TUNNELING_STATUS_FLOW_CONTROL_NOT_SUPPORTED 

Flow control has been requested by the client in the RequestTunnel command but cannot be provided by the server (missing resources or no support).

ZB_ZCL_FRAME_TYPE_CLUSTER_SPECIFIC
#define ZB_ZCL_FRAME_TYPE_CLUSTER_SPECIFIC
Definition: zb_zcl_common.h:893
ZB_ZCL_START_PACKET
#define ZB_ZCL_START_PACKET(zbbuf)
Initializes zb_buf_t buffer and returns pointer to the beginning of array.
Definition: zb_zcl_common.h:1431
zb_uint8_t
unsigned char zb_uint8_t
Project-local 1-byte unsigned int type.
Definition: zb_types.h:149
ZB_ZCL_TUNNELING_CLI_CMD_CLOSE_TUNNEL
@ ZB_ZCL_TUNNELING_CLI_CMD_CLOSE_TUNNEL
Client command used to close the tunnel with the server. The parameter in the payload specifies the t...
Definition: zb_zcl_tunneling.h:148
ZB_ZCL_FRAME_DIRECTION_TO_CLI
#define ZB_ZCL_FRAME_DIRECTION_TO_CLI
Definition: zb_zcl_common.h:959
ZB_ZCL_TUNNELING_SRV_CMD_REQUEST_TUNNEL_RESPONSE
@ ZB_ZCL_TUNNELING_SRV_CMD_REQUEST_TUNNEL_RESPONSE
RequestTunnelResponse is sent by the server in response to a RequestTunnel command previously receive...
Definition: zb_zcl_tunneling.h:211
ZB_ZCL_NOT_MANUFACTURER_SPECIFIC
#define ZB_ZCL_NOT_MANUFACTURER_SPECIFIC
Definition: zb_zcl_common.h:912
zb_zcl_tunneling_request_tunnel_response_s
RequestTunnelResponse command payload
Definition: zb_zcl_tunneling.h:762
zb_zcl_tunneling_request_tunnel_s
RequestTunnel command payload
Definition: zb_zcl_tunneling.h:350
ZB_ZCL_FRAME_DIRECTION_TO_SRV
#define ZB_ZCL_FRAME_DIRECTION_TO_SRV
Definition: zb_zcl_common.h:957
zb_buf_begin
#define zb_buf_begin(buf)
Definition: zboss_api_buf.h:344
ZB_ZCL_CLUSTER_ID_TUNNELING
#define ZB_ZCL_CLUSTER_ID_TUNNELING
Definition: zb_zcl_common.h:268
ZB_ZCL_TUNNELING_CLI_CMD_REQUEST_TUNNEL
@ ZB_ZCL_TUNNELING_CLI_CMD_REQUEST_TUNNEL
RequestTunnel is the client command used to setup a tunnel association with the server....
Definition: zb_zcl_tunneling.h:141
ZB_ZCL_PARSE_STATUS_SUCCESS
@ ZB_ZCL_PARSE_STATUS_SUCCESS
Definition: zb_zcl_common.h:328
zb_zcl_tunneling_transfer_data_error_s
TransferDataError command payload
Definition: zb_zcl_tunneling.h:680
zb_zcl_start_command_header
void * zb_zcl_start_command_header(zb_bufid_t zbbuf, zb_uint8_t frame_ctl, zb_uint16_t manuf_code, zb_uint8_t cmd_id, zb_uint8_t *tsn)
Construct ZCL command header in the buffer.
zb_zcl_tunneling_transfer_data_hdr_s
TransferData commands header data.
Definition: zb_zcl_tunneling.h:534
ZB_ZCL_PARSE_STATUS_FAILURE
@ ZB_ZCL_PARSE_STATUS_FAILURE
Definition: zb_zcl_common.h:329
zb_zcl_tunneling_close_tunnel_s
CloseTunnel command payload
Definition: zb_zcl_tunneling.h:459
zb_buf_len
#define zb_buf_len(buf)
Definition: zboss_api_buf.h:362