cap_system — System info and device restart
Source: cap_system.c · Header: cap_system.h
Positioning
Section titled “Positioning”cap_system provides a unified entry point for runtime status queries and a controlled restart operation. It is a system-level tool group directly callable by the LLM, suitable for device diagnostics, health checks, and remote recovery.
Tools exposed to LLM
Section titled “Tools exposed to LLM”| Tool ID | Function | Input Parameters |
|---|---|---|
get_system_info | Return a system summary (chip, memory, CPU, Wi-Fi, IP, uptime) | (None) |
get_memory_info | Return memory details (internal memory, heap, PSRAM) | (None) |
get_cpu_usage | Return CPU usage and runtime stats | (None) |
get_wifi_info | Return current Wi-Fi status (SSID, RSSI, channel, etc.) | (None) |
get_ip_address | Return current station IP / netmask / gateway | (None) |
restart_device | Schedule a delayed device restart | delay_ms (optional, milliseconds) |
Response structure notes
Section titled “Response structure notes”get_system_infocombines multiple sub-objects:memory,cpu,wifi,ip.- If FreeRTOS runtime stats are not enabled,
get_cpu_usagereturnssupported: falseplus an explanatory message. - When not connected,
get_wifi_info/get_ip_addressreturnconnected: falsewith empty-value fields.
restart_device behavior
Section titled “restart_device behavior”delay_msis optional. If omitted or set to0, the default delay is used. Currently, the default is 500ms.- Restart is scheduled asynchronously: the tool returns success first, then a background task executes
esp_restart(). - On failure, it returns
ok: falsewith an error-code string.
Example:
Possible result: