MADMATCH SOM PROTOCOL SPECIFICATION
Technical documentation for integrating with the MadMatch SOM video stream and command protocol. Built for reliable, secure communication over TCP/IP or UART.
MadMatch SOM Video Stream Protocol
Each video frame is sent as a binary packet over TCP/IP. The packet begins with a fixed 32-byte header, followed by image data and metadata sections.
32-BYTE HEADER STRUCTURE
The header is fixed at 32 bytes and split into two 16-byte blocks.
| Offset | Size | Field | Description |
|---|---|---|---|
| 0 – 11 | 12 | Magic String | ASCII "MADEYE_EVENT" |
| 12 – 15 | 4 | Reserved | Unused (must be ignored) |
| 16 – 19 | 4 | Packet Size | Total packet size (big endian) |
| 20 – 31 | 12 | Reserved | Unused (must be ignored) |
PACKET LAYOUT (BYTE FLOW)
The structure of each video stream packet.
| Offset | Section | Description |
|---|---|---|
| 0 – 31 | Header (32 bytes) | Fixed header |
| 32 – 35 | Image Size | Length of image data (N bytes) |
| 36 – N | JPEG Image Data | Encoded video frame |
| N+1 – N+4 | Detection + Identification | Optional metadata block |
| Last byte | LRC (Checksum) | Checksum of all bytes before it |
FACE DETECTION
| Value | Meaning |
|---|---|
| 0 | No face |
| 1 | Too small |
| 2 | Bad posture |
| 3 | Valid face |
IDENTIFICATION
| Value | Meaning |
|---|---|
| 0 | None |
| 1 | Identified |
| 2 | Not identified |
| 3 | Low score |
| 4 | Error |
CHECKSUM (LRC)
XOR of all bytes excluding final byte.
char lrc(char* data, int size) {
int checksum = 0;
for(int i=0;i
