Commands
Commands allow backend services to request device-side actions. In Infuse IoT, command workflows are represented by RPC messages.
Use RPC when a backend integration needs to trigger device behavior, request a reading, update runtime behavior, or invoke another command supported by the device firmware.
RPC Flow
- Confirm the target device exists with
GET /device/deviceId/{deviceId}. - Check state or last route if your command requires the device to have communicated recently.
- Build the RPC request using the active RPC definitions for the device firmware.
- Send the RPC with
POST /rpc. - Store the returned RPC message ID.
- Poll or read the message with
GET /rpc/{id}to inspect delivery and response state.
Wait Timeout And Route Reuse
POST /rpc accepts a sendWaitTimeoutMs value. If it is 0 or omitted, Infuse IoT sends the RPC immediately using the device's last known route. If it is set to a positive value, Infuse IoT can wait for the device to send a packet before attempting the downlink.
Choose the timeout based on your device's power and connectivity model:
| Device model | Recommended behavior |
|---|---|
| Always connected | Send immediately or use a short wait. |
| Low-power periodic wake | Use a wait timeout aligned with the expected wake interval. |
| Intermittent or field devices | Read last route and state before queuing operationally important commands. |
Definition-Driven Commands
RPC definitions describe the commands, structs, and enums used to encode and decode RPC payloads. Keep backend command builders aligned with the device firmware version and the definitions registered in Infuse IoT.
Use Definitions to understand the RPC definition registry.
Useful Endpoints
| Task | Endpoint |
|---|---|
| List RPC messages | GET /rpc |
| Send an RPC | POST /rpc |
| Read one RPC message | GET /rpc/{id} |
| Get latest RPC definitions | GET /defs/rpc |
| Get RPC definitions by version | GET /defs/rpc/{version} |
| Add RPC definition version | POST /defs/rpc |
For exact request and response schemas, see the Infuse IoT API reference.