Add full FM band scan for building a station/channel list

New TunerService::scanFullFmBand(): tunes to the band bottom then seeks up
repeatedly (reusing the existing hardware-seek + RDS-name-poll machinery
from scanForStation()) until the sweep wraps back around, collecting every
station that clears the existing scan RSSI/SNR thresholds. Returns the
list without touching saved presets or leaving the tuner in any particular
place — callers decide what to do with the results.

New POST /api/tuner/scan/full endpoint (core::TunerFmScannedStation DTO,
serializeTunerFmBandScanJson). Blocks for the whole sweep like the existing
/api/tuner/scan.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0178rASQ6ZETPMUamvpoR2KR
This commit is contained in:
2026-08-18 07:50:28 +02:00
co-authored by Claude Sonnet 5
parent 8a69cbed08
commit 3a10ed75aa
6 changed files with 306 additions and 0 deletions
@@ -316,4 +316,24 @@ std::string serializeTunerScanJson(const TunerScanResult& result)
return out.str();
}
std::string serializeTunerFmBandScanJson(
const std::vector<TunerFmScannedStation>& stations)
{
std::ostringstream out;
out << "{\"stations\":[";
for (std::size_t i = 0; i < stations.size(); ++i) {
if (i > 0U) {
out << ',';
}
const auto& s = stations[i];
out << "{\"frequency_khz\":" << s.frequency.value()
<< ",\"rssi_dbuv\":" << static_cast<int>(s.rssiDbuV)
<< ",\"snr_db\":" << static_cast<int>(s.snrDb);
appendOptionalLabel(out, "station_name", s.stationName);
out << "}";
}
out << "]}";
return out.str();
}
} // namespace core