Skip to content
SEGFAULT edited this page Apr 23, 2018 · 6 revisions

Libreflip protocol

  • Prepare machine (thingy all the way up + lights on)
  • Flip page (╯°□°)╯︵ ┻━┻
  • Finish scan Part 1 (Thingy all the way up)
  • Finish scan Part 2 (Thingy all the way down + lights off)

Commands

Protocol is split into 1 byte command code and additional byte of instruction code. The protocol communication is terminated by a 0-bit.

Command table

Command Instruction Code
Move Box Up 00000010 - 00000001
Move Box Down 00000010 - 00000000
Lighting Activate 00000100 - 00000001
Lighting Deactivate 00000100 - 00000000
Flip Page Size in mm 00001000 - xxxxxxxx

Responses

  • 1 byte (Ok/ not ok, 0 == Ok)
  • 1 byte (Payload length)
  • Then n bytes payload

Payloads

Move Box (Up/Down)
  • Some error codes
  • No Payload
Lighting (On/ Off)
  • SAY YES OR OKAY
  • No Payload
Flip Table (Page)
  • Error codes 0 - 2 (incl)
    • Number is number of retries (but still successful)
    • 3: Max number of retries exceeded. Flip failed
    • 4 - 254: Implementation specific hardware error code
  • Payload length (probably) 4 bytes
    • u32 ambient pressure sensor value