Vehicle power control uses the primary Wi-Fi connection, with the managed FreeRTOS interface available. Firmware supplies the power actuator, execution results and observed power state.
Enable the model capability
Enable vehicle.power.control (bit 12, MOTO_POWER) in the model. It takes effect after signed CONFIG. Use matching ABI 8 headers and archives and complete first adding and primary connection.
Execute power commands
Handle MOTO_EVENT_VEHICLE_COMMAND when e.message == MOTO_POWER_SET:
| Field | Meaning |
|---|---|
e.target |
0 for the primary vehicle |
e.value |
0 off, 1 on |
e.deadline_ms |
Local execution deadline; check again before queued work executes |
Copy the whole event to the vehicle driver. Check that the session is still valid and controller interlocks permit execution. After the controller confirms the result, report using the original event:
moto_terminal_complete(terminal, &saved_event, MOTO_SUCCEEDED, 0);
Use MOTO_FAILED for confirmed failure or MOTO_UNKNOWN for an uncertain outcome. On MOTO_FULL, retain and retry only the report, not the power operation. Core integrations use moto_complete_command on the original Wi-Fi instance; do not substitute a managed handle.
Report observed power state
Include MOTO_CAP(MOTO_POWER) in the complete vehicle snapshot. Set state.values[MOTO_POWER] to 0 for off or 1 for on. For an unavailable reading, set both the corresponding present and unknown bits; unknown does not mean off.
The APP displays field 12 and disables power controls while it is unknown. Supply both completion results and telemetry. Slider position or a sent command does not establish controller state.
Connect the power hardware
Keep standby power for communications and reception of a later power-on command. Cutting power to the terminal and its radio prevents the APP from turning it on through that connection.
The P4 reference only switches its backlight while Wi-Fi and BLE remain active. Replace it with the real power actuator for production. Verify interlocks, failures, timeouts and a subsequent power-on after switching off.
