Medius - Native APIAdmin

Admin

Reset, reboot, and logs

Three frames that manage the box rather than inject input: RESET, REBOOT, and LOG.

RESET

Back to pure passthrough

RESET drops all injection and returns the box to plain passthrough. Opcode 0x04.

RESET 0x04 · payload 0 bytes

Fire-and-forget

PAYLOAD

No payload (LEN is 0).

EFFECT

Zeroes the accumulators (accX, accY, accWheel) and sets every INJECT override back to none, so injected-held buttons and keys release and the real device passes through. The report is then byte-identical to passthrough; sending it twice is a no-op. This is what the safety auto-clear performs. Library binding: reset.

EXAMPLE

A bare RESET:

+--------+--------+--------+--------+--------+
| A5     | 04     | 00     | 00 00  | lo hi  |
+--------+--------+--------+--------+--------+
| SOF    | TYPE   | SEQ    | LEN    | CRC16  |
+--------+--------+--------+--------+--------+

REBOOT

Restart a chip

REBOOT restarts one of the box's two chips, mainly to enter ROM download mode (the chip's built-in bootloader, which accepts new firmware) for flashing. Opcode 0x07.

REBOOT 0x07 · payload 1 byte

Fire-and-forget

PAYLOAD
OffsetFieldTypeNotes
0targetu8which chip and mode (see below)
TARGETS
TargetValueEffect
device download0Device chip enters ROM download, then flash over the CH343 link.
host download1Device relays a download reboot to the host chip; the host flashes over its own USB.
device run2Device chip reboots to run firmware.
host run3Device relays a run reboot to the host chip.
EFFECT

Reboot-to-run (2 or 3) is the only software cold-reboot on this board; DTR/RTS auto-reset is not wired. No reply: the chip is rebooting. See Flashing. Library binding: reboot.

EXAMPLE

target = 2 (device chip to run):

+--------+--------+--------+--------+--------+--------+
| A5     | 07     | 00     | 01 00  | 02     | lo hi  |
+--------+--------+--------+--------+--------+--------+
| SOF    | TYPE   | SEQ    | LEN    | target | CRC16  |
+--------+--------+--------+--------+--------+--------+

LOG

Device diagnostics

LOG is diagnostic text the box sends on its own, in place of an ASCII console. Opcode 0x08.

LOG 0x08 · box → PC

Unsolicited

PAYLOAD
OffsetFieldTypeNotes
0levelu8severity (see below)
1..textUTF-8the log line, not NUL-terminated, length = LEN - 1
LEVELS
ValueLevel
0error
1warn
2info
3debug
4verbose
EFFECT

Emitted only while a control PC is attached; logging before first contact is dropped. The box's other outbound frame is RESP. Library binding: logs.

EXAMPLE

level = 2 (info), text hi (68 69):

+--------+--------+--------+--------+--------+--------+--------+
| A5     | 08     | 00     | 03 00  | 02     | 68 69  | lo hi  |
+--------+--------+--------+--------+--------+--------+--------+
| SOF    | TYPE   | SEQ    | LEN    | level  | text   | CRC16  |
+--------+--------+--------+--------+--------+--------+--------+