Z-Wave Protocol Controller Reference
Z-Wave TX Process

Z-Wave TX process taking care of the TX Queue and interfaces with the Z-Wave API. More...

Collaboration diagram for Z-Wave TX Process:

Typedefs

typedef enum zwave_tx_state zwave_tx_state_t
 The Z-Wave TX Process states. More...
 

Enumerations

enum  zwave_tx_events_t { ZWAVE_TX_SEND_NEXT_MESSAGE , ZWAVE_TX_SEND_OPERATION_COMPLETE }
 Event definitions for the Z-Wave TX Process. More...
 
enum  zwave_tx_backoff_reason_t { BACKOFF_CURRENT_SESSION_ID , BACKOFF_EXPECTED_ADDITIONAL_FRAMES , BACKOFF_PROTOCOL_SENDING_FRAMES , BACKOFF_INCOMING_UNSOLICITED_ROUTED_FRAME }
 List of reasons for going into a Tx Back-off-. More...
 
enum  zwave_tx_state { ZWAVE_TX_STATE_IDLE , ZWAVE_TX_STATE_TRANSMISSION_ONGOING , ZWAVE_TX_STATE_BACKOFF }
 The Z-Wave TX Process states. More...
 

Functions

 PROCESS_NAME (zwave_tx_process)
 Name the of contiki process for the Z-Wave TX. More...
 
void zwave_tx_process_inspect_received_frame (zwave_node_id_t node_id)
 Checks after receiving a frame from a NodeID if we should resume from TX back-off. More...
 
sl_status_t zwave_tx_process_abort_transmission (zwave_tx_session_id_t session_id)
 Aborts a transmission that has been queued but not delivered yet. More...
 
bool zwave_tx_process_queue_flush_is_ongoing ()
 Verifies if we are trying to flush the queue or keep it empty. More...
 
void zwave_tx_process_check_queue ()
 Triggers the processing of the next frame in the queue if we are idle. More...
 
void zwave_tx_process_set_expected_frames (zwave_node_id_t remote_node_id, uint8_t number_of_incoming_frames)
 Tells the Z-Wave TX process that more frames are to be expected f from some NodeIDs. More...
 
void zwave_tx_process_log_state ()
 Logs the state of the Z-Wave TX Process using sl_log. More...
 
sl_status_t zwave_tx_process_flush_queue_reset_step ()
 Initiates a flush of the Tx Queue for a reset operation. More...
 
void zwave_tx_process_open_tx_queue ()
 (Re-)opens the Z-Wave Tx Queue to accept frames. More...
 

Detailed Description

Z-Wave TX process taking care of the TX Queue and interfaces with the Z-Wave API.

The Z-Wave TX Process is responsible for looking into the Z-Wave TX queue and perform transmission requests, monitor callbacks with the Z-Wave API. This process requires the Z-Wave API to be initialized before it will work properly. The TX Process is a small state machine consisting of 3 states, depicted in the following diagram:

The Z-Wave TX Process must be started after the Z-Wave RX process

Typedef Documentation

◆ zwave_tx_state_t

The Z-Wave TX Process states.

Enumeration Type Documentation

◆ zwave_tx_backoff_reason_t

List of reasons for going into a Tx Back-off-.

Enumerator
BACKOFF_CURRENT_SESSION_ID 

Back-off has been initiated due to the current_tx_session_id expecting some responses

BACKOFF_EXPECTED_ADDITIONAL_FRAMES 

Back-off has been initiated due to the application telling us of expected incoming frames.

BACKOFF_PROTOCOL_SENDING_FRAMES 

Back-off has been initiated because Z-Wave API module is sending frames on its own, and we do not want to interfere with this.

BACKOFF_INCOMING_UNSOLICITED_ROUTED_FRAME 

Back-off has been initiated becasue we received a routed frame and we want to avoid using the route before we are sure that the sender has received the routed ack.

◆ zwave_tx_events_t

Event definitions for the Z-Wave TX Process.

Enumerator
ZWAVE_TX_SEND_NEXT_MESSAGE 

Send the next message in the TX Queue.

ZWAVE_TX_SEND_OPERATION_COMPLETE 

The ongoing transmission is now completed.

◆ zwave_tx_state

The Z-Wave TX Process states.

Enumerator
ZWAVE_TX_STATE_IDLE 

Z-Wave TX is idle and new transmissions to Z-Wave nodes can be initiated.

ZWAVE_TX_STATE_TRANSMISSION_ONGOING 

Z-Wave TX has passed on the message to the Z-Wave module and waits for a callback.

ZWAVE_TX_STATE_BACKOFF 

Z-Wave TX waits after a transmission that requires a response to minimize the risk of radio transmit collisions.

Function Documentation

◆ PROCESS_NAME()

PROCESS_NAME ( zwave_tx_process  )

Name the of contiki process for the Z-Wave TX.

This is used to register the name of the Z-Wave TX Process.

◆ zwave_tx_process_abort_transmission()

sl_status_t zwave_tx_process_abort_transmission ( zwave_tx_session_id_t  session_id)

Aborts a transmission that has been queued but not delivered yet.

This function is used to attempt to abort a queued or ongoing transmission.

Parameters
session_idthe session_id of the element to abort.
Returns
  • SL_STATUS_IN_PROGRESS if the element was sent to the Z-Wave API and cancellation was requested but pending Z-Wave API to return a callback.
  • SL_STATUS_OK if the element was removed from the queue.
  • SL_STATUS_NOT_FOUND if the element identified by session_id does not exist in the queue.

◆ zwave_tx_process_check_queue()

void zwave_tx_process_check_queue ( )

Triggers the processing of the next frame in the queue if we are idle.

Use this function instead of posting directly a ZWAVE_TX_SEND_NEXT_MESSAGE event to the Z-Wave TX Process

◆ zwave_tx_process_flush_queue_reset_step()

sl_status_t zwave_tx_process_flush_queue_reset_step ( )

Initiates a flush of the Tx Queue for a reset operation.

Tx Queue will be closed for new elements until calling zwave_tx_process_open_tx_queue();

◆ zwave_tx_process_inspect_received_frame()

void zwave_tx_process_inspect_received_frame ( zwave_node_id_t  node_id)

Checks after receiving a frame from a NodeID if we should resume from TX back-off.

Parameters
node_idZ-Wave NodeID that sent us the frame

◆ zwave_tx_process_log_state()

void zwave_tx_process_log_state ( )

Logs the state of the Z-Wave TX Process using sl_log.

◆ zwave_tx_process_open_tx_queue()

void zwave_tx_process_open_tx_queue ( )

(Re-)opens the Z-Wave Tx Queue to accept frames.

◆ zwave_tx_process_queue_flush_is_ongoing()

bool zwave_tx_process_queue_flush_is_ongoing ( )

Verifies if we are trying to flush the queue or keep it empty.

Returns
boolean value.

◆ zwave_tx_process_set_expected_frames()

void zwave_tx_process_set_expected_frames ( zwave_node_id_t  remote_node_id,
uint8_t  number_of_incoming_frames 
)

Tells the Z-Wave TX process that more frames are to be expected f from some NodeIDs.

Parameters
remote_node_idThe remote NodeID that will send us >1 frame(s)
number_of_incoming_framesThe number of frames to add.