Trident IoT Zigbee SDK
Loading...
Searching...
No Matches
tr_door_lock_server.h File Reference

ZCL Door Lock cluster server implementation. More...

#include "tr_af.h"
Include dependency graph for tr_door_lock_server.h:

Go to the source code of this file.

Macros

#define TR_DOOR_LOCK_SERVER_MAX_PIN_LEN   4
#define TR_DOOR_LOCK_SERVER_MAX_NUM_USERS   8
#define tr_door_lock_server_printf(...)
#define tr_door_lock_server_println(...)

Typedefs

struct { 
   tr_door_lock_user_status_t   status 
   tr_door_lock_user_type_t   type 
   zb_uint8_t   pin [TR_DOOR_LOCK_SERVER_MAX_PIN_LEN+1] 
tr_door_lock_server_user_t
struct { 
   zb_uint16_t   user_id 
   tr_door_lock_user_status_t   user_status 
   tr_door_lock_user_type_t   user_type 
   zb_uint8_t   pin [TR_DOOR_LOCK_SERVER_MAX_PIN_LEN+1] 
tr_door_lock_get_pin_resp_t
typedef tr_door_lock_set_user_status_cmd_t tr_door_lock_get_user_status_resp_t
typedef tr_door_lock_set_user_type_cmd_t tr_door_lock_get_user_type_resp_t

Functions

void tr_door_lock_server_init_cb (zb_uint8_t endpoint)
 Callback fires when the Door Lock server cluster plugin is initialized.
zb_bool_t tr_door_lock_server_command_received_cb (zb_zcl_parsed_hdr_t *cmd_info)
 Callback that user can declare to handle any Door Lock server commands.
void tr_door_lock_server_write_attr_cb (zb_uint8_t endpoint, zb_uint16_t attr_id, zb_uint8_t *new_value, zb_uint16_t manuf_code)
 Callback fires when an Door Lock server attribute is about to be written.
zb_bool_t tr_door_lock_server_lock_door_cb (zb_zcl_parsed_hdr_t *cmd_info, zb_uint8_t endpoint, tr_door_lock_event_source_t event_source, zb_uint8_t *pin)
 Callback that user can declare to handle door lock cluster lock door command.
zb_bool_t tr_door_lock_server_unlock_door_cb (zb_zcl_parsed_hdr_t *cmd_info, zb_uint8_t endpoint, tr_door_lock_event_source_t event_source, zb_uint8_t *pin)
 Callback that user can declare to handle door lock cluster unlock door command.
zb_bool_t tr_door_lock_server_set_pin_cb (zb_zcl_parsed_hdr_t *cmd_info, zb_uint8_t endpoint, zb_uint16_t user_id, tr_door_lock_user_status_t user_status, tr_door_lock_user_type_t user_type, zb_uint8_t *pin)
 Callback that user can declare to handle door lock cluster set pin command.
zb_bool_t tr_door_lock_server_get_pin_cb (zb_zcl_parsed_hdr_t *cmd_info, zb_uint8_t endpoint, zb_uint16_t user_id)
 Callback that user can declare to handle door lock cluster get pin command.
zb_bool_t tr_door_lock_server_clear_pin_cb (zb_zcl_parsed_hdr_t *cmd_info, zb_uint8_t endpoint, zb_uint16_t user_id)
 Callback that user can declare to handle door lock cluster clear pin command.
zb_bool_t tr_door_lock_server_clear_all_pins_cb (zb_zcl_parsed_hdr_t *cmd_info, zb_uint8_t endpoint)
 Callback that user can declare to handle door lock cluster clear all pins command.
zb_bool_t tr_door_lock_server_set_user_status_cb (zb_zcl_parsed_hdr_t *cmd_info, zb_uint8_t endpoint, zb_uint16_t user_id, tr_door_lock_user_status_t user_status)
 Callback that user can declare to handle door lock cluster set user status command.
zb_bool_t tr_door_lock_server_get_user_status_cb (zb_zcl_parsed_hdr_t *cmd_info, zb_uint8_t endpoint, zb_uint16_t user_id)
 Callback that user can declare to handle door lock cluster get user status command.
zb_bool_t tr_door_lock_server_set_user_type_cb (zb_zcl_parsed_hdr_t *cmd_info, zb_uint8_t endpoint, zb_uint16_t user_id, tr_door_lock_user_type_t user_type)
 Callback that user can declare to handle door lock cluster set user type command.
zb_bool_t tr_door_lock_server_get_user_type_cb (zb_zcl_parsed_hdr_t *cmd_info, zb_uint8_t endpoint, zb_uint16_t user_id)
 Callback that user can declare to handle door lock cluster get user type command.
void tr_door_lock_server_resp_sent_cb (zb_bufid_t param)
 Callback fires when door lock server response completes.
void tr_door_lock_server_lock (zb_uint8_t endpoint, tr_door_lock_event_source_t event_source, zb_uint8_t *pin)
 API that can be used to lock the door.
void tr_door_lock_server_unlock (zb_uint8_t endpoint, tr_door_lock_event_source_t event_source, zb_uint8_t *pin)
 API that can be used to unlock the door.
void tr_door_lock_server_update_lock_state (zb_uint8_t endpoint, zb_uint8_t lock_state, zb_uint8_t source, zb_uint16_t user, zb_uint8_t *pin)
 API used to notify the door lock server plugin of lock state changes.
void tr_door_lock_server_send_op_event_notification (zb_uint8_t endpoint, zb_uint8_t source, zb_uint8_t code, zb_uint16_t user, zb_uint8_t *pin, zb_uint8_t mask_bit)
 API used to send an operation event notification.
zb_uint32_t tr_get_auto_relock_time_seconds (zb_uint8_t endpoint)
 API for getting the auto-relock time.
zb_bool_t tr_door_lock_server_verify_user (zb_uint8_t endpoint, zb_bool_t rf_operation, zb_uint8_t *pin, zb_uint16_t *user)
 API used to verify a PIN code.
tr_door_lock_set_pin_or_id_status_t tr_door_lock_server_add_user (zb_uint16_t user, tr_door_lock_user_status_t status, tr_door_lock_user_type_t type, zb_uint8_t *pin)
 API used to add a user to the table.
zb_bool_t tr_door_lock_server_get_user (zb_uint16_t user, tr_door_lock_get_pin_resp_t *user_info)
 API used to get a user table entry.
zb_bool_t tr_door_lock_server_delete_user (zb_uint16_t user)
 API to delete an entry from the user table.
void tr_door_lock_server_delete_all_pin_users (void)
 API to delete ALL entries from the user table.
zb_bool_t tr_door_lock_server_set_user_status (zb_uint16_t user, tr_door_lock_user_status_t user_status)
 API to set the status for a user in the user able.
zb_bool_t tr_door_lock_server_get_user_status (zb_uint16_t user, tr_door_lock_get_user_status_resp_t *user_info)
 API to get the status of a user in the user table.
zb_bool_t tr_door_lock_server_set_user_type (zb_uint16_t user, tr_door_lock_user_type_t user_type)
 API to set the type of a user in the user table.
zb_bool_t tr_door_lock_server_get_user_type (zb_uint16_t user, tr_door_lock_get_user_type_resp_t *user_info)
 API to get the type of a user from the user table.
void tr_door_lock_server_print_users (void)
 API to print the user table.
void tr_door_lock_server_init (void)
void tr_door_lock_server_users_init (void)
void tr_door_lock_server_register_nv (void)

Detailed Description

ZCL Door Lock cluster server implementation.


SPDX-License-Identifier: LicenseRef-TridentMSLA SPDX-FileCopyrightText: 2025 Trident IoT, LLC https://www.tridentiot.com


Macro Definition Documentation

◆ TR_DOOR_LOCK_SERVER_MAX_NUM_USERS

#define TR_DOOR_LOCK_SERVER_MAX_NUM_USERS   8

◆ TR_DOOR_LOCK_SERVER_MAX_PIN_LEN

#define TR_DOOR_LOCK_SERVER_MAX_PIN_LEN   4

◆ tr_door_lock_server_printf

#define tr_door_lock_server_printf ( ...)

debug prints


◆ tr_door_lock_server_println

#define tr_door_lock_server_println ( ...)

Typedef Documentation

◆ [struct]

typedef ZB_PACKED_PRE struct { ... } tr_door_lock_get_pin_resp_t

◆ tr_door_lock_get_user_status_resp_t

◆ tr_door_lock_get_user_type_resp_t

◆ [struct]

typedef ZB_PACKED_PRE struct { ... } tr_door_lock_server_user_t

Function Documentation

◆ tr_door_lock_server_init()

void tr_door_lock_server_init ( void )

function prototypes consumed by framework


◆ tr_door_lock_server_register_nv()

void tr_door_lock_server_register_nv ( void )

◆ tr_door_lock_server_users_init()

void tr_door_lock_server_users_init ( void )

Variable Documentation

◆ pin

◆ status

◆ type

◆ user_id

zb_uint16_t user_id

◆ user_status

◆ user_type