Z-Wave Protocol Controller Reference
zwapi_protocol_rx_dispatch.c File Reference
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include "zwapi_internal.h"
#include "zwapi_func_ids.h"
#include "zwapi_protocol_controller.h"
#include "zwapi_protocol_transport.h"
#include "zwapi_session.h"
#include "zwapi_init.h"
#include "zwapi_utils.h"
#include "zwave_controller_endian.h"
#include "sl_log.h"
Include dependency graph for zwapi_protocol_rx_dispatch.c:

Macros

#define LOG_TAG   "zwapi_protocol_rx_dispatch"
 

Functions

void zwave_api_protocol_init_callbacks (void)
 Initialize functions pointers for Z-Wave module callbacks. More...
 
static bool zwave_api_detect_buffer_overflow (uint16_t len)
 
static const char * zwapi_frame_to_string (const uint8_t *buffer, uint16_t buffer_length)
 
static void fill_default_tx_report_values (zwapi_tx_report_t *tx_report)
 Fills default values in the Tx Report in case it is too short or incomplete coming from the Z-Wave API. More...
 
void zwave_api_protocol_rx_dispatch (uint8_t *pData, uint16_t len)
 Execute a callback based on a received frame from the Z-Wave module. More...
 

Variables

static LEARN_INFO learnNodeInfo
 
static uint8_t zwapi_command_buffer [REQUEST_BUFFER_SIZE]
 
void(* zwapi_send_data_callback )(uint8_t, zwapi_tx_report_t *)
 
void(* zwapi_send_nop_callback )(uint8_t, zwapi_tx_report_t *)
 
void(* zwapi_send_data_multi_callback )(uint8_t)
 
void(* zwapi_send_test_frame_callback )(uint8_t)
 
void(* zwapi_send_data_bridge_callback )(uint8_t, zwapi_tx_report_t *)
 
void(* zwapi_send_data_multi_bridge_callback )(uint8_t)
 
void(* zwapi_send_node_information_callback )(uint8_t txStatus)
 
void(* zwapi_memory_put_buffer_callback )(void)
 
void(* zwapi_set_default_callback )(void)
 
void(* zwapi_create_new_primarly_ctrl_callback )(struct LEARN_INFO *)
 
void(* zwapi_remove_node_from_network_callback )(struct LEARN_INFO *)
 
void(* zwapi_add_node_to_network_callback )(struct LEARN_INFO *)
 
void(* zwapi_transfer_primary_ctrl_role_callback )(struct LEARN_INFO *)
 
void(* zwapi_send_controller_replication_callback )(uint8_t txStatus)
 
void(* zwapi_assign_return_route_callback )(uint8_t bStatus)
 
void(* zwapi_assign_suc_return_route_callback )(uint8_t bStatus)
 
void(* zwapi_delete_suc_return_route_callback )(uint8_t bStatus)
 
void(* zwapi_delete_return_route_callback )(uint8_t bStatus)
 
void(* zwapi_set_learn_mode_callback )(struct LEARN_INFO *)
 
void(* zwapi_set_virtual_node_to_learn_mode_callback )(uint8_t bStatus, zwave_node_id_t orgID, zwave_node_id_t newID)
 
void(* zwapi_request_neighbor_update_callback )(uint8_t bStatus)
 
void(* zwapi_set_suc_node_id_callback )(uint8_t bStatus)
 
void(* zwapi_request_network_update_callback )(uint8_t txStatus)
 
void(* zwapi_remove_failed_node_callback )(uint8_t txStatus)
 
void(* zwapi_replace_failed_node_callback )(uint8_t txStatus)
 

Macro Definition Documentation

◆ LOG_TAG

#define LOG_TAG   "zwapi_protocol_rx_dispatch"

Function Documentation

◆ fill_default_tx_report_values()

static void fill_default_tx_report_values ( zwapi_tx_report_t tx_report)
static

Fills default values in the Tx Report in case it is too short or incomplete coming from the Z-Wave API.

Parameters
tx_report[out] Pointer to the struct where the default values are written.
Here is the caller graph for this function:

◆ zwapi_frame_to_string()

static const char * zwapi_frame_to_string ( const uint8_t *  buffer,
uint16_t  buffer_length 
)
static
Here is the caller graph for this function:

◆ zwave_api_detect_buffer_overflow()

static bool zwave_api_detect_buffer_overflow ( uint16_t  len)
static
Here is the caller graph for this function:

◆ zwave_api_protocol_init_callbacks()

void zwave_api_protocol_init_callbacks ( void  )

Initialize functions pointers for Z-Wave module callbacks.

These callbacks are handlers for incoming REQ frames from the Z-Wave module

Here is the caller graph for this function:

◆ zwave_api_protocol_rx_dispatch()

void zwave_api_protocol_rx_dispatch ( uint8_t *  pData,
uint16_t  len 
)

Execute a callback based on a received frame from the Z-Wave module.

Parameters
pDataPointer to data frame (without SOF)
lenLength of data frame
Note
Must only be called locally in the Z-Wave API module.

FIXME: We should really not treat those functions as a bulk and assume they return the same payload.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ learnNodeInfo

LEARN_INFO learnNodeInfo
static

◆ zwapi_add_node_to_network_callback

void(* zwapi_add_node_to_network_callback) (struct LEARN_INFO *) ( struct LEARN_INFO )

◆ zwapi_assign_return_route_callback

void(* zwapi_assign_return_route_callback) (uint8_t bStatus) ( uint8_t  bStatus)

◆ zwapi_assign_suc_return_route_callback

void(* zwapi_assign_suc_return_route_callback) (uint8_t bStatus) ( uint8_t  bStatus)

◆ zwapi_command_buffer

uint8_t zwapi_command_buffer[REQUEST_BUFFER_SIZE]
static

◆ zwapi_create_new_primarly_ctrl_callback

void(* zwapi_create_new_primarly_ctrl_callback) (struct LEARN_INFO *) ( struct LEARN_INFO )

◆ zwapi_delete_return_route_callback

void(* zwapi_delete_return_route_callback) (uint8_t bStatus) ( uint8_t  bStatus)

◆ zwapi_delete_suc_return_route_callback

void(* zwapi_delete_suc_return_route_callback) (uint8_t bStatus) ( uint8_t  bStatus)

◆ zwapi_memory_put_buffer_callback

void(* zwapi_memory_put_buffer_callback) (void) ( void  )

◆ zwapi_remove_failed_node_callback

void(* zwapi_remove_failed_node_callback) (uint8_t txStatus) ( uint8_t  txStatus)

◆ zwapi_remove_node_from_network_callback

void(* zwapi_remove_node_from_network_callback) (struct LEARN_INFO *) ( struct LEARN_INFO )

◆ zwapi_replace_failed_node_callback

void(* zwapi_replace_failed_node_callback) (uint8_t txStatus) ( uint8_t  txStatus)

◆ zwapi_request_neighbor_update_callback

void(* zwapi_request_neighbor_update_callback) (uint8_t bStatus) ( uint8_t  bStatus)

◆ zwapi_request_network_update_callback

void(* zwapi_request_network_update_callback) (uint8_t txStatus) ( uint8_t  txStatus)

◆ zwapi_send_controller_replication_callback

void(* zwapi_send_controller_replication_callback) (uint8_t txStatus) ( uint8_t  txStatus)

◆ zwapi_send_data_bridge_callback

void(* zwapi_send_data_bridge_callback) (uint8_t, zwapi_tx_report_t *) ( uint8_t  ,
zwapi_tx_report_t  
)

◆ zwapi_send_data_callback

void(* zwapi_send_data_callback) (uint8_t, zwapi_tx_report_t *) ( uint8_t  ,
zwapi_tx_report_t  
)

Serial API response frame callbacks

◆ zwapi_send_data_multi_bridge_callback

void(* zwapi_send_data_multi_bridge_callback) (uint8_t) ( uint8_t  )

◆ zwapi_send_data_multi_callback

void(* zwapi_send_data_multi_callback) (uint8_t) ( uint8_t  )

◆ zwapi_send_node_information_callback

void(* zwapi_send_node_information_callback) (uint8_t txStatus) ( uint8_t  txStatus)

◆ zwapi_send_nop_callback

void(* zwapi_send_nop_callback) (uint8_t, zwapi_tx_report_t *) ( uint8_t  ,
zwapi_tx_report_t  
)

◆ zwapi_send_test_frame_callback

void(* zwapi_send_test_frame_callback) (uint8_t) ( uint8_t  )

◆ zwapi_set_default_callback

void(* zwapi_set_default_callback) (void) ( void  )

◆ zwapi_set_learn_mode_callback

void(* zwapi_set_learn_mode_callback) (struct LEARN_INFO *) ( struct LEARN_INFO )

◆ zwapi_set_suc_node_id_callback

void(* zwapi_set_suc_node_id_callback) (uint8_t bStatus) ( uint8_t  bStatus)

◆ zwapi_set_virtual_node_to_learn_mode_callback

void(* zwapi_set_virtual_node_to_learn_mode_callback) (uint8_t bStatus, zwave_node_id_t orgID, zwave_node_id_t newID) ( uint8_t  bStatus,
zwave_node_id_t  orgID,
zwave_node_id_t  newID 
)

◆ zwapi_transfer_primary_ctrl_role_callback

void(* zwapi_transfer_primary_ctrl_role_callback) (struct LEARN_INFO *) ( struct LEARN_INFO )