aboutsummaryrefslogtreecommitdiff
path: root/shared
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-05-28 15:19:42 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-05-28 15:19:42 +0200
commit085a2c16d07bfe3616dfdecfe5815ff1dc5b51a6 (patch)
treef5407a0b4f0ec44cbb24a1168c4f5a0a2674ad4e /shared
parent8894d20ff0d1c1dde69879a21e756e01bcfa5262 (diff)
add initial puzzle bus specification
Diffstat (limited to 'shared')
-rw-r--r--shared/puzbus.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/shared/puzbus.h b/shared/puzbus.h
index 59a8867..685fd6c 100644
--- a/shared/puzbus.h
+++ b/shared/puzbus.h
@@ -26,14 +26,21 @@
enum pb_cmd {
PB_CMD_READ, //!< read a puzzle module property
PB_CMD_WRITE, //!< write to a puzzle module property
+ PB_CMD_EXCHANGE, //!< state exchange command
// PB_CMD_UPDATE, //!< request an update
+ PB_CMD_MAGIC = 0x69, //!< magic message
};
+typedef enum pb_cmd pb_cmd_t;
+
+static const char pb_magic_msg[] = { 0x70, 0x75, 0x7a, 0x62, 0x75, 0x73 };
+static const char pb_magic_res[] = { 0x67, 0x61, 0x6d, 0x69, 0x6e, 0x67 };
/** \brief Puzzle bus global states */
-enum pb_global_state {
- 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
+enum pb_state {
+ PB_STATE_NOINIT, //!< uninitialized (only used by puzzle modules)
+ PB_STATE_IDLE, //!< puzzle not started yet
+ PB_STATE_PLAYING, //!< puzzle actively being solved
+ PB_STATE_SOLVED, //!< puzzle completed
};
+typedef enum pb_state pb_state_t;