Skip to content

Commit

Permalink
SiliconLabsGH-23: [Patch Integration] Extend DoorLock Cluster, add za…
Browse files Browse the repository at this point in the history
…p-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 <Nenad.Kljajic@SnapOne.com>
Forwarded-SiliconLabs: thdubois/UIC-3072/c4/develop
Last-Update: 2024-01-18
(cherry picked from commit 674e23edc5d29903b052b197047ebee2f898a578)
  • Loading branch information
Nenad Kljajic authored and Thomasdjb committed Jan 18, 2024
1 parent 08b1df5 commit 6718a9b
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
Expand Up @@ -2269,6 +2269,30 @@ void zigpc_command_mapper_bygroup_door_lock_clear_allrfid_codes_handler(
0,
nullptr
);
/**
* @brief DotDot MQTT by-group handler for DoorLock/GetAllPINCodes command.
*
* @param group_id UCL group identifier.
*/
void zigpc_command_mapper_bygroup_door_lock_get_allpin_codes_handler(
const dotdot_group_id_t group_id
) {




zigpc_command_mapper_send_multicast(
group_id,
ZIGPC_ZCL_FRAME_TYPE_CMD_TO_SERVER,
ZIGPC_ZCL_CLUSTER_DOOR_LOCK,
ZIGPC_ZCL_CLUSTER_DOOR_LOCK_COMMAND_GET_ALLPIN_CODES,
0,
nullptr
);

}


}

Expand Down Expand Up @@ -4076,6 +4100,7 @@ sl_status_t zigpc_command_mapper_mqtt_bygroup_handlers_init(void)
uic_mqtt_dotdot_by_group_door_lock_clearrfid_code_callback_set(zigpc_command_mapper_bygroup_door_lock_clearrfid_code_handler);
uic_mqtt_dotdot_by_group_door_lock_clear_allrfid_codes_callback_set(zigpc_command_mapper_bygroup_door_lock_clear_allrfid_codes_handler);
uic_mqtt_dotdot_by_group_door_lock_get_allpin_codes_callback_set(zigpc_command_mapper_bygroup_door_lock_get_allpin_codes_handler);
uic_mqtt_dotdot_by_group_door_lock_get_allpin_codes_callback_set(zigpc_command_mapper_bygroup_door_lock_get_allpin_codes_handler);
uic_mqtt_dotdot_by_group_thermostat_write_attributes_callback_set(zigpc_command_mapper_bygroup_thermostat_write_attributes_handler);
uic_mqtt_dotdot_by_group_thermostat_setpoint_raise_or_lower_callback_set(zigpc_command_mapper_bygroup_thermostat_setpoint_raise_or_lower_handler);
uic_mqtt_dotdot_by_group_thermostat_set_weekly_schedule_callback_set(zigpc_command_mapper_bygroup_thermostat_set_weekly_schedule_handler);
Expand Down
Expand Up @@ -4231,6 +4231,50 @@ sl_status_t zigpc_command_mapper_door_lock_clear_allrfid_codes_handler(
status = SL_STATUS_NOT_AVAILABLE;
}
return status;
* @brief DotDot MQTT translator handler for DoorLock/GetAllPINCodes command.
*
* @param unid Unify device identifier string
* @param endpoint Unify device endpoint identifier
* @param callback_type Callback type
* @return SL_STATUS_OK if callback_type == UIC_MQTT_DOTDOT_CALLBACK_TYPE_NORMAL and call is successful
* @return SL_STATUS_OK if callback_type == UIC_MQTT_DOTDOT_CALLBACK_TYPE_SUPPORT_CHECK and command is supported by the unid/endpoint
* @return SL_STATUS_NOT_AVAILABLE if callback_type == UIC_MQTT_DOTDOT_CALLBACK_TYPE_SUPPORT_CHECK and command is not supported by the unid/endpoint
*/
sl_status_t zigpc_command_mapper_door_lock_get_allpin_codes_handler(
const dotdot_unid_t unid,
const dotdot_endpoint_id_t endpoint,
uic_mqtt_dotdot_callback_call_type_t callback_type
) {
sl_status_t status = SL_STATUS_OK;

if (callback_type == UIC_MQTT_DOTDOT_CALLBACK_TYPE_SUPPORT_CHECK) {
status = zigpc_command_mapper_cluster_support_check(unid, endpoint, ZIGPC_ZCL_CLUSTER_DOOR_LOCK);
if (status != SL_STATUS_OK) {
status = SL_STATUS_NOT_AVAILABLE;
}
return status;
}




if (status == SL_STATUS_OK) {
zigpc_command_mapper_send_unicast(
unid,
endpoint,
ZIGPC_ZCL_FRAME_TYPE_CMD_TO_SERVER,
ZIGPC_ZCL_CLUSTER_DOOR_LOCK,
ZIGPC_ZCL_CLUSTER_DOOR_LOCK_COMMAND_GET_ALLPIN_CODES,
0,
nullptr
);
}

// Always return SL_STATUS_OK if being called normally.
return SL_STATUS_OK;
}

/**
}
Expand Down Expand Up @@ -8101,6 +8145,10 @@ sl_status_t zigpc_command_mapper_register_dotdot_mqtt_handlers(void)
uic_mqtt_dotdot_door_lock_get_allpin_codes_callback_set(
zigpc_command_mapper_door_lock_get_allpin_codes_handler
);
);

uic_mqtt_dotdot_door_lock_get_allpin_codes_callback_set(
zigpc_command_mapper_door_lock_get_allpin_codes_handler
uic_mqtt_dotdot_set_thermostat_write_attributes_callback(
zigpc_command_mapper_thermostat_write_attributes_handler
);
Expand Down

0 comments on commit 6718a9b

Please sign in to comment.