Update native radio fixtures for saved switching controls

This commit is contained in:
mikecarper committed 2026-10-23 11:25:33 -07:00
1 parent 73789a64e8
commit e9f5d6f12f
2 files changed
+10 -1

No files matched your search

+9
View File
@@ -21,6 +21,7 @@ ROOT = Path(__file__).resolve().parents[1]
HARDWARE = r'''
#pragma once
#include <RadioProfiles.h>
#include <helpers/RadioSwitchTuning.h>
namespace mesh {
class RTCClock {public:virtual ~RTCClock()=default;virtual uint32_t getCurrentTime()=0;};
enum class RadioParamApplyResult:uint8_t {APPLIED,BUSY,FAILED};
@@ -37,6 +38,14 @@ class Radio {public:
virtual bool isInRecvMode()const{return true;}
virtual RadioProfiles* profiles()=0;
virtual const RadioProfiles* profiles()const=0;
// This scheduler fixture has no accelerated physical-radio transport. Match
// the production Radio defaults without accepting or persisting tuning.
virtual RadioSwitchCapabilities switchTuningCapabilities()const{return {};}
virtual RadioSwitchTuning switchTuning()const{return {};}
virtual uint32_t switchSpiHz()const{return 0;}
virtual bool configureBootSwitchTuning(const RadioSwitchTuning&){return false;}
virtual RadioParamApplyResult trySetSwitchTuning(const RadioSwitchTuning&,
bool(*)(void*,const RadioSwitchTuning&)=nullptr,void* =nullptr){return RadioParamApplyResult::FAILED;}
virtual bool validateProfile(const RadioProfileParams&)const=0;
virtual uint16_t profilePreamble(uint8_t)const=0;
virtual RadioParamApplyResult trySetPrimaryParams(const RadioProfileParams&,bool,const uint32_t*)=0;
+1 -1
View File
@@ -15,7 +15,7 @@ SANITIZERS = ["-fsanitize=address,undefined", "-fno-sanitize-recover=all", "-fno
def portable_radio_header():
"""Use the exact Radio interface without unrelated packet/crypto mocks."""
dispatcher = (ROOT / "src/Dispatcher.h").read_text(encoding="utf-8")
return ("#pragma once\n#include <RadioProfiles.h>\n#include <helpers/MorseTx.h>\n#include <helpers/MorseRx.h>\n#include <helpers/RegulatorMode.h>\n#include <helpers/TelemetryHistoryConfig.h>\nnamespace mesh {\n"
return ("#pragma once\n#include <RadioProfiles.h>\n#include <helpers/RadioSwitchTuning.h>\n#include <helpers/MorseTx.h>\n#include <helpers/MorseRx.h>\n#include <helpers/RegulatorMode.h>\n#include <helpers/TelemetryHistoryConfig.h>\nnamespace mesh {\n"
+ method(dispatcher, "enum class RadioParamApplyResult") + ";\n"
+ method(dispatcher, "class Radio {") + ";\n}\n")