Z-Wave Protocol Controller Reference

Transport for Transport Service Command Class. More...

Collaboration diagram for Transport Service:

Macros

#define COMMAND_CLASS_TRANSPORT_SERVICE_V2   0x55
 

Typedefs

typedef zwave_node_id_t ts_node_id_t
 
typedef void(* on_transport_service_send_data_complete_t) (uint8_t status, void *user)
 Transport service calls this callback to notify upper layers of completion of transmit of whole payload. More...
 
typedef void(* on_lower_layer_send_data_complete_t) (uint8_t status, void *user)
 This callback is sent to lower layers and should be called when the transmission of what Transport service asked is either success or failure. More...
 
typedef uint8_t(* send_data_t) (ts_node_id_t source, ts_node_id_t dest, const uint8_t *payload, uint16_t payload_len, uint8_t no_of_expected_responses, const on_lower_layer_send_data_complete_t on_lower_layer_send_data_complete)
 Lower layer Send Data function which Transport service should use for transmitting broken down smaller fragments. More...
 
typedef void(* upper_layer_command_handler_t) (ts_node_id_t source, ts_node_id_t dest, const uint8_t *frame, uint16_t frame_len)
 This function is called when transport service is done receiving/stiching the whole data and the data needs to be hanlded by upper layer command handlers. More...
 

Enumerations

enum  receive_type { SINGLECAST , BROADCAST , MULTICAST }
 
enum  transport_service_send_data_return_code_t { TRANSPORT_SERVICE_SEND_SUCCESS , TRANSPORT_SERVICE_SEND_FAILURE , TRANSPORT_SERVICE_BUSY , TRANSPORT_SERVICE_WILL_OVERFLOW }
 

Functions

void transport_service_init (ts_node_id_t my_node_id, const upper_layer_command_handler_t upper_layer_command_handler, const send_data_t send_data)
 Initialize the Transport Service. More...
 
transport_service_send_data_return_code_t transport_service_send_data (ts_node_id_t source, ts_node_id_t dest, const uint8_t *payload, uint16_t payload_len, uint16_t max_frame_len, const on_transport_service_send_data_complete_t on_send_complete)
 Sending a long frame with Transport service. More...
 
bool transport_service_on_frame_received (ts_node_id_t source, ts_node_id_t dest, receive_type rx_type, const uint8_t *frame_data, uint8_t frame_length)
 Transport service RX function. More...
 

Detailed Description

Transport for Transport Service Command Class.

Macro Definition Documentation

◆ COMMAND_CLASS_TRANSPORT_SERVICE_V2

#define COMMAND_CLASS_TRANSPORT_SERVICE_V2   0x55

Typedef Documentation

◆ on_lower_layer_send_data_complete_t

typedef void(* on_lower_layer_send_data_complete_t) (uint8_t status, void *user)

This callback is sent to lower layers and should be called when the transmission of what Transport service asked is either success or failure.

Parameters
status0 for success 1 for failure
useruser data to send back

◆ on_transport_service_send_data_complete_t

typedef void(* on_transport_service_send_data_complete_t) (uint8_t status, void *user)

Transport service calls this callback to notify upper layers of completion of transmit of whole payload.

Parameters
status0 for success 1 for failure
useruser data to send back

◆ send_data_t

typedef uint8_t(* send_data_t) (ts_node_id_t source, ts_node_id_t dest, const uint8_t *payload, uint16_t payload_len, uint8_t no_of_expected_responses, const on_lower_layer_send_data_complete_t on_lower_layer_send_data_complete)

Lower layer Send Data function which Transport service should use for transmitting broken down smaller fragments.

Parameters
sourceSource node id
destDestination node id
payloadpayload.
payload_lenLength of payload.
no_of_expected_responses
on_lower_layer_send_data_complete

◆ ts_node_id_t

◆ upper_layer_command_handler_t

typedef void(* upper_layer_command_handler_t) (ts_node_id_t source, ts_node_id_t dest, const uint8_t *frame, uint16_t frame_len)

This function is called when transport service is done receiving/stiching the whole data and the data needs to be hanlded by upper layer command handlers.

Parameters
sourceSource node id
destDestination node id
framepayload.
frame_lenLength of payload.

Enumeration Type Documentation

◆ receive_type

Enumerator
SINGLECAST 
BROADCAST 
MULTICAST 

◆ transport_service_send_data_return_code_t

Enumerator
TRANSPORT_SERVICE_SEND_SUCCESS 
TRANSPORT_SERVICE_SEND_FAILURE 
TRANSPORT_SERVICE_BUSY 
TRANSPORT_SERVICE_WILL_OVERFLOW 

Function Documentation

◆ transport_service_init()

void transport_service_init ( ts_node_id_t  my_node_id,
const upper_layer_command_handler_t  upper_layer_command_handler,
const send_data_t  send_data 
)

Initialize the Transport Service.

Parameters
my_node_id
upper_layer_command_handlerThe Upper layer function which will be called with data after stiching all the fragments received upper_layer_command_handler_t
send_dataLower layer send_data call which Transport Service should use to send any Transport Service frames if needed send_data_t
Here is the call graph for this function:
Here is the caller graph for this function:

◆ transport_service_on_frame_received()

bool transport_service_on_frame_received ( ts_node_id_t  source,
ts_node_id_t  dest,
receive_type  rx_type,
const uint8_t *  frame_data,
uint8_t  frame_length 
)

Transport service RX function.

This function will assemble and handle the request of new frames to complete the receiving of larger payloads with Transport service protocol

Parameters
sourceSource NodeID
destDestination NodeID
rx_typeIf frame is singlecast, broadcast or multicast receive_type
frame_dataframe data
frame_lengthframe length
Returns
bool
Here is the call graph for this function:
Here is the caller graph for this function:

◆ transport_service_send_data()

transport_service_send_data_return_code_t transport_service_send_data ( ts_node_id_t  source,
ts_node_id_t  dest,
const uint8_t *  payload,
uint16_t  payload_len,
uint16_t  max_frame_len,
const on_transport_service_send_data_complete_t  on_send_complete 
)

Sending a long frame with Transport service.

This function will break the data payload and send it with Transport service protocol

Parameters
sourceSource NodeID
destDestination NodeID
payloadPayload
payload_lenLength of payload. layers below
max_frame_lenMaximum number of bytes that can be sent to the destination NodeID at once
on_send_completeTransport service calls this callback to notify upper layers of completion of transmit of whole payload on_transport_service_send_data_complete_t
Here is the call graph for this function:
Here is the caller graph for this function: