Skip to content

Harmonize "get wifi.enabled" reply to on/off - #3438

Open
shleepong wants to merge 2 commits into
meshcore-dev:devfrom
shleepong:upstream/wifi-enabled-on-off
Open

shleepong wants to merge 2 commits into
meshcore-dev:devfrom
shleepong:upstream/wifi-enabled-on-off

Conversation

@shleepong

Copy link
Copy Markdown

What

Changes get wifi.enabled to reply on/off instead of a bare 1/0.

Why

Every other boolean get in this codebase replies on/off: radio.rxgain (CommonRadioPrefs.cpp) and radio.fem.rxgain (HeltecV4Board.cpp). get wifi.enabled was the one outlier.

A question before merging

This changes an existing CLI reply format. If any client (app, script, meshcore-cli, etc.) already parses the raw 1/0 value, this would be a breaking change for it. Flagging this explicitly rather than assuming it's risk-free -- happy to adjust the approach if there's a compatibility concern I'm not aware of.

Compile-verified against current dev (heltec_v4_companion_radio_ble).

🤖 Generated with Claude Code

Every other boolean get in this codebase replies "on"/"off":
radio.rxgain (CommonRadioPrefs.cpp) and radio.fem.rxgain
(HeltecV4Board.cpp). "get wifi.enabled" was the one outlier, replying
with a bare "1"/"0".

Note for reviewers: this changes an existing CLI reply format. If any
client already parses the raw "1"/"0" value, this would be a breaking
change for it -- flagging this explicitly rather than assuming it's
risk-free.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Blake-Latchford

Copy link
Copy Markdown

You should probably remove the comments.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Blake-Latchford

Copy link
Copy Markdown

Oh, have you actually executed the code and verified it does what you expect?

@Blake-Latchford Blake-Latchford left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Describe testing completed on hardware.

@liamcottle

Copy link
Copy Markdown
Member

This would then make the set wifi.enabled 0/1 out of sync with it's own get command, since the get wifi.enabled no longer replies with the same value that you just set.

The other get handlers, that reply with on/off also accept on/off in the set command, rather than 0/1.

So if this was to be changed for the getter, it should probably be changed for the setter as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants