Datatypes used within pbdrv.
More...
|
typedef uint16_t | i2c_addr_t |
| I²C address (10 or 7 bit)
|
|
|
static const char | pb_cmd_magic_req [] = {0x70, 0x75, 0x7a, 0x62, 0x75, 0x73} |
| Magic sent from main controller to puzzle module (="puzbus")
|
|
static const char | pb_cmd_magic_res [] = {0x67, 0x61, 0x6d, 0x69, 0x6e, 0x67} |
| Magic reply from puzzle module back to main controller (="gaming")
|
|
◆ pb_action_t
Enumerator |
---|
PB_ACTION_REQ | request
|
PB_ACTION_RES | response
|
PB_ACTION_SET | (over)write
|
◆ pb_cmd_id_t
Enumerator |
---|
PB_CMD_PROP | puzzle module property (REQ, RES, SET)
The PROP command type is used for exchanging arbitrary data between puzzle modules and/or the puzzle box client (pbc) over the TCP bridge. These properties are not used by the puzzle framework.
|
PB_CMD_STATE | puzzle module global state variable (REQ, RES, SET)
The STATE command is used by puzzle modules to inform the main controller about their global state. The main controller aggregates the states of all connected puzzle modules and exchanges this aggregated state with the puzzle modules to indicate when the entire puzzle box is solved.
|
PB_CMD_MAGIC | magic (handshake) (REQ, RES)
The MAGIC command effectively serves as a 'secret handshake' (using a magic value) which is used to distinguish between puzzle modules and unrelated I²C devices.
|
◆ pb_global_state_t
Enumerator |
---|
PB_GS_NOINIT | uninitialized (only used by puzzle modules)
|
PB_GS_IDLE | puzzle not started yet
|
PB_GS_PLAYING | puzzle actively being solved
|
PB_GS_SOLVED | puzzle completed
|
◆ pb_cmd_magic_req
const char pb_cmd_magic_req[] = {0x70, 0x75, 0x7a, 0x62, 0x75, 0x73} |
|
static |
The size of this array can be obtained by sizeof(pb_cmd_magic_req)
.
◆ pb_cmd_magic_res
const char pb_cmd_magic_res[] = {0x67, 0x61, 0x6d, 0x69, 0x6e, 0x67} |
|
static |
The size of this array can be obtained by sizeof(pb_cmd_magic_res)
.