diff --git a/README.md b/README.md index bd2122e..43630e9 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,22 @@ There's no live-stream server built into this project yet. The protocol is weirdly complex, though very little communication is necessary to use the device +The base structure of a packet is: +![](diagrams/packet.svg) + +The payload is command-dependent; most commands have only a literal payload, but the `Drw` command has a framing scheme + +`Drw` uses the second byte in the payload to discriminate into two types of subcommands: + +Control packets: +![](diagrams/control_packet.svg) + +The payload on control packets is "encrypted" when the length is > 5. + +Data packets: +![](diagrams/data_packet.svg) + +Data packets further discriminate based on the first 4 bytes into: Audio Data (0x55aa15a8), Video data. To establish a session, a few _control packets_ are sent. ```mermaid diff --git a/diagrams/control_packet.svg b/diagrams/control_packet.svg new file mode 100644 index 0000000..57c35b9 --- /dev/null +++ b/diagrams/control_packet.svg @@ -0,0 +1,4 @@ + + + +
0xD1
1 byte
0xD1...
Data?
1 byte
Data?...
Payload
PAYLOAD_LENGTH bytes
Payload...
Sequence number
2 bytes
Sequence number...
Start Command
2 bytes
Start Command...
Command
2 bytes
Command...
Payload length
2 bytes
Payload length...
Dest
2 bytes
Dest...
\ No newline at end of file diff --git a/diagrams/data_packet.svg b/diagrams/data_packet.svg new file mode 100644 index 0000000..89d235f --- /dev/null +++ b/diagrams/data_packet.svg @@ -0,0 +1,4 @@ + + + +
Payload
PAYLOAD_LENGTH bytes
Payload...
0xD1
1 byte
0xD1...
Data?
1 byte
Data?...
Sequence number
2 bytes
Sequence number...
\ No newline at end of file diff --git a/diagrams/packet.svg b/diagrams/packet.svg new file mode 100644 index 0000000..66847c1 --- /dev/null +++ b/diagrams/packet.svg @@ -0,0 +1,4 @@ + + + +
Command ID
2 bytes
Command ID...
Payload length
2 bytes
Payload length...
Payload
PAYLOAD_LENGTH bytes
Payload...
\ No newline at end of file