# NOAH-D Serial Protocol Draft

This is a protocol draft only. No serial port is opened by the current software.

## Transport

Future candidates:

- USB serial to microcontroller
- local robot bridge over localhost or private LAN
- WebSerial only after visible UI approval and hardware gate

## Messages

All messages are newline-delimited JSON in the later design.

```json
{"type":"HELLO","version":"noah-d-1"}
{"type":"STATUS"}
{"type":"STOP"}
{"type":"ESTOP"}
{"type":"DRIVE_FORWARD","distanceCm":10,"speedLevel":"low","timeoutMs":3000}
{"type":"DRIVE_BACKWARD","distanceCm":10,"speedLevel":"low","timeoutMs":3000}
{"type":"TURN_LEFT","angleDeg":30,"speedLevel":"low","timeoutMs":3000}
{"type":"TURN_RIGHT","angleDeg":30,"speedLevel":"low","timeoutMs":3000}
{"type":"BATTERY_STATUS"}
{"type":"BUMPER_STATUS"}
{"type":"ACK","requestId":"..."}
{"type":"ERROR","requestId":"...","reason":"..."}
```

## Hardware Rules

- `ESTOP` must cut motion immediately.
- `STOP` must stop motion and keep controller alive.
- Controller starts with motors off.
- Controller ignores unknown messages.
- Controller rejects motion when emergency stop, bumper, undervoltage, or timeout
  state is active.
- No autonomous motion in firmware setup.

