#pragma once #include #include #include namespace roro::lora { // What a Sweep pass says about the band (M3, Q98): one RSSI reading (dBm) per step. struct SweepPeak { uint32_t hz; int dbm; }; struct SweepStats { int floor = 0; // the median: the band's noise floor, whatever a few signals do int top = 0; // the strongest reading std::vector peaks; // at most 3, strongest first, each a local maximum >= 10 dB above the floor }; SweepStats summarize(const int8_t* dbm, size_t steps, uint32_t fromHz, uint32_t stepHz); // The waterfall's colours: a reading between `low` and `high` dBm as 0..255, then RGB565 along // black, blue, cyan, green, yellow, red. uint8_t heatLevel(int dbm, int low, int high); uint16_t heatColor(uint8_t level); } // namespace roro::lora