Add BT1035 pairing and station presets (fw 0.7.0).
Expose discoverable mode and A2DP control over REST, add persisted DAB/FM preset list with web UI, and document gaps in docs/TODO.md. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* @file BluetoothJson.cpp
|
||||
* @brief BluetoothJson implementation.
|
||||
*
|
||||
* DigiRadio firmware — https://github.com/manvalan/DigiRadio
|
||||
*
|
||||
* Copyright 2026 Michele Bigi
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* @author Michele Bigi
|
||||
* @date 2026-07-06
|
||||
*/
|
||||
|
||||
#include "core/BluetoothJson.hpp"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace core {
|
||||
|
||||
std::string serializeBluetoothStatusJson(const BluetoothStatus& status)
|
||||
{
|
||||
std::ostringstream out;
|
||||
out << "{\"booted\":" << (status.booted ? "true" : "false")
|
||||
<< ",\"pairing\":" << (status.pairing ? "true" : "false")
|
||||
<< ",\"a2dp\":\"" << a2dpStateToken(status.a2dpState) << "\"}";
|
||||
return out.str();
|
||||
}
|
||||
|
||||
std::string serializeBluetoothErrorJson(const char* reason)
|
||||
{
|
||||
std::ostringstream out;
|
||||
out << "{\"status\":\"error\",\"reason\":\"" << reason << "\"}";
|
||||
return out.str();
|
||||
}
|
||||
|
||||
} // namespace core
|
||||
Reference in New Issue
Block a user