14#ifndef USER_CREDENTIAL_HELPERS_H
15#define USER_CREDENTIAL_HELPERS_H
23#include "attribute.hpp"
57template<
typename T> attribute_store::attribute
59 attribute_store_type_t attribute_type,
62 auto node = base_node.child_by_type_and_value(attribute_type,
65 if (!node.is_valid()) {
66 node = base_node.emplace_node(attribute_type, value);
68 node.set_reported(value);
88 attribute_store_type_t operation_type_node_type,
112 attribute_store_node_t slot_node,
124 attribute_store_node_t slot_node,
149attribute_store::attribute
152 attribute_store_node_value_state_t
state);
165attribute_store::attribute
168 attribute_store_node_value_state_t
state);
181attribute_store::attribute
184 attribute_store_node_value_state_t
state);
193 attribute_store::attribute user_id_node,
235 attribute_store_node_value_state_t
state;
250 const attribute_store::attribute &endpoint_node,
277 attribute_store_node_value_state_t
state);
uint16_t user_credential_user_unique_id_t
User Unique ID. uint16_t
Definition: zwave_command_class_user_credential_types.h:37
uint16_t user_credential_slot_t
Credential slot. uint16_t
Definition: zwave_command_class_user_credential_types.h:67
uint8_t user_credential_type_t
Credential type. uint8_t
Definition: zwave_command_class_user_credential_types.h:61
uint8_t user_credential_operation_type_t
Definition: zwave_command_class_user_credential_types.h:73
Definition: user_credential_helpers.hpp:27
bool is_admin_code_empty(const std::vector< uint8_t > &admin_pin_code)
Return true if given admin pin code is considered empty.
std::function< void(attribute_store::attribute &)> attribute_callback
Definition: user_credential_helpers.hpp:29
void set_operation_type(attribute_store::attribute base_node, attribute_store_type_t operation_type_node_type, user_credential_operation_type_t operation_type)
Create operation_type_node_type if it doesn't exists, and set the desired value to operation_type (an...
bool user_exists(attribute_store::attribute endpoint_node, user_credential_user_unique_id_t user_id)
Get node associated with user ID (desired or reported)
void for_each_credential_type_nodes_for_user(attribute_store::attribute user_id_node, const attribute_callback &callback, user_credential_type_t credential_type=0)
Iterate on each credential type nodes for a given user.
void set_empty_admin_code(attribute_store::attribute &admin_pin_code_node, attribute_store_node_value_state_t state)
Set the admin pin code node to an empty value.
void set_credential_operation_type(attribute_store_node_t slot_node, user_credential_operation_type_t operation_type)
Set Credential Operation.
credential_id_nodes get_credential_identifier_nodes(attribute_store_node_t child_node)
Get associated credential identifier nodes.
void set_credential_learn_operation_type(attribute_store_node_t slot_node, user_credential_operation_type_t operation_type)
Set Credential Learn Operation.
attribute_store::attribute get_user_unique_id_node(attribute_store::attribute endpoint_node, user_credential_user_unique_id_t user_id, attribute_store_node_value_state_t state)
Get node associated with user ID (desired or reported)
void for_each_credential_type_nodes(attribute_store::attribute endpoint_node, const attribute_callback &callback, user_credential_type_t credential_type=0)
Iterate on each credential type nodes.
void set_user_operation_type(attribute_store_node_t user_node, user_credential_operation_type_t operation_type)
Set User Operation.
bool is_credential_available(attribute_store_node_t endpoint_node, user_credential_type_t credential_type, user_credential_slot_t credential_slot)
Checks if given credential ID (credential type, credential slot) is available.
attribute_store::attribute get_credential_slot_node(attribute_store::attribute cred_type_node, user_credential_slot_t cred_slot, attribute_store_node_value_state_t state)
Get credential slot node associated with credential type.
attribute_store::attribute get_credential_type_node(attribute_store::attribute user_id_node, user_credential_type_t cred_type, attribute_store_node_value_state_t state)
Get credential type node associated with user ID.
attribute_store::attribute create_or_update_desired_value(attribute_store::attribute base_node, attribute_store_type_t attribute_type, T value)
Update desired value if found, or create the node otherwise.
Definition: user_credential_helpers.hpp:58
Definition: user_credential_helpers.hpp:36
attribute_store::attribute type_node
Definition: user_credential_helpers.hpp:38
attribute_store::attribute slot_node
Definition: user_credential_helpers.hpp:37
attribute_store::attribute user_unique_id_node
Definition: user_credential_helpers.hpp:39
Definition: user_credential_helpers.hpp:233
T value
Definition: user_credential_helpers.hpp:234
attribute_store_node_value_state_t state
Definition: user_credential_helpers.hpp:235
static send_data_state_t state
Definition: zwave_crc16_transport.c:52
static void callback(uint8_t status, const zwapi_tx_report_t *tx_info, void *user)
Z-Wave Tx Send data callback function.
Definition: zwave_s0_transport.c:601