mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-06 19:47:02 +03:00
Bell/cspot catchup - release
This commit is contained in:
@@ -70,7 +70,6 @@ set_target_properties(recovery.elf PROPERTIES LINK_LIBRARIES "${BCA};idf::app_re
|
|||||||
# create files with size for recovery
|
# create files with size for recovery
|
||||||
# build_size(recovery)
|
# build_size(recovery)
|
||||||
|
|
||||||
|
|
||||||
# build squeezelite, add app_squeezelite to the link
|
# build squeezelite, add app_squeezelite to the link
|
||||||
add_executable(squeezelite.elf "CMakeLists.txt")
|
add_executable(squeezelite.elf "CMakeLists.txt")
|
||||||
add_dependencies(squeezelite.elf recovery.elf)
|
add_dependencies(squeezelite.elf recovery.elf)
|
||||||
|
|||||||
@@ -52,10 +52,6 @@ size_t BellDSP::process(uint8_t* data, size_t bytes, int channels,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t bytesPerSample = channels * 2;
|
|
||||||
|
|
||||||
size_t samplesLeftInBuffer = buffer->audioBuffer->size() / bytesPerSample;
|
|
||||||
|
|
||||||
// Create a StreamInfo object to pass to the pipeline
|
// Create a StreamInfo object to pass to the pipeline
|
||||||
auto streamInfo = std::make_unique<StreamInfo>();
|
auto streamInfo = std::make_unique<StreamInfo>();
|
||||||
streamInfo->numChannels = channels;
|
streamInfo->numChannels = channels;
|
||||||
|
|||||||
@@ -118,7 +118,6 @@ class CentralAudioBuffer {
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto readBytes =
|
|
||||||
audioBuffer->read((uint8_t*)&lastReadChunk, sizeof(AudioChunk));
|
audioBuffer->read((uint8_t*)&lastReadChunk, sizeof(AudioChunk));
|
||||||
currentSampleRate = static_cast<uint32_t>(lastReadChunk.sampleRate);
|
currentSampleRate = static_cast<uint32_t>(lastReadChunk.sampleRate);
|
||||||
return &lastReadChunk;
|
return &lastReadChunk;
|
||||||
|
|||||||
@@ -184,8 +184,10 @@ BellHTTPServer::BellHTTPServer(int serverPort) {
|
|||||||
BELL_LOG(info, "HttpServer", "Server listening on port %d", serverPort);
|
BELL_LOG(info, "HttpServer", "Server listening on port %d", serverPort);
|
||||||
this->serverPort = serverPort;
|
this->serverPort = serverPort;
|
||||||
auto port = std::to_string(this->serverPort);
|
auto port = std::to_string(this->serverPort);
|
||||||
const char* options[] = {"listening_ports", port.c_str(), 0};
|
|
||||||
server = std::make_unique<CivetServer>(options);
|
civetWebOptions.push_back("listening_ports");
|
||||||
|
civetWebOptions.push_back(port);
|
||||||
|
server = std::make_unique<CivetServer>(civetWebOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<BellHTTPServer::HTTPResponse> BellHTTPServer::makeJsonResponse(
|
std::unique_ptr<BellHTTPServer::HTTPResponse> BellHTTPServer::makeJsonResponse(
|
||||||
|
|||||||
@@ -50,10 +50,12 @@ void HTTPClient::Response::rawRequest(const std::string& url,
|
|||||||
}
|
}
|
||||||
|
|
||||||
socketStream << reqEnd;
|
socketStream << reqEnd;
|
||||||
|
|
||||||
// Write request body
|
// Write request body
|
||||||
if (content.size() > 0) {
|
if (content.size() > 0) {
|
||||||
socketStream.write((const char*)content.data(), content.size());
|
socketStream.write((const char*)content.data(), content.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
socketStream.flush();
|
socketStream.flush();
|
||||||
|
|
||||||
// Parse response
|
// Parse response
|
||||||
|
|||||||
@@ -12,8 +12,21 @@
|
|||||||
|
|
||||||
using namespace bell::X509Bundle;
|
using namespace bell::X509Bundle;
|
||||||
|
|
||||||
|
typedef struct crt_bundle_t {
|
||||||
|
const uint8_t** crts;
|
||||||
|
uint16_t num_certs;
|
||||||
|
size_t x509_crt_bundle_len;
|
||||||
|
} crt_bundle_t;
|
||||||
|
|
||||||
|
static std::vector<uint8_t> bundleBytes;
|
||||||
|
|
||||||
|
static constexpr auto TAG = "X509Bundle";
|
||||||
|
static constexpr auto CRT_HEADER_OFFSET = 4;
|
||||||
|
static constexpr auto BUNDLE_HEADER_OFFSET = 2;
|
||||||
|
|
||||||
static mbedtls_x509_crt s_dummy_crt;
|
static mbedtls_x509_crt s_dummy_crt;
|
||||||
static bool s_should_verify_certs = false;
|
static bool s_should_verify_certs = false;
|
||||||
|
static crt_bundle_t s_crt_bundle;
|
||||||
|
|
||||||
#ifndef MBEDTLS_PRIVATE
|
#ifndef MBEDTLS_PRIVATE
|
||||||
#define MBEDTLS_PRIVATE(member) member
|
#define MBEDTLS_PRIVATE(member) member
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ class BellHTTPServer : public CivetHandler {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<CivetServer> server;
|
std::unique_ptr<CivetServer> server;
|
||||||
|
std::vector<std::string> civetWebOptions;
|
||||||
int serverPort = 8080;
|
int serverPort = 8080;
|
||||||
|
|
||||||
Router getRequestsRouter;
|
Router getRequestsRouter;
|
||||||
|
|||||||
@@ -9,19 +9,6 @@
|
|||||||
|
|
||||||
namespace bell::X509Bundle {
|
namespace bell::X509Bundle {
|
||||||
|
|
||||||
typedef struct crt_bundle_t {
|
|
||||||
const uint8_t** crts;
|
|
||||||
uint16_t num_certs;
|
|
||||||
size_t x509_crt_bundle_len;
|
|
||||||
} crt_bundle_t;
|
|
||||||
|
|
||||||
static crt_bundle_t s_crt_bundle;
|
|
||||||
static std::vector<uint8_t> bundleBytes;
|
|
||||||
|
|
||||||
static constexpr auto TAG = "X509Bundle";
|
|
||||||
static constexpr auto CRT_HEADER_OFFSET = 4;
|
|
||||||
static constexpr auto BUNDLE_HEADER_OFFSET = 2;
|
|
||||||
|
|
||||||
int crtCheckCertificate(mbedtls_x509_crt* child, const uint8_t* pub_key_buf,
|
int crtCheckCertificate(mbedtls_x509_crt* child, const uint8_t* pub_key_buf,
|
||||||
size_t pub_key_len);
|
size_t pub_key_len);
|
||||||
/* This callback is called for every certificate in the chain. If the chain
|
/* This callback is called for every certificate in the chain. If the chain
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ extern "C" {
|
|||||||
#include "aes.h" // for AES_ECB_decrypt, AES_init_ctx, AES_ctx
|
#include "aes.h" // for AES_ECB_decrypt, AES_init_ctx, AES_ctx
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static unsigned char DHGenerator[1] = {2};
|
||||||
|
|
||||||
CryptoMbedTLS::CryptoMbedTLS() {}
|
CryptoMbedTLS::CryptoMbedTLS() {}
|
||||||
|
|
||||||
CryptoMbedTLS::~CryptoMbedTLS() {
|
CryptoMbedTLS::~CryptoMbedTLS() {
|
||||||
|
|||||||
@@ -21,9 +21,6 @@ const static unsigned char DHPrime[] = {
|
|||||||
0xf2, 0x5f, 0x14, 0x37, 0x4f, 0xe1, 0x35, 0x6d, 0x6d, 0x51, 0xc2, 0x45,
|
0xf2, 0x5f, 0x14, 0x37, 0x4f, 0xe1, 0x35, 0x6d, 0x6d, 0x51, 0xc2, 0x45,
|
||||||
0xe4, 0x85, 0xb5, 0x76, 0x62, 0x5e, 0x7e, 0xc6, 0xf4, 0x4c, 0x42, 0xe9,
|
0xe4, 0x85, 0xb5, 0x76, 0x62, 0x5e, 0x7e, 0xc6, 0xf4, 0x4c, 0x42, 0xe9,
|
||||||
0xa6, 0x3a, 0x36, 0x20, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
|
0xa6, 0x3a, 0x36, 0x20, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
|
||||||
|
|
||||||
static unsigned char DHGenerator[1] = {2};
|
|
||||||
|
|
||||||
class CryptoMbedTLS {
|
class CryptoMbedTLS {
|
||||||
private:
|
private:
|
||||||
mbedtls_md_context_t sha1Context;
|
mbedtls_md_context_t sha1Context;
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
syntax = "proto2";
|
|
||||||
|
|
||||||
enum CpuFamily {
|
enum CpuFamily {
|
||||||
CPU_UNKNOWN = 0x0;
|
CPU_UNKNOWN = 0x0;
|
||||||
CPU_X86 = 0x1;
|
CPU_X86 = 0x1;
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
syntax = "proto2";
|
|
||||||
|
|
||||||
message LoginCryptoDiffieHellmanChallenge {
|
message LoginCryptoDiffieHellmanChallenge {
|
||||||
required bytes gs = 0xa;
|
required bytes gs = 0xa;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
syntax = "proto2";
|
|
||||||
|
|
||||||
message Header {
|
message Header {
|
||||||
optional string uri = 0x01;
|
optional string uri = 0x01;
|
||||||
optional string method = 0x03;
|
optional string method = 0x03;
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
syntax = "proto2";
|
|
||||||
|
|
||||||
enum MessageType {
|
enum MessageType {
|
||||||
kMessageTypeHello = 0x1;
|
kMessageTypeHello = 0x1;
|
||||||
kMessageTypeGoodbye = 0x2;
|
kMessageTypeGoodbye = 0x2;
|
||||||
|
|||||||
Reference in New Issue
Block a user