Enhance device activation and OTA update process

- Add support for device activation with audio feedback
- Refactor OTA update flow to include activation code handling
- Update asset management for localized sound resources
- Improve error handling and device state management
- Reorganize binary asset includes and CMake configuration
This commit is contained in:
Terrence
2025-02-16 06:59:19 +08:00
parent 14a89cae33
commit 3a71c1e895
39 changed files with 220 additions and 86 deletions

View File

@@ -35,6 +35,7 @@ enum DeviceState {
kDeviceStateListening,
kDeviceStateSpeaking,
kDeviceStateUpgrading,
kDeviceStateActivating,
kDeviceStateFatalError
};
@@ -55,12 +56,13 @@ public:
bool IsVoiceDetected() const { return voice_detected_; }
void Schedule(std::function<void()> callback);
void SetDeviceState(DeviceState state);
void Alert(const std::string& title, const std::string& message);
void Alert(const std::string& status, const std::string& message, const std::string& emotion = "", const std::string& sound = "");
void AbortSpeaking(AbortReason reason);
void ToggleChatState();
void StartListening();
void StopListening();
void UpdateIotStates();
void Reboot();
private:
Application();
@@ -100,7 +102,7 @@ private:
void ResetDecoder();
void SetDecodeSampleRate(int sample_rate);
void CheckNewVersion();
void DisplayActivationCode();
void ShowActivationCode();
void PlayLocalFile(const char* data, size_t size);
};