47: CPU2 Sleep โ
๐งช Alpha
This message is specified, but not actively used by the Toit SDK at this time.
Request CPU2 sleep or WiFi override behaviour. For METHOD_SET, Header Duration (7) controls how long a forced WiFi override remains active. The same Duration timeout applies to both force-on and force-off modes.
Header โ
| Field | Name | Description | Type |
|---|---|---|---|
| 5 | Method | Request a service to be perform an action Possible values:
| uint8 |
| 7 | Duration | To be used with the SUBSCRIBE method, or actions that can be timed. When used with a timed action: This defines how long the action should go on for. When used with the SUBSCRIBE method: This defines a duration to keep the subscription active for. A value of 0 means the subscription is indefinite until explicitly unsubscribed. An ACK with EXPIRED status code will be sent if the subscription duration elapses without being renewed with a new subscription request. | uint32 |
Payload โ
| Field | Name | Description | Type | Unit |
|---|---|---|---|---|
| 2 | Wake on Event | Should CPU1 wake up CPU2 on new events / messages | bool | |
| 10 | WiFi Override Mode | Forced WiFi override mode. Possible values:
| uint8 |
Examples โ
Force WiFi on to disable ESP hibernation
Send METHOD_SET with wifiOnOff=1 and wakeOnEvent=0. Set Header Duration (7) to define the forced-on time in ms. This forces WiFi on and prevents the ESP hibernate path while the override is active. If Duration is omitted, the forced-on state remains until changed by a later request.Clear WiFi override (return to normal behavior)
Send METHOD_SET with wifiOnOff=2. This clears any forced WiFi override immediately, without forcing ON or OFF.Code โ
For convenience, the following constants can be used to reference this message type.