mirror of
https://github.com/liquidraver/ZephCore.git
synced 2026-09-02 02:39:30 +00:00
SmartCAD p1
This commit is contained in:
@@ -59,6 +59,8 @@ class Dispatcher {
|
||||
uint32_t radio_nonrx_start;
|
||||
uint32_t next_agc_reset_time;
|
||||
bool prev_isrecv_mode;
|
||||
int8_t cad_offset_shadow;
|
||||
bool cad_offset_shadow_valid;
|
||||
uint32_t n_sent_flood, n_sent_direct;
|
||||
uint32_t n_recv_flood, n_recv_direct;
|
||||
tx_queued_callback_t _tx_queued_cb;
|
||||
@@ -89,6 +91,9 @@ protected:
|
||||
virtual int getInterferenceThreshold() const { return 0; }
|
||||
virtual int getAGCResetInterval() const { return 0; }
|
||||
virtual uint32_t getDutyCycleWindowMs() const { return 3600000UL; } /* 1h default */
|
||||
/* Adaptive CAD: called when the auto staircase moved the operating
|
||||
* detPeak offset — subclasses persist it to prefs. */
|
||||
virtual void onCadOffsetChanged(int8_t offset) { (void)offset; }
|
||||
|
||||
public:
|
||||
void begin();
|
||||
|
||||
@@ -41,6 +41,23 @@ public:
|
||||
virtual void setTxPowerReduction(int8_t reduction_db) { (void)reduction_db; }
|
||||
virtual int8_t getTxPowerReduction() const { return 0; }
|
||||
|
||||
/* Adaptive CAD (LBT detPeak calibration). Default no-ops for radios
|
||||
* without hardware CAD (SX127x). */
|
||||
virtual void setCadParams(bool auto_enabled, int8_t offset,
|
||||
uint16_t probe_interval_s) {
|
||||
(void)auto_enabled; (void)offset; (void)probe_interval_s;
|
||||
}
|
||||
/* One housekeeping tick of the CAD calibrator: maybe run a probe,
|
||||
* update stats, maybe step the staircase (auto mode). */
|
||||
virtual void cadMaintenance() {}
|
||||
virtual int8_t getCadOffset() const { return 0; }
|
||||
virtual void resetCadStats() {}
|
||||
/* Writes a human-readable status block; returns chars written (0 = not
|
||||
* supported by this radio). */
|
||||
virtual int formatCadStatus(char *buf, int cap) {
|
||||
(void)buf; (void)cap; return 0;
|
||||
}
|
||||
|
||||
/* Packet statistics */
|
||||
virtual uint32_t getPacketsRecv() const { return 0; }
|
||||
virtual uint32_t getPacketsSent() const { return 0; }
|
||||
|
||||
Reference in New Issue
Block a user