forked from xiaozhi/xiaozhi-esp32
增加唤醒词播放添加设备验证码
This commit is contained in:
@@ -125,8 +125,14 @@ void Application::CheckNewVersion() {
|
|||||||
// Activation code is valid
|
// Activation code is valid
|
||||||
SetDeviceState(kDeviceStateActivating);
|
SetDeviceState(kDeviceStateActivating);
|
||||||
ShowActivationCode();
|
ShowActivationCode();
|
||||||
// Check again in 60 seconds
|
|
||||||
vTaskDelay(pdMS_TO_TICKS(60000));
|
// Check again in 60 seconds or until the device is idle
|
||||||
|
for (int i = 0; i < 60; ++i) {
|
||||||
|
if (device_state_ == kDeviceStateIdle) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
vTaskDelay(pdMS_TO_TICKS(1000));
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -488,6 +494,8 @@ void Application::Start() {
|
|||||||
SetDeviceState(kDeviceStateListening);
|
SetDeviceState(kDeviceStateListening);
|
||||||
} else if (device_state_ == kDeviceStateSpeaking) {
|
} else if (device_state_ == kDeviceStateSpeaking) {
|
||||||
AbortSpeaking(kAbortReasonWakeWordDetected);
|
AbortSpeaking(kAbortReasonWakeWordDetected);
|
||||||
|
} else if (device_state_ == kDeviceStateActivating) {
|
||||||
|
SetDeviceState(kDeviceStateIdle);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resume detection
|
// Resume detection
|
||||||
|
|||||||
Reference in New Issue
Block a user