pm5: hw bwm wifipower, WiFi off or the modem power-save type
New `hw bwm wifipower [off|none|min|max]`. `off` turns the BWM's WiFi fully off (BLE-only, persisted; the same path as `hw bwm wifi stop`, and the module's default state). The other three set the ESP's persisted WiFi modem power-save type (CMD_PM5_BWM_WIFI_PS 0x0182, module commands 2052/2053, esp_wifi_set_ps()) used while WiFi is up: min (the ESP-IDF default, the modem sleeps between DTIM beacons), max (sleeps for the whole listen interval, lowest current, slower to react), none (modem always on, lowest latency). With no argument it reports whether WiFi is up at all and the stored type. Independent of `hw bwm powersave`. The link helper's "cmd failed" diagnostic is now printed only at debug level: a status query while WiFi is off fails by design and was cluttering every call. Verified on hardware: default reads min with WiFi off; none, max and min each set and read back; off tears WiFi down; an unknown value is rejected; max survives a module reboot. Not measured with WiFi associated. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
552276c75f
commit
5e1b04def1
8 files changed
+190
-25
No files matched your search
@@ -931,6 +931,14 @@ typedef struct {
|
||||
#define CMD_PM5_BWM_POWERSAVE 0x0181 // payload: [action:u8][state:u8 if SET]; resp: u8 applied state
|
||||
#define BWM_POWERSAVE_ACTION_GET 0x00
|
||||
#define BWM_POWERSAVE_ACTION_SET 0x01
|
||||
// PM5, BWM WiFi modem power-save type (persisted on the ESP). Used by `hw bwm wifipower`.
|
||||
#define CMD_PM5_BWM_WIFI_PS 0x0182 // payload: [action:u8][mode:u8 if SET]; resp: [mode:u8][wifi_state:u8, 0xFF = WiFi off]
|
||||
#define BWM_WIFI_PS_ACTION_GET 0x00
|
||||
#define BWM_WIFI_PS_ACTION_SET 0x01
|
||||
#define BWM_WIFI_PS_NONE 0 // modem never sleeps
|
||||
#define BWM_WIFI_PS_MIN 1 // sleeps between DTIM beacons (ESP-IDF default)
|
||||
#define BWM_WIFI_PS_MAX 2 // sleeps for the listen interval
|
||||
#define BWM_WIFI_STATE_OFF 0xFF // wifi_state byte: WiFi stack down (BLE-only)
|
||||
#define BWM_OTA_ACTION_BEGIN 0x00
|
||||
#define BWM_OTA_ACTION_WRITE 0x01
|
||||
#define BWM_OTA_ACTION_END 0x02
|
||||
|
||||
Reference in new issue
Block a user