fix(ota): block business interactions during updates

This commit is contained in:
chenjintao
2026-08-21 17:55:10 +08:00
parent a60f98a4c6
commit fdbc956424
5 changed files with 35 additions and 0 deletions
@@ -140,6 +140,20 @@ static void control_plane_dispatch_key_event(const control_plane_key_event_t *ev
return;
}
if (!control_plane_ota_business_interactions_allowed()) {
if (event->key_id == CONTROL_PLANE_KEY_ID_PTT &&
(event->type == CONTROL_PLANE_KEY_EVENT_RELEASED ||
event->type == CONTROL_PLANE_KEY_EVENT_LONG_PRESS_RELEASE ||
event->type == CONTROL_PLANE_KEY_EVENT_CANCELLED)) {
control_plane_set_ptt_active(false);
}
ESP_LOGI(TAG,
"Business key ignored during OTA: key=%s type=%s",
control_plane_key_id_name(event->key_id),
control_plane_key_event_type_name(event->type));
return;
}
if (event->key_id == CONTROL_PLANE_KEY_ID_SW2) {
if (event->type == CONTROL_PLANE_KEY_EVENT_SHORT_PRESS) {
esp_err_t request_err = control_plane_request_cloud_chouqian();