🏠 Home → Software → RTLV → Commands (downlink) — GPIO (FPort 4)
🤖 Auto-generated from firmware (SSOT). Do not hand-edit — change the descriptor and regenerate. RTLV v3 ·
source_hash eb6b51128c1b
A downlink command = [cmd_id][len][params…] — no envelope, no prefix; multi-byte params are BE unless stated. Full command model on the Overview.
| Port.Cmd | Name | Kind | Params | Magic | Example (request) | Notes (verified) |
|---|---|---|---|---|---|---|
4.0x01 |
gpio_get_config (TLV) | query | — | body=[0x01][LEN][tlv_id...] key list, or [0x01][0x01][0xFF]=all. tlv_id=(gpio<<4)|param. src lorawan_commands_port4.c:525 | ||
4.0x02 |
gpio_set_config (TLV) | config | [0x0] mode:uint8 {0=disabled, 1=security, 2=counter}; [0x1] edge_mode:uint8 {0=both, 1=rising, 2=falling}; [0x2] min_pulse_ms:uint16 BE; [0x3] min_pause_ms:uint16 BE; [0x4] show_interval:uint8 {0=off, 1=on}; [0x5] show_total:uint8 {0=off, 1=on}; [0x6] pull_mode:uint8 {0=none, 1=up, 2=down}; [0x7] total_rising:uint32 BE; [0x8] total_falling:uint32 BE; [0x9] interval_rising:uint32 BE; [0xA] interval_falling:uint32 BE; [0xB] unit_type:uint8; [0xC] pulse_weight:uint32 BE; [0xD] normal_state:uint8 {0=NO, 1=NC}; [0xE] debounce_ms:uint16 BE; [0xF] lorawan_enabled:uint8 |
body=[0x02][LEN][tlv_id][len][val]...; tlv_id=(gpio<<4)|index. src lorawan_commands_port4.c:299,626 | ||
4.0x30 |
dout_set_state ⚠️ | action | index:uint8; state:uint8 |
CMD_DOUT_SET_STATE — stub NOT_SUPPORTED (no HW). src lorawan_commands_port4.c:912 | ||
4.0x31 |
dout_pulse ⚠️ | action | index:uint8; duration_ms:uint32 BE |
CMD_DOUT_PULSE — stub NOT_SUPPORTED. | ||
4.0x32 |
dout_set_config ⚠️ (TLV) | config | index:uint8 |
CMD_DOUT_SET_CONFIG [index][TLVs] — stub NOT_SUPPORTED. | ||
4.0x33 |
dout_get_state ⚠️ | query | index:uint8 (opt) |
CMD_DOUT_GET_STATE [index] or empty=all — stub NOT_SUPPORTED. | ||
4.0x34 |
dout_get_config ⚠️ | query | index:uint8 (opt) |
CMD_DOUT_GET_CONFIG [index] or empty=all — stub NOT_SUPPORTED. |
Response — 0xF0 COMMAND_RESPONSE 7-byte envelope, then echo-TLVs @ offset 7 (decoded in the response FPort's namespace):
| Offset | Byte | Field | Meaning |
|---|---|---|---|
| 0 | F0 |
prefix | COMMAND_RESPONSE |
| 1 | LEN |
length | bytes after [F0][LEN]; 0x05 for the bare 7-byte header |
| 2 | — | cmd_id | echoed command id |
| 3 | — | status | 0=OK |
| 4 | — | error_code | command error |
| 5 | — | flags | response flags |
| 6 | — | protocol_version | =0x03 (TLV_PROTOCOL_VERSION) |
| 7… | — | echo-TLVs | port-scoped [tag][len][value] |
The
[0xF0][3]…forms in firmware docstrings are stale shorthand — never mirror them.
SET (0x02) carries a [tlv_id][len][val]… stream where tlv_id=(gpio_num<<4)|param_index, gpio 1–6; tlv_id ≤ 0x0F = batch (all GPIOs). The response echo is a re-read via get_gpio_param, not a verbatim copy of the input (lorawan_commands_port4.c:705).
| idx | param | type |
|---|---|---|
0x0 |
mode | uint8 |
0x1 |
edge_mode | uint8 |
0x2 |
min_pulse_ms | uint16 BE |
0x3 |
min_pause_ms | uint16 BE |
0x4 |
show_interval | uint8 |
0x5 |
show_total | uint8 |
0x6 |
pull_mode | uint8 |
0x7 |
total_rising | uint32 BE (SET 0 only) |
0x8 |
total_falling | uint32 BE (SET 0 only) |
0x9 |
interval_rising | uint32 BE (RO) |
0xA |
interval_falling | uint32 BE (RO) |
0xB |
unit_type | uint8 |
0xC |
pulse_weight | uint32 BE ×0.001 |
0xD |
normal_state | uint8 |
0xE |
debounce_ms | uint16 BE |
0xF |
lorawan_enabled | uint8 (WLE passthrough) |
Example SET response: F0 05 02 00 00 00 03 + re-read echo TLVs, e.g. 10 01 02 12 02 00 64.