Add device lock support and demo mode

Device lock (hardware lock of the DSP, independent of the app lock):
- detect a locked DSP from the 0x2C answer during connect and wait for the code
- unlock with 0x2D, optionally remember the code and unlock automatically
- set a new code (0x2F) from the device settings
- simulator: --lock CODE

Demo mode:
- switch in the settings starts a simulated DSP 204/408 inside the server
- real DSPs are disconnected and greyed out meanwhile and resume afterwards
- demo devices are never saved or exported; sim.py ships with the Pi image and EXEs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
GivouandClaude Opus 5.5 committed 2026-11-01 21:14:04 +01:00
1 parent fe13f261f7
commit 61400df667
13 files changed
+426 -38

No files matched your search

+18 -1
View File
@@ -36,7 +36,7 @@ All 16-bit words are little endian.
|-----|-----------|---------|---------|
| `10` | → | – | Handshake |
| `13` | → / ← | – / ASCII | Device info, answer starts with `DSP204` or `DSP408` |
| `2C` | → / ← | – / `[?][count]` | Number of presets (payload meaning partly *assumed*) |
| `2C` | → / ← | – / `[time lock][4 bytes][device lock]` | Lock state, see [Device lock](#device-lock) |
| `22`, `14` | → | – | Init queries (sent during connect, content unknown) |
| `29` | → / ← | `[idx]` / `[idx][name…]` | Preset name (idx 0-based) |
| `20` | → | `[idx+1]` | Recall preset |
@@ -45,6 +45,9 @@ All 16-bit words are little endian.
| `27` | → | `[chunk]` | Request config chunk |
| `24` | ← | `[chunk][50 bytes]` | Config chunk; 204: chunks 0…14, 408: 0…28 |
| `12` | → | – | Status (sent after the dump) |
| `2D` | → / ← | `[0][code 4]` / `[0][result]` | Unlock with the lock code, result `1` = unlocked, `0` = wrong code |
| `2F` | → | `[code 4]` | Set a new lock code |
| `11` | → | – | Sent after setting a lock code (meaning not fully known) |
| `40` | → / ← | – / meters | Read levels (also serves as keepalive) |
### Meter answer
@@ -126,6 +129,20 @@ or within the outputs):
* A member with mask `00` that is not part of a group ignores changes: when unlinking, give every channel its own
bit again.
## Device lock
The DSP can be protected with a 4-character code (digits and upper-case letters, e.g. `A1BA`, sent as ASCII).
* During connect, the answer to `2C` reports the lock state: byte 5 ≠ 0 means the device is locked. Byte 0 and
bytes 1–4 belong to a separate time-based lock that this app does not use.
* A locked device waits for `2D [00][code]` before the rest of the initialisation (`22`, `14`, preset names, dump).
The answer `2D [00][01]` means unlocked, `2D [00][00]` wrong code.
* `2F [code]` stores a new code; the control software sends `11` afterwards. The device asks for the new code from
the next connection on. A command to remove the lock is not known.
Status: derived from the behaviour of the control software and implemented against the simulator; **not yet
verified on a real device**.
## Config dump = memory image
Chunk `n` carries bytes `n·50 … n·50+49` of the device memory image.