~rbdr/tiny-command-pal

ef51091aa55c65b8a8006c848f3d6fb63c5805bf — Ruben Beltran del Rio 4 months ago 511d851 main
Constraint max payload length to 3 bytes
1 files changed, 9 insertions(+), 9 deletions(-)

M README.md
M README.md => README.md +9 -9
@@ 59,11 59,11 @@ All numbers in hexadecimal.
┌───────────────────┬──────────────────────────────────┬────┐
│      HEADER       │               BODY               │FOOT│
├────┬────┬────┬────┼────┬─────────┬────┬────┬────┬────┼────┤
│ 00 │ 01 │ 02 │ 03 │ 04 ┊ 04+CLEN │A+01│A+02┊A+41│A+42│A+43│
│ 00 │ 01 │ 02 │ 03 │ 04 ┊ A+CLEN  │B+01│B+02┊B+41│B+42│B+43│
├────┼────┼────┼────┼────┴─────────┼────┼────┴────┼────┼────┤
│ 7C │ 00 │CLEN│ 02 │   COMMAND    │ 1F │SIGNATURE│ 03 │ 04 │
└────┴────┴────┴────┴──────────────┴────┴─────────┴────┴────┘
                                  A
└────┴────┴────┴────┼──────────────┼────┴─────────┴────┴────┘
                   A              B
```

### The Authorization Response Message (0x80)


@@ 110,11 110,11 @@ The codes are as follows:
This is an actual command.

```
## Header, 8 bytes
## Header, 7 bytes
1. Magic Byte (0x7C), 1 byte
2. Command Message Flag (0x01), 1 byte
3. Length of command in bytes (0x00-0xFF), 1 byte
4. Length of payload (0x00000000-0xFFFFFFFF), 4 bytes
4. Length of payload (0x000000-0xFFFFFF), 3 bytes
5. Start of Text Byte (0x02), 1 byte
## The Command (Variable)
1. The command, Up to 255 bytes in length, must correspond to the value in header field 3


@@ 122,7 122,7 @@ This is an actual command.
3. The signature of the command, signed by a private ed25519 key, 64 bytes
4. Record Separator Byte (0x1E), 1 byte
## The Payload (Variable)
1. The payload, up to 4,294,967,295 bytes in length, must correspond to the value in header field 4. Encoding will be assumed to be Mac OS Roman.
1. The payload, up to 16,777,215 bytes in length, must correspond to the value in header field 4.
2. Unit Separator Byte (0x1F)
3. The signature of the payload, signed by the same private ed25519 key as the command, 64 bytes
4. End of Text Byte (0x03), 1 byte


@@ 135,11 135,11 @@ All numbers in hexadecimal.
┌─────────────────────────────┬─────────────────────────────────────────────────────────────────────┬────┐
│           HEADER            │               BODY                               BODY               │FOOT│
├────┬────┬────┬────┬────┬────┼────┬─────────┬────┬────┬────┬────┬────┬─────────┬────┬────┬────┬────┼────┤
│ 00 │ 01 │ 02 │ 03 ┊ 06 │ 07 │ 08 ┊ 07+CLEN │A+01│A+02┊A+41│A+42│A+43┊A+42+PLEN│B+01│B+02┊B+41│B+42│B+43│
│ 00 │ 01 │ 02 │ 03 ┊ 05 │ 06 │ 07 ┊ A+CLEN  │B+01│B+02┊B+41│B+42│B+43┊B+42+PLEN│C+01│C+02┊C+41│C+42│C+43│
├────┼────┼────┼────┴────┼────┼────┴─────────┼────┼────┴────┼────┼────┴─────────┼────┼────┴────┼────┼────┤
│ 7C │ 01 │CLEN│   PLEN  │ 02 │   COMMAND    │ 1F │SIGNATURE│ 1E │   PAYLOAD    │ 1F │SIGNATURE│ 03 │ 04 │
└────┴────┴────┴─────────┴────┴──────────────┴────┴─────────┴────┴──────────────┴────┴─────────┴────┴────┘
                                            A                                  B
└────┴────┴────┴─────────┴────┼──────────────┼────┴─────────┴────┴──────────────┼────┴─────────┴────┴────┘
                             A              B                                  C
```

### The Command Result Message (0x81)