fix(ota): block business interactions during updates
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user