Z-Wave Protocol Controller Reference
zwave_command_class_user_credential_api.h File Reference
#include "sl_status.h"
#include "zwave_command_class_user_credential_types.h"
#include "attribute_store.h"
Include dependency graph for zwave_command_class_user_credential_api.h:

Go to the source code of this file.

Functions

sl_status_t zwave_command_class_user_credential_add_new_user (attribute_store_node_t endpoint_node, user_credential_user_unique_id_t user_id, user_credential_type_t user_type, user_credential_rule_t credential_rule, user_credential_user_active_state_t user_active_state, user_credential_expiring_timeout_minutes_t expiring_timeout, user_credential_user_name_encoding_t user_name_encoding, const char *user_name)
 Send a new user command (User SET) to the end device. More...
 
sl_status_t zwave_command_class_user_credential_modify_user (attribute_store_node_t endpoint_node, user_credential_user_unique_id_t user_id, user_credential_type_t user_type, user_credential_rule_t credential_rule, user_credential_user_active_state_t user_active_state, user_credential_expiring_timeout_minutes_t expiring_timeout, user_credential_user_name_encoding_t user_name_encoding, const char *user_name)
 Send a modify user command (User SET) to the end device. More...
 
sl_status_t zwave_command_class_user_credential_delete_user (attribute_store_node_t endpoint_node, user_credential_user_unique_id_t user_id)
 Send a delete user command (User SET) to the end device. More...
 
sl_status_t zwave_command_class_user_credential_add_new_credential (attribute_store_node_t endpoint_node, user_credential_user_unique_id_t user_id, user_credential_type_t credential_type, user_credential_slot_t credential_slot, const char *credential_data)
 Send a new credential command (Credential SET) to the end device. More...
 
sl_status_t zwave_command_class_user_credential_modify_credential (attribute_store_node_t endpoint_node, user_credential_user_unique_id_t user_id, user_credential_type_t credential_type, user_credential_slot_t credential_slot, const char *credential_data)
 Send a modify credential command (Credential SET) to the end device. More...
 
sl_status_t zwave_command_class_user_credential_delete_credential (attribute_store_node_t endpoint_node, user_credential_user_unique_id_t user_id, user_credential_type_t credential_type, user_credential_slot_t credential_slot)
 Send a delete credential command (Credential SET) to the end device. More...
 
sl_status_t zwave_command_class_user_credential_delete_all_users (attribute_store_node_t endpoint_node)
 Send a delete all users command (User SET) to the end device. More...
 
sl_status_t zwave_command_class_user_credential_delete_all_credentials (attribute_store_node_t endpoint_node)
 Send a delete all credentials command (Credential SET) to the end device. More...
 
sl_status_t zwave_command_class_user_credential_delete_all_credentials_by_type (attribute_store_node_t endpoint_node, user_credential_type_t credential_type)
 Send a delete all credentials by type command (Credential SET) to the end device. More...
 
sl_status_t zwave_command_class_user_credential_delete_all_credentials_for_user (attribute_store_node_t endpoint_node, user_credential_user_unique_id_t user_id)
 Send a delete all credentials for user command (Credential SET) to the end device. More...
 
sl_status_t zwave_command_class_user_credential_delete_all_credentials_for_user_by_type (attribute_store_node_t endpoint_node, user_credential_user_unique_id_t user_id, user_credential_type_t credential_type)
 Send a delete all credentials for user by type command (Credential SET) to the end device. More...
 
sl_status_t zwave_command_class_user_credential_credential_learn_start_add (attribute_store_node_t endpoint_node, user_credential_user_unique_id_t user_id, user_credential_type_t credential_type, user_credential_slot_t credential_slot, user_credential_learn_timeout_t credential_learn_timeout)
 Send new credential command (Credential Learn Start) with operation type Add to the end device. More...
 
sl_status_t zwave_command_class_user_credential_credential_learn_start_modify (attribute_store_node_t endpoint_node, user_credential_user_unique_id_t user_id, user_credential_type_t credential_type, user_credential_slot_t credential_slot, user_credential_learn_timeout_t credential_learn_timeout)
 Send new credential command (Credential Learn Start) with operation type Modify to the end device. More...
 
sl_status_t zwave_command_class_user_credential_credential_learn_stop (attribute_store_node_t endpoint_node)
 Send new credential command (Credential Learn Stop) to the end device. More...
 
sl_status_t zwave_command_class_user_credential_uuic_association_set (attribute_store_node_t endpoint_node, user_credential_type_t credential_type, user_credential_user_unique_id_t source_user_id, user_credential_slot_t source_credential_slot, user_credential_user_unique_id_t destination_user_id, user_credential_slot_t destination_credential_slot)
 Send a User Unique Identifier Credential Association Set to the end device. More...
 
sl_status_t zwave_command_class_user_credential_get_user_checksum (attribute_store_node_t endpoint_node, user_credential_user_unique_id_t user_id)
 Send a User Checksum Get command to the end device. More...
 
sl_status_t zwave_command_class_user_credential_get_credential_checksum (attribute_store_node_t endpoint_node, user_credential_type_t credential_type)
 Send a Credential Checksum Get command to the end device. More...
 
sl_status_t zwave_command_class_user_credential_get_all_users_checksum (attribute_store_node_t endpoint_node)
 Send a All Users Checksum Get command to the end device. More...
 
sl_status_t zwave_command_class_user_credential_set_admin_pin_code (attribute_store_node_t endpoint_node, const char *credential_data)
 Send a Set Admin Pin Code command to the end device. More...
 
bool zwave_command_class_user_credential_supports_admin_pin_code_deactivation (attribute_store_node_t endpoint_node)
 Return true if the User Credential Command Class supports the Admin Pin Code Deactivation command. More...
 
bool zwave_command_class_user_credential_supports (attribute_store_node_t endpoint_node, uint8_t command_id)
 Test if given command id is supported by the User Credential Command Class. More...
 

Function Documentation

◆ zwave_command_class_user_credential_add_new_credential()

sl_status_t zwave_command_class_user_credential_add_new_credential ( attribute_store_node_t  endpoint_node,
user_credential_user_unique_id_t  user_id,
user_credential_type_t  credential_type,
user_credential_slot_t  credential_slot,
const char *  credential_data 
)

Send a new credential command (Credential SET) to the end device.

The credential data expected is an UTF-8 string. Some check/conversion will be performed based on the credential type.

  • PINCode : Refuse any values that is not between '0' and '9'.
  • Password : Will be stored in UTF-16 format. The exposed value still be in UTF-8, but the end device will receive UTF-16 data.
  • Others : Will be stored as is.
Parameters
endpoint_nodeThe attribute store node of the endpoint where the user credential is located.
user_idThe unique ID of the user. Should exists. Cannot be 0.
credential_typeThe type of the credential. Can exist or not. Cannot be 0.
credential_slotThe slot of the credential. Should not exists. Cannot be 0.
credential_dataRaw data of the credential. Checks are performed based on the credential type.
Returns
sl_status_t SL_STATUS_OK if the attribute store was updated successfully
sl_status_t SL_STATUS_FAIL if the user_id doesn't exists or the credential_slot already exists or one of the value is 0. Also if the credential data is invalid.

◆ zwave_command_class_user_credential_add_new_user()

sl_status_t zwave_command_class_user_credential_add_new_user ( attribute_store_node_t  endpoint_node,
user_credential_user_unique_id_t  user_id,
user_credential_type_t  user_type,
user_credential_rule_t  credential_rule,
user_credential_user_active_state_t  user_active_state,
user_credential_expiring_timeout_minutes_t  expiring_timeout,
user_credential_user_name_encoding_t  user_name_encoding,
const char *  user_name 
)

Send a new user command (User SET) to the end device.

Parameters
endpoint_nodeThe attribute store node of the endpoint where the user credential is located.
user_idThe unique ID of the user. Should NOT exists and NOT be 0
user_typeThe type of the user credential.
credential_ruleThe rule associated with the user credential.
user_active_stateThe active state of the user.
expiring_timeoutThe timeout for the user credential to expire, in minutes. Will be ignored unless user_type == 0x07.
user_name_encodingThe encoding format of the user name.
user_nameThe name of the user.
Returns
sl_status_t SL_STATUS_OK if the attribute store was updated successfully
sl_status_t SL_STATUS_FAIL if the user_id already exists or is 0.

◆ zwave_command_class_user_credential_credential_learn_start_add()

sl_status_t zwave_command_class_user_credential_credential_learn_start_add ( attribute_store_node_t  endpoint_node,
user_credential_user_unique_id_t  user_id,
user_credential_type_t  credential_type,
user_credential_slot_t  credential_slot,
user_credential_learn_timeout_t  credential_learn_timeout 
)

Send new credential command (Credential Learn Start) with operation type Add to the end device.

Note
The credential type must be supporting the Credential Learn feature.
Parameters
endpoint_nodeThe attribute store node of the endpoint where the user credential is located.
user_idThe unique ID of the user. Should exists. Cannot be 0.
credential_typeThe type of the credential. Can exist or not. Cannot be 0.
credential_slotThe slot of the credential. Should not exists. Cannot be 0.
credential_learn_timeoutTimeout for each credential learn step on the node, in seconds. Can be set to 0 to use recommended timeout by the end device.
Returns
sl_status_t SL_STATUS_OK if the attribute store was updated successfully
sl_status_t SL_STATUS_FAIL if the user_id doesn't exists or the credential_slot already exists or one of the value is 0. Also if the credential type doesn't support the learn mode.

◆ zwave_command_class_user_credential_credential_learn_start_modify()

sl_status_t zwave_command_class_user_credential_credential_learn_start_modify ( attribute_store_node_t  endpoint_node,
user_credential_user_unique_id_t  user_id,
user_credential_type_t  credential_type,
user_credential_slot_t  credential_slot,
user_credential_learn_timeout_t  credential_learn_timeout 
)

Send new credential command (Credential Learn Start) with operation type Modify to the end device.

Note
The credential type must be supporting the Credential Learn feature.
Parameters
endpoint_nodeThe attribute store node of the endpoint where the user credential is located.
user_idThe unique ID of the user. Should exists. Cannot be 0.
credential_typeThe type of the credential. Should exists. Cannot be 0.
credential_slotThe slot of the credential. Should exists. Cannot be 0.
credential_learn_timeoutTimeout for each credential learn step on the node, in seconds. Can be set to 0 to use recommended timeout by the end device.
Returns
sl_status_t SL_STATUS_OK if the attribute store was updated successfully
sl_status_t SL_STATUS_FAIL if the user_id doesn't exists or the credential_slot/credential type is 0 or does not exists. Also if the credential type doesn't support the learn mode.

◆ zwave_command_class_user_credential_credential_learn_stop()

sl_status_t zwave_command_class_user_credential_credential_learn_stop ( attribute_store_node_t  endpoint_node)

Send new credential command (Credential Learn Stop) to the end device.

Parameters
endpoint_nodeThe attribute store node of the endpoint where the user credential is located.
Returns
sl_status_t SL_STATUS_OK if the attribute store was updated successfully
sl_status_t SL_STATUS_FAIL otherwise

◆ zwave_command_class_user_credential_delete_all_credentials()

sl_status_t zwave_command_class_user_credential_delete_all_credentials ( attribute_store_node_t  endpoint_node)

Send a delete all credentials command (Credential SET) to the end device.

It will send an Credential SET command with user_id, credential_type and credential_slot = 0 and operation type delete to remove all credentials.

Parameters
endpoint_nodeThe attribute store node of the endpoint where the user credential is located.
Returns
sl_status_t SL_STATUS_OK if the attribute store was updated successfully
sl_status_t SL_STATUS_FAIL otherwise

◆ zwave_command_class_user_credential_delete_all_credentials_by_type()

sl_status_t zwave_command_class_user_credential_delete_all_credentials_by_type ( attribute_store_node_t  endpoint_node,
user_credential_type_t  credential_type 
)

Send a delete all credentials by type command (Credential SET) to the end device.

It will send an Credential SET command with user_id = 0 and operation type delete to remove all credentials of the specified type.

Parameters
endpoint_nodeThe attribute store node of the endpoint where the user credential is located.
credential_typeThe type of the credential. Should exists. Cannot be 0.
Returns
sl_status_t SL_STATUS_OK if the attribute store was updated successfully
sl_status_t SL_STATUS_FAIL otherwise

◆ zwave_command_class_user_credential_delete_all_credentials_for_user()

sl_status_t zwave_command_class_user_credential_delete_all_credentials_for_user ( attribute_store_node_t  endpoint_node,
user_credential_user_unique_id_t  user_id 
)

Send a delete all credentials for user command (Credential SET) to the end device.

It will send an Credential SET command with credential_type and credential_slot = 0 and operation type delete to remove all credentials of the specified user.

Parameters
endpoint_nodeThe attribute store node of the endpoint where the user credential is located.
user_idThe unique ID of the user. Should exists. Cannot be 0.
Returns
sl_status_t SL_STATUS_OK if the attribute store was updated successfully
sl_status_t SL_STATUS_FAIL otherwise
Note
This function will not remove the user itself.

◆ zwave_command_class_user_credential_delete_all_credentials_for_user_by_type()

sl_status_t zwave_command_class_user_credential_delete_all_credentials_for_user_by_type ( attribute_store_node_t  endpoint_node,
user_credential_user_unique_id_t  user_id,
user_credential_type_t  credential_type 
)

Send a delete all credentials for user by type command (Credential SET) to the end device.

It will send an Credential SET command with credential_slot = 0 and operation type delete to remove all credentials of the specified user and type.

Parameters
endpoint_nodeThe attribute store node of the endpoint where the user credential is located.
user_idThe unique ID of the user. Should exists. Cannot be 0.
credential_typeThe type of the credential. Should exists. Cannot be 0.
Returns
sl_status_t SL_STATUS_OK if the attribute store was updated successfully
sl_status_t SL_STATUS_FAIL otherwise
Note
This function will not remove the user itself.

◆ zwave_command_class_user_credential_delete_all_users()

sl_status_t zwave_command_class_user_credential_delete_all_users ( attribute_store_node_t  endpoint_node)

Send a delete all users command (User SET) to the end device.

It will send an User SET command with user id = 0 and operation type delete to remove all users. (CC:0083.01.05.11.009)

Parameters
endpoint_nodeThe attribute store node of the endpoint where the user credential is located.
Returns
sl_status_t SL_STATUS_OK if the attribute store was updated successfully
sl_status_t SL_STATUS_FAIL otherwise

◆ zwave_command_class_user_credential_delete_credential()

sl_status_t zwave_command_class_user_credential_delete_credential ( attribute_store_node_t  endpoint_node,
user_credential_user_unique_id_t  user_id,
user_credential_type_t  credential_type,
user_credential_slot_t  credential_slot 
)

Send a delete credential command (Credential SET) to the end device.

Parameters
endpoint_nodeThe attribute store node of the endpoint where the user credential is located.
user_idThe unique ID of the user. Should exists. Cannot be 0.
credential_typeThe type of the credential. Should exists. Cannot be 0.
credential_slotThe slot of the credential. Should exists. Cannot be 0.
Returns
sl_status_t SL_STATUS_OK if the attribute store was updated successfully
sl_status_t SL_STATUS_FAIL if the user_id, credential type or credential slot doesn't exists or one of the value is 0.

◆ zwave_command_class_user_credential_delete_user()

sl_status_t zwave_command_class_user_credential_delete_user ( attribute_store_node_t  endpoint_node,
user_credential_user_unique_id_t  user_id 
)

Send a delete user command (User SET) to the end device.

Parameters
endpoint_nodeThe attribute store node of the endpoint where the user credential is located.
user_idThe unique ID of the user. Should exists.
Returns
sl_status_t SL_STATUS_OK if the attribute store was updated successfully
sl_status_t SL_STATUS_FAIL if the user_id doesn't exists.

◆ zwave_command_class_user_credential_get_all_users_checksum()

sl_status_t zwave_command_class_user_credential_get_all_users_checksum ( attribute_store_node_t  endpoint_node)

Send a All Users Checksum Get command to the end device.

Parameters
endpoint_nodeThe attribute store node of the endpoint where the user credential is located.
Returns
sl_status_t SL_STATUS_OK if the attribute store was updated successfully
sl_status_t SL_STATUS_FAIL otherwise

◆ zwave_command_class_user_credential_get_credential_checksum()

sl_status_t zwave_command_class_user_credential_get_credential_checksum ( attribute_store_node_t  endpoint_node,
user_credential_type_t  credential_type 
)

Send a Credential Checksum Get command to the end device.

Parameters
endpoint_nodeThe attribute store node of the endpoint where the user credential is located.
credential_typeThe type of the credential. Cannot be 0
Returns
sl_status_t SL_STATUS_OK if the attribute store was updated successfully
sl_status_t SL_STATUS_FAIL if the credential_type is not supported or is 0.

◆ zwave_command_class_user_credential_get_user_checksum()

sl_status_t zwave_command_class_user_credential_get_user_checksum ( attribute_store_node_t  endpoint_node,
user_credential_user_unique_id_t  user_id 
)

Send a User Checksum Get command to the end device.

Parameters
endpoint_nodeThe attribute store node of the endpoint where the user credential is located.
user_idThe unique ID of the source user. Should exists. Cannot be 0.
Returns
sl_status_t SL_STATUS_OK if the attribute store was updated successfully
sl_status_t SL_STATUS_FAIL if the user_id doesn't exists or is 0.

◆ zwave_command_class_user_credential_modify_credential()

sl_status_t zwave_command_class_user_credential_modify_credential ( attribute_store_node_t  endpoint_node,
user_credential_user_unique_id_t  user_id,
user_credential_type_t  credential_type,
user_credential_slot_t  credential_slot,
const char *  credential_data 
)

Send a modify credential command (Credential SET) to the end device.

The credential data expected is an UTF-8 string. Some check/conversion will be performed based on the credential type.

  • PINCode : Refuse any values that is not between '0' and '9'.
  • Password : Will be stored in UTF-16 format. The exposed value still be in UTF-8, but the end device will receive UTF-16 data.
  • Others : Will be stored as is.
Parameters
endpoint_nodeThe attribute store node of the endpoint where the user credential is located.
user_idThe unique ID of the user. Should exists. Cannot be 0.
credential_typeThe type of the credential. Should exists. Cannot be 0.
credential_slotThe slot of the credential. Should exists. Cannot be 0.
credential_dataRaw data of the credential. Checks are performed based on the credential type.
Returns
sl_status_t SL_STATUS_OK if the attribute store was updated successfully
sl_status_t SL_STATUS_FAIL if the user_id, credential type or credential slot doesn't exists or one of the value is 0. Also if the credential data is invalid.

◆ zwave_command_class_user_credential_modify_user()

sl_status_t zwave_command_class_user_credential_modify_user ( attribute_store_node_t  endpoint_node,
user_credential_user_unique_id_t  user_id,
user_credential_type_t  user_type,
user_credential_rule_t  credential_rule,
user_credential_user_active_state_t  user_active_state,
user_credential_expiring_timeout_minutes_t  expiring_timeout,
user_credential_user_name_encoding_t  user_name_encoding,
const char *  user_name 
)

Send a modify user command (User SET) to the end device.

Parameters
endpoint_nodeThe attribute store node of the endpoint where the user credential is located.
user_idThe unique ID of the user. Should exists. Should NOT be 0.
user_typeThe type of the user credential.
credential_ruleThe rule associated with the user credential.
user_active_stateThe active state of the user.
expiring_timeoutThe timeout for the user credential to expire, in minutes. Will be ignored unless user_type == 0x07.
user_name_encodingThe encoding format of the user name.
user_nameThe name of the user.
Returns
sl_status_t SL_STATUS_OK if the attribute store was updated successfully
sl_status_t SL_STATUS_FAIL if the user_id doesn't exists or is 0.

◆ zwave_command_class_user_credential_set_admin_pin_code()

sl_status_t zwave_command_class_user_credential_set_admin_pin_code ( attribute_store_node_t  endpoint_node,
const char *  credential_data 
)

Send a Set Admin Pin Code command to the end device.

Parameters
endpoint_nodeThe attribute store node of the endpoint where the user credential is located.
credential_dataThe new admin pin code. Must contains only digits.
Returns
sl_status_t SL_STATUS_OK if the attribute store was updated successfully
sl_status_t SL_STATUS_FAIL if the credential_data is invalid.

◆ zwave_command_class_user_credential_supports()

bool zwave_command_class_user_credential_supports ( attribute_store_node_t  endpoint_node,
uint8_t  command_id 
)

Test if given command id is supported by the User Credential Command Class.

It will perform a check first to see if given node is supporting the User Credential Command Class. If not it will return false.

Parameters
endpoint_nodeThe attribute store node of the endpoint where the user credential is located.
command_idThe command id to test
Returns
true if the command is supported
false if the command is not supported

◆ zwave_command_class_user_credential_supports_admin_pin_code_deactivation()

bool zwave_command_class_user_credential_supports_admin_pin_code_deactivation ( attribute_store_node_t  endpoint_node)

Return true if the User Credential Command Class supports the Admin Pin Code Deactivation command.

Parameters
endpoint_nodeThe attribute store node of the endpoint where the user credential is located.
Returns
true if the command is supported
false if the command is not supported

◆ zwave_command_class_user_credential_uuic_association_set()

sl_status_t zwave_command_class_user_credential_uuic_association_set ( attribute_store_node_t  endpoint_node,
user_credential_type_t  credential_type,
user_credential_user_unique_id_t  source_user_id,
user_credential_slot_t  source_credential_slot,
user_credential_user_unique_id_t  destination_user_id,
user_credential_slot_t  destination_credential_slot 
)

Send a User Unique Identifier Credential Association Set to the end device.

Parameters
endpoint_nodeThe attribute store node of the endpoint where the user credential is located.
credential_typeThe type of the credential.
source_user_idThe unique ID of the source user. Should exists. Cannot be 0.
source_credential_slotThe slot of the source credential. Should exists. Cannot be 0.
destination_user_idThe unique ID of the destination user. Cannot be 0.
destination_credential_slotThe slot of the destination credential. Should not exists. Cannot be 0.
Returns
sl_status_t SL_STATUS_OK if the attribute store was updated successfully
sl_status_t SL_STATUS_FAIL if the user_id already exists or is 0.