mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-06 20:26:12 +00:00
fix(repeater): hide name-bar power readout while APC is suppressed
The name-bar live-power readout was gated on the raw tx_apc pref, so after an upgrade with Auto pwr previously on, it kept showing a power value while the repeater was active — looking like APC was running even though it's forced off and power is pinned to the ceiling. Gate it on apcActive() instead (now public), matching the "--" lock in Settings. The radio page's TX line still shows the actual power, as before. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
885662beae
commit
11a3799a47
@@ -156,11 +156,6 @@ protected:
|
|||||||
// Overhear suppression only makes sense while repeating; gated behind its own
|
// Overhear suppression only makes sense while repeating; gated behind its own
|
||||||
// opt-in pref (Settings > Radio > Suppress dup).
|
// opt-in pref (Settings > Radio > Suppress dup).
|
||||||
bool wantsOverhearSuppress() const override { return _prefs.client_repeat && _prefs.repeat_suppress_dup; }
|
bool wantsOverhearSuppress() const override { return _prefs.client_repeat && _prefs.repeat_suppress_dup; }
|
||||||
// Adaptive Power Control is suppressed while repeating: a repeater wants full,
|
|
||||||
// consistent TX power for relay reach, and its feedback sources (own ACKs /
|
|
||||||
// own flood echoes) don't fire on forwarded traffic anyway. applyApc() then
|
|
||||||
// pins power to the ceiling.
|
|
||||||
bool apcActive() const { return _prefs.tx_apc && !_prefs.client_repeat; }
|
|
||||||
|
|
||||||
void sendFloodScoped(const TransportKey& scope, mesh::Packet* pkt, uint32_t delay_millis);
|
void sendFloodScoped(const TransportKey& scope, mesh::Packet* pkt, uint32_t delay_millis);
|
||||||
void sendFloodScoped(const ContactInfo& recipient, mesh::Packet* pkt, uint32_t delay_millis=0) override;
|
void sendFloodScoped(const ContactInfo& recipient, mesh::Packet* pkt, uint32_t delay_millis=0) override;
|
||||||
@@ -232,6 +227,11 @@ public:
|
|||||||
void saveRTCTime() { _store->saveRTCTime(); }
|
void saveRTCTime() { _store->saveRTCTime(); }
|
||||||
DataStore* getDataStore() const { return _store; }
|
DataStore* getDataStore() const { return _store; }
|
||||||
void applyApc(); // (re)initialise Adaptive Power Control from prefs
|
void applyApc(); // (re)initialise Adaptive Power Control from prefs
|
||||||
|
// Adaptive Power Control is suppressed while repeating: a repeater wants full,
|
||||||
|
// consistent TX power for relay reach, and its feedback sources (own ACKs /
|
||||||
|
// own flood echoes) don't fire on forwarded traffic anyway. applyApc() then
|
||||||
|
// pins power to the ceiling.
|
||||||
|
bool apcActive() const { return _prefs.tx_apc && !_prefs.client_repeat; }
|
||||||
|
|
||||||
// True when the optional repeater radio profile is a valid LoRa config.
|
// True when the optional repeater radio profile is a valid LoRa config.
|
||||||
bool repeaterProfileValid() const {
|
bool repeaterProfileValid() const {
|
||||||
|
|||||||
@@ -542,7 +542,11 @@ public:
|
|||||||
display.translateUTF8ToBlocks(filtered_name, _node_prefs->node_name, sizeof(filtered_name));
|
display.translateUTF8ToBlocks(filtered_name, _node_prefs->node_name, sizeof(filtered_name));
|
||||||
int rightEdge = renderBatteryIndicator(display, _task->getBattMilliVolts());
|
int rightEdge = renderBatteryIndicator(display, _task->getBattMilliVolts());
|
||||||
display.setColor(DisplayDriver::LIGHT);
|
display.setColor(DisplayDriver::LIGHT);
|
||||||
if (_node_prefs && _node_prefs->tx_apc) {
|
// Only show the live-power readout when APC is actually controlling power —
|
||||||
|
// not merely when the pref is set. While repeating APC is suppressed and
|
||||||
|
// power is pinned to the ceiling, so apcActive() is false and the name bar
|
||||||
|
// drops the readout (matching the "--" lock in Settings).
|
||||||
|
if (the_mesh.apcActive()) {
|
||||||
char pwr_buf[8];
|
char pwr_buf[8];
|
||||||
snprintf(pwr_buf, sizeof(pwr_buf), "%ddB", (int)radio_driver.getTxPower());
|
snprintf(pwr_buf, sizeof(pwr_buf), "%ddB", (int)radio_driver.getTxPower());
|
||||||
int pwr_w = display.getTextWidth(pwr_buf);
|
int pwr_w = display.getTextWidth(pwr_buf);
|
||||||
|
|||||||
Reference in New Issue
Block a user