feat(control-plane): add configurable Wi-Fi reset button
This commit is contained in:
@@ -84,6 +84,8 @@ const char *control_plane_key_id_name(control_plane_key_id_t key_id)
|
||||
return "SW1";
|
||||
case CONTROL_PLANE_KEY_ID_SW2:
|
||||
return "SW2";
|
||||
case CONTROL_PLANE_KEY_ID_RESET:
|
||||
return "RESET";
|
||||
default:
|
||||
return "UNKNOWN";
|
||||
}
|
||||
@@ -128,6 +130,13 @@ static void control_plane_dispatch_key_event(const control_plane_key_event_t *ev
|
||||
event->press_duration_ms,
|
||||
event->click_count);
|
||||
|
||||
if (event->key_id == CONTROL_PLANE_KEY_ID_RESET) {
|
||||
if (event->type == CONTROL_PLANE_KEY_EVENT_LONG_PRESS_START) {
|
||||
control_plane_reset_wifi_provisioning_and_restart();
|
||||
}
|
||||
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