obus/docs/protocol.txt

86 lines
1.8 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

______________________________________
Recap: message in CAN protocol
↓ 11b ↓ 64b (8 bytes)
+----+-----------------+ - - -
| id | body | dont care for now
+----+-----------------+ - - -
Priority is controlled by the ID: if a message with a higher ID is on the bus, lower messages will
be silenced due to the design of CAN.
______________________________________
OBUS message specification
ID:
b bb bbbbbbbb
| | ↓
| ↓ module-ID: 2⁸=256
↓ type: 2²=4
priority bit (so that each type can send priority messages if need be)
type:
- 0 controller; module ID is ignored
- 1 puzzel
- 2 needy
- 3 reserved for future use
Payload:
[ B B B B B B B B ]
-
type (per module type)
- - - - - - - - - - - - - - - - - - -
Types for controller:
- 0 acknowledge valid message
[ X B B B B B B B ]
--------------
reserved
- 1 hello
[ X B B B B B B B ]
--------------
reserved
- 2 game start
[ X B B B B B B B ]
-------- - - -
time left ↓ ↓ reserved
#strikes #max strikes
- 3 state (every x ms e.g. in the middle of each second)
[ X B B B B B B B ]
-------- - - -
time left ↓ ↓ reserved
#strikes #max strikes
- 4-6 solved, timeout, strikeout
[ X B B B B B B B ]
-------- - - -
end time ↓ ↓ reserved
#strikes #max strikes
- 7-255 reserved
- - - - - - - - - - - - - - - - - - -
Types for modules:
- 0 hanlo
[ X B B B B B B B ]
--------------
reserved
- 1 strike
[ X B B B B B B B ]
--------------
reserved
- 2 solved (not for needy modules)
[ X B B B B B B B ]
--------------
reserved