Skip to content

Commit 6718a9b

Browse files
Nenad KljajicThomasdjb
authored andcommitted
SiliconLabsGH-23: [Patch Integration] Extend DoorLock Cluster, add zap-generated files for command GetAllPINCodes
This is a patch integration into the Unify codebase. This may be squashed into the original commit. Origin: SiliconLabs#23 Bug-SiliconLabs: UIC-3201 Signed-off-by: Nenad Kljajic <[email protected]> Forwarded-SiliconLabs: thdubois/UIC-3072/c4/develop Last-Update: 2024-01-18 (cherry picked from commit 674e23edc5d29903b052b197047ebee2f898a578)
1 parent 08b1df5 commit 6718a9b

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

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
@@ -2269,6 +2269,30 @@ void zigpc_command_mapper_bygroup_door_lock_clear_allrfid_codes_handler(
22692269
0,
22702270
nullptr
22712271
);
2272+
/**
2273+
* @brief DotDot MQTT by-group handler for DoorLock/GetAllPINCodes command.
2274+
*
2275+
* @param group_id UCL group identifier.
2276+
2277+
*/
2278+
void zigpc_command_mapper_bygroup_door_lock_get_allpin_codes_handler(
2279+
const dotdot_group_id_t group_id
2280+
) {
2281+
2282+
2283+
2284+
2285+
zigpc_command_mapper_send_multicast(
2286+
group_id,
2287+
ZIGPC_ZCL_FRAME_TYPE_CMD_TO_SERVER,
2288+
ZIGPC_ZCL_CLUSTER_DOOR_LOCK,
2289+
ZIGPC_ZCL_CLUSTER_DOOR_LOCK_COMMAND_GET_ALLPIN_CODES,
2290+
0,
2291+
nullptr
2292+
);
2293+
2294+
}
2295+
22722296

22732297
}
22742298

@@ -4076,6 +4100,7 @@ sl_status_t zigpc_command_mapper_mqtt_bygroup_handlers_init(void)
40764100
uic_mqtt_dotdot_by_group_door_lock_clearrfid_code_callback_set(zigpc_command_mapper_bygroup_door_lock_clearrfid_code_handler);
40774101
uic_mqtt_dotdot_by_group_door_lock_clear_allrfid_codes_callback_set(zigpc_command_mapper_bygroup_door_lock_clear_allrfid_codes_handler);
40784102
uic_mqtt_dotdot_by_group_door_lock_get_allpin_codes_callback_set(zigpc_command_mapper_bygroup_door_lock_get_allpin_codes_handler);
4103+
uic_mqtt_dotdot_by_group_door_lock_get_allpin_codes_callback_set(zigpc_command_mapper_bygroup_door_lock_get_allpin_codes_handler);
40794104
uic_mqtt_dotdot_by_group_thermostat_write_attributes_callback_set(zigpc_command_mapper_bygroup_thermostat_write_attributes_handler);
40804105
uic_mqtt_dotdot_by_group_thermostat_setpoint_raise_or_lower_callback_set(zigpc_command_mapper_bygroup_thermostat_setpoint_raise_or_lower_handler);
40814106
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: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4231,6 +4231,50 @@ sl_status_t zigpc_command_mapper_door_lock_clear_allrfid_codes_handler(
42314231
status = SL_STATUS_NOT_AVAILABLE;
42324232
}
42334233
return status;
4234+
* @brief DotDot MQTT translator handler for DoorLock/GetAllPINCodes command.
4235+
*
4236+
* @param unid Unify device identifier string
4237+
* @param endpoint Unify device endpoint identifier
4238+
* @param callback_type Callback type
4239+
* @return SL_STATUS_OK if callback_type == UIC_MQTT_DOTDOT_CALLBACK_TYPE_NORMAL and call is successful
4240+
* @return SL_STATUS_OK if callback_type == UIC_MQTT_DOTDOT_CALLBACK_TYPE_SUPPORT_CHECK and command is supported by the unid/endpoint
4241+
* @return SL_STATUS_NOT_AVAILABLE if callback_type == UIC_MQTT_DOTDOT_CALLBACK_TYPE_SUPPORT_CHECK and command is not supported by the unid/endpoint
4242+
*/
4243+
sl_status_t zigpc_command_mapper_door_lock_get_allpin_codes_handler(
4244+
const dotdot_unid_t unid,
4245+
const dotdot_endpoint_id_t endpoint,
4246+
uic_mqtt_dotdot_callback_call_type_t callback_type
4247+
) {
4248+
sl_status_t status = SL_STATUS_OK;
4249+
4250+
if (callback_type == UIC_MQTT_DOTDOT_CALLBACK_TYPE_SUPPORT_CHECK) {
4251+
status = zigpc_command_mapper_cluster_support_check(unid, endpoint, ZIGPC_ZCL_CLUSTER_DOOR_LOCK);
4252+
if (status != SL_STATUS_OK) {
4253+
status = SL_STATUS_NOT_AVAILABLE;
4254+
}
4255+
return status;
4256+
}
4257+
4258+
4259+
4260+
4261+
if (status == SL_STATUS_OK) {
4262+
zigpc_command_mapper_send_unicast(
4263+
unid,
4264+
endpoint,
4265+
ZIGPC_ZCL_FRAME_TYPE_CMD_TO_SERVER,
4266+
ZIGPC_ZCL_CLUSTER_DOOR_LOCK,
4267+
ZIGPC_ZCL_CLUSTER_DOOR_LOCK_COMMAND_GET_ALLPIN_CODES,
4268+
0,
4269+
nullptr
4270+
);
4271+
}
4272+
4273+
// Always return SL_STATUS_OK if being called normally.
4274+
return SL_STATUS_OK;
4275+
}
4276+
4277+
/**
42344278
}
42354279
42364280
@@ -8101,6 +8145,10 @@ sl_status_t zigpc_command_mapper_register_dotdot_mqtt_handlers(void)
81018145
uic_mqtt_dotdot_door_lock_get_allpin_codes_callback_set(
81028146
zigpc_command_mapper_door_lock_get_allpin_codes_handler
81038147
);
8148+
);
8149+
8150+
uic_mqtt_dotdot_door_lock_get_allpin_codes_callback_set(
8151+
zigpc_command_mapper_door_lock_get_allpin_codes_handler
81048152
uic_mqtt_dotdot_set_thermostat_write_attributes_callback(
81058153
zigpc_command_mapper_thermostat_write_attributes_handler
81068154
);

0 commit comments

Comments
 (0)