|
Z-Wave Protocol Controller Reference
|
#include "zwave_command_class_user_code.h"#include "zwave_command_classes_utils.h"#include "ZW_classcmd.h"#include "attribute_store_defined_attribute_types.h"#include "zwave_command_class_indices.h"#include "zwave_command_handler.h"#include "zwave_controller_connection_info.h"#include "zwave_controller_utils.h"#include "zpc_attribute_store_network_helper.h"#include "zpc_attribute_resolver.h"#include "attribute_store.h"#include "attribute_store_helper.h"#include "attribute_resolver.h"#include <string.h>#include "sl_log.h"Macros | |
| #define | LOG_TAG "zwave_command_class_user_code" |
| #define | ATTRIBUTE(type) ATTRIBUTE_COMMAND_CLASS_USER_CODE_##type |
| #define | KEY_BITMASK_SIZE 16 |
Functions | |
| static attribute_store_node_t | get_user_code_data_node (const zwave_controller_connection_info_t *info) |
| static attribute_store_node_t | get_user_code_capabilities_node (attribute_store_node_t endpoint_node) |
| static attribute_store_node_t | get_user_id_node (attribute_store_node_t data_node, uint16_t user_id) |
| static void | set_user_code_to_available (attribute_store_node_t user_id_node) |
| Checks if the user_id_node type is correct and sets the user code data to Available underneath. More... | |
| static void | set_user_code_range_to_available (attribute_store_node_t data_node, uint16_t first_id, uint16_t last_id) |
| Sets all users Id in the Range [first_id..last_id[ to available (user code not set) More... | |
| static void | set_all_user_codes_to_available (attribute_store_node_t node) |
| Navigates up the tree from a node and makes sure that all user codes are set to "disabled" with no pin code. More... | |
| static void | undefine_user_code (attribute_store_node_t user_id_node) |
| Checks if the User ID node matches what we expect and undefines the User Code data underneath. More... | |
| static void | undefine_all_user_codes (attribute_store_node_t endpoint_node) |
| Navigates under the endpoint node and undefines all the known user code data. More... | |
| static void | set_default_v1_capabilities (attribute_store_node_t node) |
| Sets all the default capabilities for version 1 supporting nodes. More... | |
| static bool | is_pin_code_supported (attribute_store_node_t endpoint_node, const char *pin_code) |
| Checks the nodes capabilities and verifies if a character is supported for setting in a PIN code. More... | |
| static bool | is_mucr_supported (attribute_store_node_t endpoint_node) |
| Checks the nodes capabilities and verifies if it supports MUCR (Multiple User Code Reports) More... | |
| static sl_status_t | zwave_command_class_user_code_number_get (attribute_store_node_t node, uint8_t *frame, uint16_t *frame_length) |
| Generates a Users Number Get Command. More... | |
| static sl_status_t | zwave_command_class_user_code_get (attribute_store_node_t node, uint8_t *frame, uint16_t *frame_length) |
| Generates a (opt. Extended) User Code Get Command. More... | |
| static sl_status_t | zwave_command_class_user_code_capabilities_get (attribute_store_node_t node, uint8_t *frame, uint16_t *frame_length) |
| Generates a (opt. Extended) User Code Get Command. More... | |
| static sl_status_t | zwave_command_class_user_code_checksum_get (attribute_store_node_t node, uint8_t *frame, uint16_t *frame_length) |
| Generates a User Code Checksum Get Command. More... | |
| static sl_status_t | zwave_command_class_user_code_admin_code_get (attribute_store_node_t node, uint8_t *frame, uint16_t *frame_length) |
| Generates an Admin Code Get Command. More... | |
| static sl_status_t | zwave_command_class_user_code_keypad_mode_get (attribute_store_node_t node, uint8_t *frame, uint16_t *frame_length) |
| Generates a Keypad Mode Get Command. More... | |
| static sl_status_t | zwave_command_class_user_code_keypad_mode_set (attribute_store_node_t node, uint8_t *frame, uint16_t *frame_length) |
| Generates a Keypad Mode Set Command. More... | |
| static sl_status_t | zwave_command_class_user_code_set (attribute_store_node_t node, uint8_t *frame, uint16_t *frame_length) |
| Generates a (opt. Extended) User Code Set Command. More... | |
| static sl_status_t | zwave_command_class_user_code_admin_code_set (attribute_store_node_t node, uint8_t *frame, uint16_t *frame_length) |
| Generates a Admin Code Set Command. More... | |
| static sl_status_t | zwave_command_class_user_code_delete_all (attribute_store_node_t node, uint8_t *frame, uint16_t *frame_length) |
| Generates a User Code Set or Extended User Code Set that will delete all User Codes. More... | |
| static void | zwave_command_class_user_code_on_version_attribute_update (attribute_store_node_t updated_node, attribute_store_change_t change) |
| static void | zwave_command_class_user_code_on_number_of_users_update (attribute_store_node_t updated_node, attribute_store_change_t change) |
| static void | zwave_command_class_user_code_on_user_id_created (attribute_store_node_t node, attribute_store_change_t change) |
| static void | zwave_command_class_user_code_on_capabilities_created (attribute_store_node_t node, attribute_store_change_t change) |
| static void | on_delete_all_send_data_complete (attribute_store_node_t node, resolver_rule_type_t rule_type, zpc_resolver_event_t event) |
| Handles the Send Data Complete for a "delete all user codes". More... | |
| static sl_status_t | handle_users_number_report (const zwave_controller_connection_info_t *info, const uint8_t *frame, uint16_t frame_length) |
| Process an incoming User Number Report Command. More... | |
| static sl_status_t | handle_users_code_checksum_report (const zwave_controller_connection_info_t *info, const uint8_t *frame, uint16_t frame_length) |
| Process an incoming User Code Checksum Report Command. More... | |
| static sl_status_t | handle_user_code_report (const zwave_controller_connection_info_t *info, const uint8_t *frame, uint16_t frame_length) |
| Process an incoming User Code Report Command. More... | |
| static sl_status_t | handle_admin_code_report (const zwave_controller_connection_info_t *info, const uint8_t *frame, uint16_t frame_length) |
| Process an incoming Admin Code Report Command. More... | |
| static sl_status_t | handle_extended_user_code_report (const zwave_controller_connection_info_t *info, const uint8_t *frame, uint16_t frame_length) |
| Process an incoming Extended User Code Report Command. More... | |
| static sl_status_t | handle_user_code_capabilities_report (const zwave_controller_connection_info_t *info, const uint8_t *frame, uint16_t frame_length) |
| Process an incoming User Code Capabilities Report Command. More... | |
| static sl_status_t | handle_keypad_mode_report (const zwave_controller_connection_info_t *info, const uint8_t *frame, uint16_t frame_length) |
| Process an incoming Keypad Mode Report Command. More... | |
| static sl_status_t | zwave_command_class_user_code_control_handler (const zwave_controller_connection_info_t *info, const uint8_t *frame, uint16_t frame_length) |
| Dispatches incoming User Code Commands to individual command handlers. More... | |
| sl_status_t | zwave_command_class_user_code_init () |
| Initializes the User Code Command Class handler. More... | |
Variables | |
| static const attribute_store_type_t | default_attributes [] |
| static const attribute_store_type_t | v2_attributes [] = {ATTRIBUTE(KEYPAD_MODE)} |
| static const attribute_store_type_t | user_id_attributes [] = {ATTRIBUTE(CODE), ATTRIBUTE(USER_ID_STATUS)} |
| static const attribute_store_type_t | capabilities_attributes [] |
| static const uint8_t | V1_SUPPORTED_KEYS [KEY_BITMASK_SIZE] |
| #define ATTRIBUTE | ( | type | ) | ATTRIBUTE_COMMAND_CLASS_USER_CODE_##type |
| #define KEY_BITMASK_SIZE 16 |
| #define LOG_TAG "zwave_command_class_user_code" |
|
static |
|
static |
|
static |
|
static |
Process an incoming Admin Code Report Command.
| info | zwave_controller_connection_info_t object. |
| frame | Pointer to frame data |
| frame_length | Number of bytes contained in the frame |
|
static |
Process an incoming Extended User Code Report Command.
| info | zwave_controller_connection_info_t object. |
| frame | Pointer to frame data |
| frame_length | Number of bytes contained in the frame |
|
static |
Process an incoming Keypad Mode Report Command.
| info | zwave_controller_connection_info_t object. |
| frame | Pointer to frame data |
| frame_length | Number of bytes contained in the frame |
|
static |
Process an incoming User Code Capabilities Report Command.
| info | zwave_controller_connection_info_t object. |
| frame | Pointer to frame data |
| frame_length | Number of bytes contained in the frame |
|
static |
Process an incoming User Code Report Command.
| info | zwave_controller_connection_info_t object. |
| frame | Pointer to frame data |
| frame_length | Number of bytes contained in the frame |
|
static |
Process an incoming User Code Checksum Report Command.
| info | zwave_controller_connection_info_t object. |
| frame | Pointer to frame data |
| frame_length | Number of bytes contained in the frame |
|
static |
Process an incoming User Number Report Command.
| info | zwave_controller_connection_info_t object. |
| frame | Pointer to frame data |
| frame_length | Number of bytes contained in the frame |
|
static |
Checks the nodes capabilities and verifies if it supports MUCR (Multiple User Code Reports)
| endpoint_node | Attribute Store node for the Endpoint |
|
static |
Checks the nodes capabilities and verifies if a character is supported for setting in a PIN code.
NOTE: This function assumes to receive a NULL terminated PIN Code.
| endpoint_node | Attribute Store node for the Endpoint |
| pin_code | PIN Code to check all chars |
|
static |
Handles the Send Data Complete for a "delete all user codes".
The resolver alone does not support this case, because the attribute being resolved and the attributes affected are located in different places.
This function manually traverses the tree and adjust the value of User ID statuses / User Codes based on the outcome of the Delete All Command
| node | Attribute Store node that was resolved |
| rule_type | Type of rule that was applied to the node |
| event | Resolution outcome/event |
|
static |
Navigates up the tree from a node and makes sure that all user codes are set to "disabled" with no pin code.
| node | Attribute Store node located under the ATTRIBUTE(DATA) |
|
static |
Sets all the default capabilities for version 1 supporting nodes.
| node | Attribute Store ATTRIBUTE(CAPABILITIES) node |
|
static |
Sets all users Id in the Range [first_id..last_id[ to available (user code not set)
| user_id_node | Attribute Store node for the User ID. |
|
static |
Checks if the user_id_node type is correct and sets the user code data to Available underneath.
| user_id_node | Attribute Store node for the User ID. |
|
static |
Navigates under the endpoint node and undefines all the known user code data.
| node | Attribute Store node for the Endpoint. |
|
static |
Checks if the User ID node matches what we expect and undefines the User Code data underneath.
| user_id_node | Attribute Store node for the User ID. |
|
static |
Generates an Admin Code Get Command.
| node | Attribute Store node that the resolver tries to resolve. |
| frame | Pointer at which frame data can be written. |
| frame_length | Pointer at which the frame data length can be written. |
|
static |
Generates a Admin Code Set Command.
| node | Attribute Store node that the resolver tries to resolve. |
| frame | Pointer at which frame data can be written. |
| frame_length | Pointer at which the frame data length can be written. |
|
static |
Generates a (opt. Extended) User Code Get Command.
| node | Attribute Store node that the resolver tries to resolve. |
| frame | Pointer at which frame data can be written. |
| frame_length | Pointer at which the frame data length can be written. |
|
static |
Generates a User Code Checksum Get Command.
| node | Attribute Store node that the resolver tries to resolve. |
| frame | Pointer at which frame data can be written. |
| frame_length | Pointer at which the frame data length can be written. |
|
static |
Dispatches incoming User Code Commands to individual command handlers.
| info | zwave_controller_connection_info_t object. |
| frame | Pointer to frame data |
| frame_length | Number of bytes contained in the frame |
|
static |
Generates a User Code Set or Extended User Code Set that will delete all User Codes.
| node | Attribute Store node that the resolver tries to resolve. |
| frame | Pointer at which frame data can be written. |
| frame_length | Pointer at which the frame data length can be written. |
|
static |
Generates a (opt. Extended) User Code Get Command.
| node | Attribute Store node that the resolver tries to resolve. |
| frame | Pointer at which frame data can be written. |
| frame_length | Pointer at which the frame data length can be written. |
|
static |
Generates a Keypad Mode Get Command.
| node | Attribute Store node that the resolver tries to resolve. |
| frame | Pointer at which frame data can be written. |
| frame_length | Pointer at which the frame data length can be written. |
|
static |
Generates a Keypad Mode Set Command.
| node | Attribute Store node that the resolver tries to resolve. |
| frame | Pointer at which frame data can be written. |
| frame_length | Pointer at which the frame data length can be written. |
|
static |
Generates a Users Number Get Command.
| node | Attribute Store node that the resolver tries to resolve. |
| frame | Pointer at which frame data can be written. |
| frame_length | Pointer at which the frame data length can be written. |
|
static |
|
static |
|
static |
|
static |
|
static |
Generates a (opt. Extended) User Code Set Command.
| node | Attribute Store node that the resolver tries to resolve. |
| frame | Pointer at which frame data can be written. |
| frame_length | Pointer at which the frame data length can be written. |
|
static |
|
static |
|
static |
|
static |
|
static |