forked from xiaozhi/xiaozhi-esp32
rename files
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
# CMakeLists in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
set(PROJECT_VER "0.6.3")
|
||||
set(PROJECT_VER "0.7.0")
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(xiaozhi)
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
set(SOURCES "AudioDevice.cc"
|
||||
"FirmwareUpgrade.cc"
|
||||
"SystemInfo.cc"
|
||||
"SystemReset.cc"
|
||||
"Application.cc"
|
||||
"Button.cc"
|
||||
"BuiltinLed.cc"
|
||||
"Display.cc"
|
||||
"Board.cc"
|
||||
set(SOURCES "audio_device.cc"
|
||||
"system_info.cc"
|
||||
"system_reset.cc"
|
||||
"application.cc"
|
||||
"button.cc"
|
||||
"builtin_led.cc"
|
||||
"display.cc"
|
||||
"board.cc"
|
||||
"ota.cc"
|
||||
"main.cc"
|
||||
)
|
||||
set(INCLUDE_DIRS ".")
|
||||
@@ -16,46 +16,46 @@ if(CONFIG_BOARD_TYPE_BREAD_COMPACT_WIFI)
|
||||
# add all files from boards/bread-compact-wifi
|
||||
set(BOARD_TYPE "bread-compact-wifi")
|
||||
file(GLOB BOARD_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD_TYPE}/*.cc)
|
||||
list(APPEND SOURCES ${BOARD_SOURCES} "WifiBoard.cc")
|
||||
list(APPEND SOURCES ${BOARD_SOURCES} "wifi_board.cc")
|
||||
list(APPEND INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD_TYPE})
|
||||
elseif(CONFIG_BOARD_TYPE_BREAD_COMPACT_ML307)
|
||||
# add all files from boards/bread-compact-ml307
|
||||
set(BOARD_TYPE "bread-compact-ml307")
|
||||
file(GLOB BOARD_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD_TYPE}/*.cc)
|
||||
list(APPEND SOURCES ${BOARD_SOURCES} "Ml307Board.cc")
|
||||
list(APPEND SOURCES ${BOARD_SOURCES} "ml307_board.cc")
|
||||
list(APPEND INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD_TYPE})
|
||||
elseif(CONFIG_BOARD_TYPE_ESP_BOX_3)
|
||||
# add all files from boards/esp-box-3
|
||||
set(BOARD_TYPE "esp-box-3")
|
||||
file(GLOB BOARD_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD_TYPE}/*.cc)
|
||||
list(APPEND SOURCES ${BOARD_SOURCES} "WifiBoard.cc")
|
||||
list(APPEND SOURCES ${BOARD_SOURCES} "wifi_board.cc")
|
||||
list(APPEND INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD_TYPE})
|
||||
list(APPEND SOURCES "BoxAudioDevice.cc")
|
||||
list(APPEND SOURCES "box_audio_device.cc")
|
||||
elseif(CONFIG_BOARD_TYPE_KEVIN_BOX_0)
|
||||
# add all files from boards/kevin-box-0
|
||||
set(BOARD_TYPE "kevin-box-0")
|
||||
file(GLOB BOARD_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD_TYPE}/*.cc)
|
||||
list(APPEND SOURCES ${BOARD_SOURCES} "Ml307Board.cc")
|
||||
list(APPEND SOURCES ${BOARD_SOURCES} "ml307_board.cc")
|
||||
list(APPEND INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD_TYPE})
|
||||
list(APPEND SOURCES "BoxAudioDevice.cc")
|
||||
list(APPEND SOURCES "box_audio_device.cc")
|
||||
elseif(CONFIG_BOARD_TYPE_KEVIN_BOX_1)
|
||||
# add all files from boards/kevin-box-1
|
||||
set(BOARD_TYPE "kevin-box-1")
|
||||
file(GLOB BOARD_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD_TYPE}/*.cc)
|
||||
list(APPEND SOURCES ${BOARD_SOURCES} "Ml307Board.cc")
|
||||
list(APPEND SOURCES ${BOARD_SOURCES} "ml307_board.cc")
|
||||
list(APPEND INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD_TYPE})
|
||||
list(APPEND SOURCES "BoxAudioDevice.cc")
|
||||
list(APPEND SOURCES "box_audio_device.cc")
|
||||
elseif(CONFIG_BOARD_TYPE_LICHUANG_DEV)
|
||||
# add all files from boards/lichuang-dev
|
||||
set(BOARD_TYPE "lichuang-dev")
|
||||
file(GLOB BOARD_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD_TYPE}/*.cc)
|
||||
list(APPEND SOURCES ${BOARD_SOURCES} "WifiBoard.cc")
|
||||
list(APPEND SOURCES ${BOARD_SOURCES} "wifi_board.cc")
|
||||
list(APPEND INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD_TYPE})
|
||||
list(APPEND SOURCES "BoxAudioDevice.cc")
|
||||
list(APPEND SOURCES "box_audio_device.cc")
|
||||
endif()
|
||||
|
||||
if(CONFIG_USE_AFE_SR)
|
||||
list(APPEND SOURCES "AudioProcessor.cc" "WakeWordDetect.cc")
|
||||
list(APPEND SOURCES "audio_processor.cc" "wake_word_detect.cc")
|
||||
endif()
|
||||
|
||||
idf_component_register(SRCS ${SOURCES}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#include <BuiltinLed.h>
|
||||
#include <Ml307SslTransport.h>
|
||||
#include <WifiConfigurationAp.h>
|
||||
#include <WifiStation.h>
|
||||
#include <SystemInfo.h>
|
||||
#include "builtin_led.h"
|
||||
#include "system_info.h"
|
||||
#include "ml307_ssl_transport.h"
|
||||
#include "application.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <esp_log.h>
|
||||
@@ -10,8 +9,6 @@
|
||||
#include <driver/gpio.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include "Application.h"
|
||||
|
||||
#define TAG "Application"
|
||||
|
||||
extern const char p3_err_reg_start[] asm("_binary_err_reg_p3_start");
|
||||
@@ -40,8 +37,8 @@ Application::Application()
|
||||
reference_resampler_.Configure(AUDIO_INPUT_SAMPLE_RATE, 16000);
|
||||
}
|
||||
|
||||
firmware_upgrade_.SetCheckVersionUrl(CONFIG_OTA_VERSION_URL);
|
||||
firmware_upgrade_.SetHeader("Device-Id", SystemInfo::GetMacAddress().c_str());
|
||||
ota_.SetCheckVersionUrl(CONFIG_OTA_VERSION_URL);
|
||||
ota_.SetHeader("Device-Id", SystemInfo::GetMacAddress().c_str());
|
||||
}
|
||||
|
||||
Application::~Application() {
|
||||
@@ -70,15 +67,15 @@ Application::~Application() {
|
||||
|
||||
void Application::CheckNewVersion() {
|
||||
// Check if there is a new firmware version available
|
||||
firmware_upgrade_.SetPostData(Board::GetInstance().GetJson());
|
||||
firmware_upgrade_.CheckVersion();
|
||||
if (firmware_upgrade_.HasNewVersion()) {
|
||||
ota_.SetPostData(Board::GetInstance().GetJson());
|
||||
ota_.CheckVersion();
|
||||
if (ota_.HasNewVersion()) {
|
||||
// Wait for the chat state to be idle
|
||||
while (chat_state_ != kChatStateIdle) {
|
||||
vTaskDelay(100);
|
||||
}
|
||||
SetChatState(kChatStateUpgrading);
|
||||
firmware_upgrade_.StartUpgrade([this](int progress, size_t speed) {
|
||||
ota_.StartUpgrade([this](int progress, size_t speed) {
|
||||
char buffer[64];
|
||||
snprintf(buffer, sizeof(buffer), "Upgrading...\n %d%% %zuKB/s", progress, speed / 1024);
|
||||
display_.SetText(buffer);
|
||||
@@ -87,7 +84,7 @@ void Application::CheckNewVersion() {
|
||||
ESP_LOGI(TAG, "Firmware upgrade failed...");
|
||||
SetChatState(kChatStateIdle);
|
||||
} else {
|
||||
firmware_upgrade_.MarkCurrentVersionValid();
|
||||
ota_.MarkCurrentVersionValid();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,21 +9,21 @@
|
||||
#include <list>
|
||||
#include <condition_variable>
|
||||
|
||||
#include <OpusEncoder.h>
|
||||
#include <OpusResampler.h>
|
||||
#include <WebSocket.h>
|
||||
#include "opus_encoder.h"
|
||||
#include "opus_resampler.h"
|
||||
#include <web_socket.h>
|
||||
|
||||
#include "AudioDevice.h"
|
||||
#include "Display.h"
|
||||
#include "Board.h"
|
||||
#include "FirmwareUpgrade.h"
|
||||
#include "audio_device.h"
|
||||
#include "display.h"
|
||||
#include "board.h"
|
||||
#include "ota.h"
|
||||
|
||||
#ifdef CONFIG_USE_AFE_SR
|
||||
#include "WakeWordDetect.h"
|
||||
#include "AudioProcessor.h"
|
||||
#include "wake_word_detect.h"
|
||||
#include "audio_processor.h"
|
||||
#endif
|
||||
|
||||
#include "Button.h"
|
||||
#include "button.h"
|
||||
|
||||
#define DETECTION_RUNNING 1
|
||||
#define COMMUNICATION_RUNNING 2
|
||||
@@ -95,7 +95,7 @@ private:
|
||||
WakeWordDetect wake_word_detect_;
|
||||
AudioProcessor audio_processor_;
|
||||
#endif
|
||||
FirmwareUpgrade firmware_upgrade_;
|
||||
Ota ota_;
|
||||
std::mutex mutex_;
|
||||
std::condition_variable_any cv_;
|
||||
std::list<std::function<void()>> main_tasks_;
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "AudioDevice.h"
|
||||
#include "Board.h"
|
||||
#include "audio_device.h"
|
||||
#include "board.h"
|
||||
|
||||
#include <esp_log.h>
|
||||
#include <cstring>
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <string>
|
||||
#include <functional>
|
||||
|
||||
#include "Board.h"
|
||||
#include "board.h"
|
||||
|
||||
class AudioDevice {
|
||||
public:
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "AudioProcessor.h"
|
||||
#include "audio_processor.h"
|
||||
#include <esp_log.h>
|
||||
|
||||
#define PROCESSOR_RUNNING 0x01
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "Board.h"
|
||||
#include "SystemInfo.h"
|
||||
#include "board.h"
|
||||
#include "system_info.h"
|
||||
|
||||
#include <esp_log.h>
|
||||
#include <esp_ota_ops.h>
|
||||
@@ -2,8 +2,9 @@
|
||||
#define BOARD_H
|
||||
|
||||
#include "config.h"
|
||||
#include <Http.h>
|
||||
#include <WebSocket.h>
|
||||
|
||||
#include <http.h>
|
||||
#include <web_socket.h>
|
||||
#include <string>
|
||||
|
||||
void* create_board();
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "Ml307Board.h"
|
||||
#include "SystemReset.h"
|
||||
#include "ml307_board.h"
|
||||
#include "system_reset.h"
|
||||
#include "audio_device.h"
|
||||
|
||||
#include <esp_log.h>
|
||||
|
||||
#define TAG "CompactMl307Board"
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "WifiBoard.h"
|
||||
#include "SystemReset.h"
|
||||
#include "wifi_board.h"
|
||||
#include "system_reset.h"
|
||||
#include "audio_device.h"
|
||||
|
||||
#include <esp_log.h>
|
||||
|
||||
#define TAG "CompactWifiBoard"
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#define AUDIO_INPUT_SAMPLE_RATE 16000
|
||||
#define AUDIO_OUTPUT_SAMPLE_RATE 16000
|
||||
#define AUDIO_DEFAULT_OUTPUT_VOLUME 70
|
||||
#define AUDIO_DEFAULT_OUTPUT_VOLUME 90
|
||||
|
||||
#define AUDIO_INPUT_REFERENCE true
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "WifiBoard.h"
|
||||
#include "BoxAudioDevice.h"
|
||||
#include "wifi_board.h"
|
||||
#include "box_audio_device.h"
|
||||
|
||||
#include <esp_log.h>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "Ml307Board.h"
|
||||
#include "BoxAudioDevice.h"
|
||||
#include "ml307_board.h"
|
||||
#include "box_audio_device.h"
|
||||
|
||||
#include <esp_log.h>
|
||||
#include <esp_spiffs.h>
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "Ml307Board.h"
|
||||
#include "BoxAudioDevice.h"
|
||||
#include "ml307_board.h"
|
||||
#include "box_audio_device.h"
|
||||
|
||||
#include <esp_log.h>
|
||||
#include <esp_spiffs.h>
|
||||
@@ -1,20 +0,0 @@
|
||||
#include "WifiBoard.h"
|
||||
#include "BoxAudioDevice.h"
|
||||
|
||||
#include <esp_log.h>
|
||||
|
||||
#define TAG "LiChuangDevBoard"
|
||||
|
||||
class LiChuangDevBoard : public WifiBoard {
|
||||
public:
|
||||
virtual void Initialize() override {
|
||||
ESP_LOGI(TAG, "Initializing LiChuangDevBoard");
|
||||
WifiBoard::Initialize();
|
||||
}
|
||||
|
||||
virtual AudioDevice* CreateAudioDevice() override {
|
||||
return new BoxAudioDevice();
|
||||
}
|
||||
};
|
||||
|
||||
DECLARE_BOARD(LiChuangDevBoard);
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#define AUDIO_INPUT_SAMPLE_RATE 24000
|
||||
#define AUDIO_OUTPUT_SAMPLE_RATE 24000
|
||||
#define AUDIO_DEFAULT_OUTPUT_VOLUME 80
|
||||
#define AUDIO_DEFAULT_OUTPUT_VOLUME 90
|
||||
|
||||
#define AUDIO_INPUT_REFERENCE true
|
||||
|
||||
|
||||
20
main/boards/lichuang-dev/lichuang_dev_board.cc
Normal file
20
main/boards/lichuang-dev/lichuang_dev_board.cc
Normal file
@@ -0,0 +1,20 @@
|
||||
#include "wifi_board.h"
|
||||
#include "box_audio_device.h"
|
||||
|
||||
#include <esp_log.h>
|
||||
|
||||
#define TAG "LichuangDevBoard"
|
||||
|
||||
class LichuangDevBoard : public WifiBoard {
|
||||
public:
|
||||
virtual void Initialize() override {
|
||||
ESP_LOGI(TAG, "Initializing LichuangDevBoard");
|
||||
WifiBoard::Initialize();
|
||||
}
|
||||
|
||||
virtual AudioDevice* CreateAudioDevice() override {
|
||||
return new BoxAudioDevice();
|
||||
}
|
||||
};
|
||||
|
||||
DECLARE_BOARD(LichuangDevBoard);
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "BoxAudioDevice.h"
|
||||
#include "Board.h"
|
||||
#include "box_audio_device.h"
|
||||
#include "board.h"
|
||||
|
||||
#include <esp_log.h>
|
||||
#include <cassert>
|
||||
@@ -1,7 +1,8 @@
|
||||
#ifndef _BOX_AUDIO_DEVICE_H
|
||||
#define _BOX_AUDIO_DEVICE_H
|
||||
|
||||
#include "AudioDevice.h"
|
||||
#include "audio_device.h"
|
||||
|
||||
#include <driver/i2c_master.h>
|
||||
#include <driver/i2s_tdm.h>
|
||||
#include <esp_codec_dev.h>
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "BuiltinLed.h"
|
||||
#include "Board.h"
|
||||
#include "builtin_led.h"
|
||||
#include "board.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <esp_log.h>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "Button.h"
|
||||
#include "button.h"
|
||||
|
||||
#include <esp_log.h>
|
||||
|
||||
static const char* TAG = "Button";
|
||||
@@ -6,9 +6,9 @@
|
||||
#include <string>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "Display.h"
|
||||
#include "Board.h"
|
||||
#include "Application.h"
|
||||
#include "display.h"
|
||||
#include "board.h"
|
||||
#include "application.h"
|
||||
|
||||
#define TAG "Display"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
## IDF Component Manager Manifest File
|
||||
dependencies:
|
||||
78/esp-wifi-connect: "~1.2.0"
|
||||
78/esp-opus-encoder: "~1.0.2"
|
||||
78/esp-ml307: "~1.3.0"
|
||||
78/esp-wifi-connect: "~1.3.0"
|
||||
78/esp-opus-encoder: "~1.1.0"
|
||||
78/esp-ml307: "~1.4.0"
|
||||
espressif/led_strip: "^2.4.1"
|
||||
espressif/esp_codec_dev: "^1.3.1"
|
||||
espressif/esp-sr: "^1.9.0"
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
#include <driver/gpio.h>
|
||||
#include <esp_event.h>
|
||||
|
||||
#include "Application.h"
|
||||
#include "SystemInfo.h"
|
||||
#include "application.h"
|
||||
#include "system_info.h"
|
||||
|
||||
#define TAG "main"
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#include "Ml307Board.h"
|
||||
#include "Application.h"
|
||||
#include "ml307_board.h"
|
||||
#include "application.h"
|
||||
|
||||
#include <esp_log.h>
|
||||
#include <Ml307Http.h>
|
||||
#include <Ml307SslTransport.h>
|
||||
#include <WebSocket.h>
|
||||
#include <esp_timer.h>
|
||||
#include <ml307_http.h>
|
||||
#include <ml307_ssl_transport.h>
|
||||
#include <web_socket.h>
|
||||
|
||||
static const char *TAG = "Ml307Board";
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#ifndef ML307_BOARD_H
|
||||
#define ML307_BOARD_H
|
||||
|
||||
#include "Board.h"
|
||||
#include <Ml307AtModem.h>
|
||||
#include "board.h"
|
||||
#include <ml307_at_modem.h>
|
||||
|
||||
class Ml307Board : public Board {
|
||||
protected:
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "FirmwareUpgrade.h"
|
||||
#include "SystemInfo.h"
|
||||
#include "Board.h"
|
||||
#include "ota.h"
|
||||
#include "system_info.h"
|
||||
#include "board.h"
|
||||
|
||||
#include <cJSON.h>
|
||||
#include <esp_log.h>
|
||||
@@ -13,28 +13,28 @@
|
||||
#include <sstream>
|
||||
#include <algorithm>
|
||||
|
||||
#define TAG "FirmwareUpgrade"
|
||||
#define TAG "Ota"
|
||||
|
||||
|
||||
FirmwareUpgrade::FirmwareUpgrade() {
|
||||
Ota::Ota() {
|
||||
}
|
||||
|
||||
FirmwareUpgrade::~FirmwareUpgrade() {
|
||||
Ota::~Ota() {
|
||||
}
|
||||
|
||||
void FirmwareUpgrade::SetCheckVersionUrl(std::string check_version_url) {
|
||||
void Ota::SetCheckVersionUrl(std::string check_version_url) {
|
||||
check_version_url_ = check_version_url;
|
||||
}
|
||||
|
||||
void FirmwareUpgrade::SetHeader(const std::string& key, const std::string& value) {
|
||||
void Ota::SetHeader(const std::string& key, const std::string& value) {
|
||||
headers_[key] = value;
|
||||
}
|
||||
|
||||
void FirmwareUpgrade::SetPostData(const std::string& post_data) {
|
||||
void Ota::SetPostData(const std::string& post_data) {
|
||||
post_data_ = post_data;
|
||||
}
|
||||
|
||||
void FirmwareUpgrade::CheckVersion() {
|
||||
void Ota::CheckVersion() {
|
||||
std::string current_version = esp_app_get_description()->version;
|
||||
ESP_LOGI(TAG, "Current version: %s", current_version.c_str());
|
||||
|
||||
@@ -101,7 +101,7 @@ void FirmwareUpgrade::CheckVersion() {
|
||||
}
|
||||
}
|
||||
|
||||
void FirmwareUpgrade::MarkCurrentVersionValid() {
|
||||
void Ota::MarkCurrentVersionValid() {
|
||||
auto partition = esp_ota_get_running_partition();
|
||||
if (strcmp(partition->label, "factory") == 0) {
|
||||
ESP_LOGI(TAG, "Running from factory partition, skipping");
|
||||
@@ -121,7 +121,7 @@ void FirmwareUpgrade::MarkCurrentVersionValid() {
|
||||
}
|
||||
}
|
||||
|
||||
void FirmwareUpgrade::Upgrade(const std::string& firmware_url) {
|
||||
void Ota::Upgrade(const std::string& firmware_url) {
|
||||
ESP_LOGI(TAG, "Upgrading firmware from %s", firmware_url.c_str());
|
||||
esp_ota_handle_t update_handle = 0;
|
||||
auto update_partition = esp_ota_get_next_update_partition(NULL);
|
||||
@@ -232,12 +232,12 @@ void FirmwareUpgrade::Upgrade(const std::string& firmware_url) {
|
||||
esp_restart();
|
||||
}
|
||||
|
||||
void FirmwareUpgrade::StartUpgrade(std::function<void(int progress, size_t speed)> callback) {
|
||||
void Ota::StartUpgrade(std::function<void(int progress, size_t speed)> callback) {
|
||||
upgrade_callback_ = callback;
|
||||
Upgrade(firmware_url_);
|
||||
}
|
||||
|
||||
std::vector<int> FirmwareUpgrade::ParseVersion(const std::string& version) {
|
||||
std::vector<int> Ota::ParseVersion(const std::string& version) {
|
||||
std::vector<int> versionNumbers;
|
||||
std::stringstream ss(version);
|
||||
std::string segment;
|
||||
@@ -249,7 +249,7 @@ std::vector<int> FirmwareUpgrade::ParseVersion(const std::string& version) {
|
||||
return versionNumbers;
|
||||
}
|
||||
|
||||
bool FirmwareUpgrade::IsNewVersionAvailable(const std::string& currentVersion, const std::string& newVersion) {
|
||||
bool Ota::IsNewVersionAvailable(const std::string& currentVersion, const std::string& newVersion) {
|
||||
std::vector<int> current = ParseVersion(currentVersion);
|
||||
std::vector<int> newer = ParseVersion(newVersion);
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#ifndef _FIRMWARE_UPGRADE_H
|
||||
#define _FIRMWARE_UPGRADE_H
|
||||
#ifndef _OTA_H
|
||||
#define _OTA_H
|
||||
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
||||
class FirmwareUpgrade {
|
||||
class Ota {
|
||||
public:
|
||||
FirmwareUpgrade();
|
||||
~FirmwareUpgrade();
|
||||
Ota();
|
||||
~Ota();
|
||||
|
||||
void SetCheckVersionUrl(std::string check_version_url);
|
||||
void SetHeader(const std::string& key, const std::string& value);
|
||||
@@ -32,4 +32,4 @@ private:
|
||||
bool IsNewVersionAvailable(const std::string& currentVersion, const std::string& newVersion);
|
||||
};
|
||||
|
||||
#endif // _FIRMWARE_UPGRADE_H
|
||||
#endif // _OTA_H
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "SystemInfo.h"
|
||||
#include "system_info.h"
|
||||
|
||||
#include <freertos/task.h>
|
||||
#include <esp_log.h>
|
||||
#include <esp_flash.h>
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "SystemReset.h"
|
||||
#include "system_reset.h"
|
||||
|
||||
#include <esp_log.h>
|
||||
#include <nvs_flash.h>
|
||||
#include <driver/gpio.h>
|
||||
@@ -1,10 +1,10 @@
|
||||
#include "wake_word_detect.h"
|
||||
#include "application.h"
|
||||
|
||||
#include <esp_log.h>
|
||||
#include <model_path.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include "WakeWordDetect.h"
|
||||
#include "Application.h"
|
||||
|
||||
#define DETECTION_RUNNING_EVENT 1
|
||||
#define WAKE_WORD_ENCODED_EVENT 2
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#ifndef WAKE_WORD_DETECT_H
|
||||
#define WAKE_WORD_DETECT_H
|
||||
|
||||
#include <esp_afe_sr_models.h>
|
||||
#include <esp_nsn_models.h>
|
||||
|
||||
#include <freertos/FreeRTOS.h>
|
||||
#include <freertos/task.h>
|
||||
#include <freertos/event_groups.h>
|
||||
|
||||
#include <esp_afe_sr_models.h>
|
||||
#include <esp_nsn_models.h>
|
||||
|
||||
#include <list>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -1,18 +1,19 @@
|
||||
#include "WifiBoard.h"
|
||||
#include "Application.h"
|
||||
#include "WifiStation.h"
|
||||
#include "WifiConfigurationAp.h"
|
||||
#include "SystemInfo.h"
|
||||
#include "BuiltinLed.h"
|
||||
#include "wifi_board.h"
|
||||
#include "application.h"
|
||||
#include "system_info.h"
|
||||
#include "builtin_led.h"
|
||||
|
||||
#include <freertos/FreeRTOS.h>
|
||||
#include <freertos/task.h>
|
||||
#include <EspHttp.h>
|
||||
#include <TcpTransport.h>
|
||||
#include <TlsTransport.h>
|
||||
#include <WebSocket.h>
|
||||
#include <esp_http.h>
|
||||
#include <tcp_transport.h>
|
||||
#include <tls_transport.h>
|
||||
#include <web_socket.h>
|
||||
#include <esp_log.h>
|
||||
|
||||
#include <wifi_station.h>
|
||||
#include <wifi_configuration_ap.h>
|
||||
|
||||
static const char *TAG = "WifiBoard";
|
||||
|
||||
static std::string rssi_to_string(int rssi) {
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef WIFI_BOARD_H
|
||||
#define WIFI_BOARD_H
|
||||
|
||||
#include "Board.h"
|
||||
#include "board.h"
|
||||
|
||||
class WifiBoard : public Board {
|
||||
protected:
|
||||
Reference in New Issue
Block a user