Skip to content

Commit 0e0dcc8

Browse files
committed
Extend DoorLock Cluster, add zap-generated files for command GetAllPINCodes
This is a contribution per the CLA Signed-off-by: Nenad Kljajic <nkljajic@control4.com>
1 parent 695d98d commit 0e0dcc8

22 files changed

+713
-2
lines changed

applications/dev_ui/dev_gui/zap-generated/src/cluster-types/cluster-type-attributes.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7274,6 +7274,13 @@ export let ClusterTypeAttrs: any = {
72747274
isArray: false,
72757275
}
72767276
]
7277+
},
7278+
{
7279+
id: 128,
7280+
name: "GetAllPINCodes",
7281+
required: false,
7282+
fields: [
7283+
]
72777284
}
72787285
]
72797286
}

applications/zigpc/components/command_mapper/zap-generated/src/zigpc_command_mapper_bygroup_handlers.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2272,6 +2272,30 @@ void zigpc_command_mapper_bygroup_door_lock_clear_allrfid_codes_handler(
22722272

22732273
}
22742274

2275+
/**
2276+
* @brief DotDot MQTT by-group handler for DoorLock/GetAllPINCodes command.
2277+
*
2278+
* @param group_id UCL group identifier.
2279+
2280+
*/
2281+
void zigpc_command_mapper_bygroup_door_lock_get_allpin_codes_handler(
2282+
const dotdot_group_id_t group_id
2283+
) {
2284+
2285+
2286+
2287+
2288+
zigpc_command_mapper_send_multicast(
2289+
group_id,
2290+
ZIGPC_ZCL_FRAME_TYPE_CMD_TO_SERVER,
2291+
ZIGPC_ZCL_CLUSTER_DOOR_LOCK,
2292+
ZIGPC_ZCL_CLUSTER_DOOR_LOCK_COMMAND_GET_ALLPIN_CODES,
2293+
0,
2294+
nullptr
2295+
);
2296+
2297+
}
2298+
22752299
void zigpc_command_mapper_bygroup_thermostat_write_attributes_handler(
22762300
const dotdot_group_id_t group_id,
22772301
uic_mqtt_dotdot_thermostat_state_t values,
@@ -4051,6 +4075,7 @@ sl_status_t zigpc_command_mapper_mqtt_bygroup_handlers_init(void)
40514075
uic_mqtt_dotdot_by_group_door_lock_getrfid_code_callback_set(zigpc_command_mapper_bygroup_door_lock_getrfid_code_handler);
40524076
uic_mqtt_dotdot_by_group_door_lock_clearrfid_code_callback_set(zigpc_command_mapper_bygroup_door_lock_clearrfid_code_handler);
40534077
uic_mqtt_dotdot_by_group_door_lock_clear_allrfid_codes_callback_set(zigpc_command_mapper_bygroup_door_lock_clear_allrfid_codes_handler);
4078+
uic_mqtt_dotdot_by_group_door_lock_get_allpin_codes_callback_set(zigpc_command_mapper_bygroup_door_lock_get_allpin_codes_handler);
40544079
uic_mqtt_dotdot_by_group_thermostat_write_attributes_callback_set(zigpc_command_mapper_bygroup_thermostat_write_attributes_handler);
40554080
uic_mqtt_dotdot_by_group_thermostat_setpoint_raise_or_lower_callback_set(zigpc_command_mapper_bygroup_thermostat_setpoint_raise_or_lower_handler);
40564081
uic_mqtt_dotdot_by_group_thermostat_set_weekly_schedule_callback_set(zigpc_command_mapper_bygroup_thermostat_set_weekly_schedule_handler);

applications/zigpc/components/command_mapper/zap-generated/src/zigpc_command_mapper_handlers.cpp

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4252,6 +4252,50 @@ sl_status_t zigpc_command_mapper_door_lock_clear_allrfid_codes_handler(
42524252
return SL_STATUS_OK;
42534253
}
42544254

4255+
/**
4256+
* @brief DotDot MQTT translator handler for DoorLock/GetAllPINCodes command.
4257+
*
4258+
* @param unid Unify device identifier string
4259+
* @param endpoint Unify device endpoint identifier
4260+
* @param callback_type Callback type
4261+
* @return SL_STATUS_OK if callback_type == UIC_MQTT_DOTDOT_CALLBACK_TYPE_NORMAL and call is successful
4262+
* @return SL_STATUS_OK if callback_type == UIC_MQTT_DOTDOT_CALLBACK_TYPE_SUPPORT_CHECK and command is supported by the unid/endpoint
4263+
* @return SL_STATUS_NOT_AVAILABLE if callback_type == UIC_MQTT_DOTDOT_CALLBACK_TYPE_SUPPORT_CHECK and command is not supported by the unid/endpoint
4264+
*/
4265+
sl_status_t zigpc_command_mapper_door_lock_get_allpin_codes_handler(
4266+
const dotdot_unid_t unid,
4267+
const dotdot_endpoint_id_t endpoint,
4268+
uic_mqtt_dotdot_callback_call_type_t callback_type
4269+
) {
4270+
sl_status_t status = SL_STATUS_OK;
4271+
4272+
if (callback_type == UIC_MQTT_DOTDOT_CALLBACK_TYPE_SUPPORT_CHECK) {
4273+
status = zigpc_command_mapper_cluster_support_check(unid, endpoint, ZIGPC_ZCL_CLUSTER_DOOR_LOCK);
4274+
if (status != SL_STATUS_OK) {
4275+
status = SL_STATUS_NOT_AVAILABLE;
4276+
}
4277+
return status;
4278+
}
4279+
4280+
4281+
4282+
4283+
if (status == SL_STATUS_OK) {
4284+
zigpc_command_mapper_send_unicast(
4285+
unid,
4286+
endpoint,
4287+
ZIGPC_ZCL_FRAME_TYPE_CMD_TO_SERVER,
4288+
ZIGPC_ZCL_CLUSTER_DOOR_LOCK,
4289+
ZIGPC_ZCL_CLUSTER_DOOR_LOCK_COMMAND_GET_ALLPIN_CODES,
4290+
0,
4291+
nullptr
4292+
);
4293+
}
4294+
4295+
// Always return SL_STATUS_OK if being called normally.
4296+
return SL_STATUS_OK;
4297+
}
4298+
42554299
/******************
42564300
* DotDot MQTT Command Handlers for Thermostat cluster
42574301
******************/
@@ -8054,6 +8098,9 @@ sl_status_t zigpc_command_mapper_register_dotdot_mqtt_handlers(void)
80548098
uic_mqtt_dotdot_door_lock_clear_allrfid_codes_callback_set(
80558099
zigpc_command_mapper_door_lock_clear_allrfid_codes_handler
80568100
);
8101+
uic_mqtt_dotdot_door_lock_get_allpin_codes_callback_set(
8102+
zigpc_command_mapper_door_lock_get_allpin_codes_handler
8103+
);
80578104
uic_mqtt_dotdot_set_thermostat_write_attributes_callback(
80588105
zigpc_command_mapper_thermostat_write_attributes_handler
80598106
);

applications/zigpc/components/zcl_util/zap-generated/include/zcl_definitions.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@ typedef enum {
479479
ZIGPC_ZCL_CLUSTER_DOOR_LOCK_COMMAND_CLEAR_ALLRFID_CODES_RESPONSE = 0x19,
480480
ZIGPC_ZCL_CLUSTER_DOOR_LOCK_COMMAND_OPERATING_EVENT_NOTIFICATION = 0x20,
481481
ZIGPC_ZCL_CLUSTER_DOOR_LOCK_COMMAND_PROGRAMMING_EVENT_NOTIFICATION = 0x21,
482+
ZIGPC_ZCL_CLUSTER_DOOR_LOCK_COMMAND_GET_ALLPIN_CODES = 0x80,
482483
} zigpc_zcl_door_lock_command_type_t;
483484

484485
/*****************************************************************

components/uic_dotdot/zap-generated/include/dotdot_cluster_command_id_definitions.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@
189189
#define DOTDOT_DOOR_LOCK_CLEAR_ALLRFID_CODES_RESPONSE_COMMAND_ID (0x19)
190190
#define DOTDOT_DOOR_LOCK_OPERATING_EVENT_NOTIFICATION_COMMAND_ID (0x20)
191191
#define DOTDOT_DOOR_LOCK_PROGRAMMING_EVENT_NOTIFICATION_COMMAND_ID (0x21)
192+
#define DOTDOT_DOOR_LOCK_GET_ALLPIN_CODES_COMMAND_ID (0x80)
192193

193194
// Commands for cluster: WindowCovering
194195
#define DOTDOT_WINDOW_COVERING_UP_OR_OPEN_COMMAND_ID (0x0)

components/uic_dotdot/zap-generated/readme_ucl_mqtt_reference.md

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14083,6 +14083,7 @@ ucl/by-unid/<UNID>/<EP>/DoorLock/Attributes/ClusterRevision/Reported { "value":
1408314083
"ClearAllRFIDCodesResponse",
1408414084
"OperatingEventNotification",
1408514085
"ProgrammingEventNotification",
14086+
"GetAllPINCodes",
1408614087
"WriteAttributes",
1408714088
"ForceReadAttributes"
1408814089
]
@@ -14103,15 +14104,15 @@ To see supported commands for DoorLock cluster under the by-unid topic space:
1410314104
```console
1410414105
mosquitto_sub -t 'ucl/by-unid/<UNID>/<EP>/DoorLock/SupportedCommands'
1410514106
# Example output
14106-
ucl/by-unid/<UNID>/<EP>/DoorLock/SupportedCommands { "value": ["LockDoor","UnlockDoor","Toggle","UnlockWithTimeout","GetLogRecord","SetPINCode","GetPINCode","ClearPINCode","ClearAllPINCodes","SetUserStatus","GetUserStatus","SetWeekdaySchedule","GetWeekdaySchedule","ClearWeekdaySchedule","SetYearDaySchedule","GetYearDaySchedule","ClearYearDaySchedule","SetHolidaySchedule","GetHolidaySchedule","ClearHolidaySchedule","SetUserType","GetUserType","SetRFIDCode","GetRFIDCode","ClearRFIDCode","ClearAllRFIDCodes",] }
14107+
ucl/by-unid/<UNID>/<EP>/DoorLock/SupportedCommands { "value": ["LockDoor","UnlockDoor","Toggle","UnlockWithTimeout","GetLogRecord","SetPINCode","GetPINCode","ClearPINCode","ClearAllPINCodes","SetUserStatus","GetUserStatus","SetWeekdaySchedule","GetWeekdaySchedule","ClearWeekdaySchedule","SetYearDaySchedule","GetYearDaySchedule","ClearYearDaySchedule","SetHolidaySchedule","GetHolidaySchedule","ClearHolidaySchedule","SetUserType","GetUserType","SetRFIDCode","GetRFIDCode","ClearRFIDCode","ClearAllRFIDCodes","GetAllPINCodes","WriteAttributes", "ForceReadAttributes"] }
1410714108
```
1410814109

1410914110
To see supported generated commands for DoorLock cluster under the by-unid topic space:
1411014111

1411114112
```console
1411214113
mosquitto_sub -t 'ucl/by-unid/<UNID>/<EP>/DoorLock/SupportedGeneratedCommands'
1411314114
# Example output
14114-
ucl/by-unid/<UNID>/<EP>/DoorLock/SupportedGeneratedCommands { "value": ["LockDoorResponse","UnlockDoorResponse","ToggleResponse","UnlockWithTimeoutResponse","GetLogRecordResponse","SetPINCodeResponse","GetPINCodeResponse","ClearPINCodeResponse","ClearAllPINCodesResponse","SetUserStatusResponse","GetUserStatusResponse","SetWeekdayScheduleResponse","GetWeekdayScheduleResponse","ClearWeekdayScheduleResponse","SetYearDayScheduleResponse","GetYearDayScheduleResponse","ClearYearDayScheduleResponse","SetHolidayScheduleResponse","GetHolidayScheduleResponse","ClearHolidayScheduleResponse","SetUserTypeResponse","GetUserTypeResponse","SetRFIDCodeResponse","GetRFIDCodeResponse","ClearRFIDCodeResponse","ClearAllRFIDCodesResponse","OperatingEventNotification","ProgrammingEventNotification"] }
14115+
ucl/by-unid/<UNID>/<EP>/DoorLock/SupportedGeneratedCommands { "value": ["LockDoorResponse","UnlockDoorResponse","ToggleResponse","UnlockWithTimeoutResponse","GetLogRecordResponse","SetPINCodeResponse","GetPINCodeResponse","ClearPINCodeResponse","ClearAllPINCodesResponse","SetUserStatusResponse","GetUserStatusResponse","SetWeekdayScheduleResponse","GetWeekdayScheduleResponse","ClearWeekdayScheduleResponse","SetYearDayScheduleResponse","GetYearDayScheduleResponse","ClearYearDayScheduleResponse","SetHolidayScheduleResponse","GetHolidayScheduleResponse","ClearHolidayScheduleResponse","SetUserTypeResponse","GetUserTypeResponse","SetRFIDCodeResponse","GetRFIDCodeResponse","ClearRFIDCodeResponse","ClearAllRFIDCodesResponse","OperatingEventNotification","ProgrammingEventNotification",] }
1411514116
```
1411614117

1411714118
<!-- -->
@@ -16705,6 +16706,45 @@ mosquitto_sub -t 'ucl/by-unid/<UNID>/<EP>/DoorLock/GeneratedCommands/Programming
1670516706

1670616707
<br><br>
1670716708

16709+
\subsection door_lock_get_allpin_codes_cmd DoorLock/GetAllPINCodes Command
16710+
16711+
**MQTT Topic Pattern:**
16712+
16713+
```
16714+
[PREFIX]/DoorLock/Commands/GetAllPINCodes
16715+
[PREFIX]/DoorLock/GeneratedCommands/GetAllPINCodes
16716+
```
16717+
16718+
**MQTT Payload JSON Schema:**
16719+
16720+
```json
16721+
{
16722+
"$schema": "http://json-schema.org/draft-07/schema#",
16723+
"title": "DoorLock Cluster GetAllPINCodes Command Properties",
16724+
"type": "object",
16725+
"properties": {
16726+
},
16727+
"required": [
16728+
]
16729+
}
16730+
```
16731+
16732+
**Example Mosquitto CLI Tool Usage**
16733+
16734+
To send a DoorLock/GetAllPINCodes command under the by-unid topic space:
16735+
16736+
```console
16737+
mosquitto_pub -t 'ucl/by-unid/<UNID>/<EP>/DoorLock/Commands/GetAllPINCodes' -m '{ }'
16738+
```
16739+
16740+
To receive a DoorLock/GetAllPINCodes generated command from a UNID/endpoint:
16741+
16742+
```console
16743+
mosquitto_sub -t 'ucl/by-unid/<UNID>/<EP>/DoorLock/GeneratedCommands/GetAllPINCodes'
16744+
```
16745+
16746+
<br><br>
16747+
1670816748
\subsection door_lock_write_attr_cmd DoorLock/WriteAttributes Command
1670916749

1671016750
**MQTT Topic Pattern:**

components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt.h

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9931,6 +9931,11 @@ typedef sl_status_t (*uic_mqtt_dotdot_door_lock_programming_event_notification_c
99319931
const char* data
99329932

99339933
);
9934+
typedef sl_status_t (*uic_mqtt_dotdot_door_lock_get_allpin_codes_callback_t)(
9935+
dotdot_unid_t unid,
9936+
dotdot_endpoint_id_t endpoint,
9937+
uic_mqtt_dotdot_callback_call_type_t call_type
9938+
);
99349939

99359940
typedef struct {
99369941
uint8_t lock_state;
@@ -12697,6 +12702,46 @@ void uic_mqtt_dotdot_door_lock_generated_programming_event_notification_callback
1269712702
* +/DoorLock/GeneratedCommands/programming_event_notification is received.
1269812703
*/
1269912704
void uic_mqtt_dotdot_door_lock_generated_programming_event_notification_callback_clear();
12705+
/**
12706+
* @brief Setup callback to be called when a
12707+
* DoorLock/Commands/get_allpin_codes is received.
12708+
*
12709+
* Setting this callback will not overwrite the previous set callback
12710+
* @param callback Function to be called on command reception
12711+
*/
12712+
void uic_mqtt_dotdot_door_lock_get_allpin_codes_callback_set(const uic_mqtt_dotdot_door_lock_get_allpin_codes_callback_t callback);
12713+
/**
12714+
* @brief Unsets callback to be called when a
12715+
* DoorLock/Commands/get_allpin_codes is received.
12716+
*
12717+
* @param callback Function to be no longer called on command reception
12718+
*/
12719+
void uic_mqtt_dotdot_door_lock_get_allpin_codes_callback_unset(const uic_mqtt_dotdot_door_lock_get_allpin_codes_callback_t callback);
12720+
/**
12721+
* @brief Clears all callbacks registered for when
12722+
* DoorLock/Commands/get_allpin_codes is received.
12723+
*/
12724+
void uic_mqtt_dotdot_door_lock_get_allpin_codes_callback_clear();
12725+
12726+
/**
12727+
* @brief Setup callback to be called when a
12728+
* +/DoorLock/GeneratedCommands/get_allpin_codes is received.
12729+
*
12730+
* Setting this callback will not overwrite the previous set callback
12731+
* @param callback Function to be called on command reception
12732+
*/
12733+
void uic_mqtt_dotdot_door_lock_generated_get_allpin_codes_callback_set(const uic_mqtt_dotdot_door_lock_get_allpin_codes_callback_t callback);
12734+
/**
12735+
* @brief Unsets callback to be called when a
12736+
* +/DoorLock/GeneratedCommands/get_allpin_codes is received.
12737+
* @param callback Function to be no longer called on command reception
12738+
*/
12739+
void uic_mqtt_dotdot_door_lock_generated_get_allpin_codes_callback_unset(const uic_mqtt_dotdot_door_lock_get_allpin_codes_callback_t callback);
12740+
/**
12741+
* @brief Clears all callbacks registered for when
12742+
* +/DoorLock/GeneratedCommands/get_allpin_codes is received.
12743+
*/
12744+
void uic_mqtt_dotdot_door_lock_generated_get_allpin_codes_callback_clear();
1270012745

1270112746
/**
1270212747
* @brief Setup a callback for WriteAttribute to be called when a

components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_generated_commands.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2642,6 +2642,23 @@ void uic_mqtt_dotdot_door_lock_publish_generated_programming_event_notification_
26422642
const uic_mqtt_dotdot_door_lock_command_programming_event_notification_fields_t *fields
26432643

26442644
);
2645+
/**
2646+
* @brief Publishes an incoming/generated GetAllPINCodes command for
2647+
* the DoorLock cluster.
2648+
*
2649+
* Publication will be made at the following topic
2650+
* ucl/by-unid/UNID/epID/DoorLock/GeneratedCommands/GetAllPINCodes
2651+
*
2652+
* @param unid The UNID of the node that sent us the command.
2653+
*
2654+
* @param endpoint The Endpoint ID of the node that sent us the command.
2655+
*
2656+
*
2657+
*/
2658+
void uic_mqtt_dotdot_door_lock_publish_generated_get_allpin_codes_command(
2659+
const dotdot_unid_t unid,
2660+
const dotdot_endpoint_id_t endpoint
2661+
);
26452662

26462663
/**
26472664
* @brief Publishes an incoming/generated WriteAttributes command for

components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_group_commands.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2054,6 +2054,21 @@ typedef void (*uic_mqtt_dotdot_by_group_door_lock_programming_event_notification
20542054
*/
20552055
void uic_mqtt_dotdot_by_group_door_lock_programming_event_notification_callback_set(const uic_mqtt_dotdot_by_group_door_lock_programming_event_notification_callback_t callback);
20562056

2057+
/**
2058+
* @brief Callback signature for by-group DoorLock::GetAllPINCodes command.
2059+
*/
2060+
typedef void (*uic_mqtt_dotdot_by_group_door_lock_get_allpin_codes_callback_t)(
2061+
const dotdot_group_id_t group_id
2062+
);
2063+
2064+
/**
2065+
* Setup handler to be called when a
2066+
* ucl/by-group/+/DoorLock/get_allpin_codes is received.
2067+
* Setting this callback will overwrite the previous set callback.
2068+
*
2069+
*/
2070+
void uic_mqtt_dotdot_by_group_door_lock_get_allpin_codes_callback_set(const uic_mqtt_dotdot_by_group_door_lock_get_allpin_codes_callback_t callback);
2071+
20572072
typedef void (*uic_mqtt_dotdot_by_group_door_lock_write_attributes_callback_t)(
20582073
const dotdot_group_id_t group_id,
20592074
uic_mqtt_dotdot_door_lock_state_t,

components/uic_dotdot_mqtt/zap-generated/include/dotdot_mqtt_send_commands.h

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4370,6 +4370,37 @@ void uic_mqtt_dotdot_door_lock_publish_programming_event_notification_command_to
43704370
const uic_mqtt_dotdot_door_lock_command_programming_event_notification_fields_t *fields
43714371

43724372
);
4373+
/**
4374+
* @brief Sends/Publishes a GetAllPINCodes command for
4375+
* the DoorLock cluster to a destination.
4376+
*
4377+
* Publication will be made at the following topic
4378+
* ucl/by-unid/UNID/epID/DoorLock/Commands/GetAllPINCodes
4379+
*
4380+
* @param destination_unid The UNID of the node that should receive the command.
4381+
*
4382+
* @param destination_endpoint The Endpoint ID of the node that should receive the command.
4383+
*
4384+
*
4385+
*/
4386+
void uic_mqtt_dotdot_door_lock_publish_get_allpin_codes_command(
4387+
const dotdot_unid_t destination_unid,
4388+
const dotdot_endpoint_id_t destination_endpoint
4389+
);
4390+
4391+
/**
4392+
* @brief Sends/Publishes a GetAllPINCodes command for
4393+
* the DoorLock cluster to a group.
4394+
*
4395+
* Publication will be made at the following topic
4396+
* ucl/by-group/GroupID/DoorLock/Commands/GetAllPINCodes
4397+
*
4398+
* @param destination_group_id The GroupID that should receive the command.
4399+
*
4400+
*/
4401+
void uic_mqtt_dotdot_door_lock_publish_get_allpin_codes_command_to_group(
4402+
uint16_t destination_group_id
4403+
);
43734404
/**
43744405
* @brief Sends/Publishes a UpOrOpen command for
43754406
* the WindowCovering cluster to a destination.

0 commit comments

Comments
 (0)