From f4868604384908a7477cbb4b544c6ee7aac2a883 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Mon, 27 May 2024 08:23:21 +0200 Subject: quickly implement some pseudo handlers for the remaining commands --- proto/puzbusv1.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'proto') diff --git a/proto/puzbusv1.h b/proto/puzbusv1.h index 0985b2b..9f4f8e5 100644 --- a/proto/puzbusv1.h +++ b/proto/puzbusv1.h @@ -64,6 +64,25 @@ void pb_read_reset(struct pb_msg * target); */ bool pb_write(const struct pb_msg * target, char ** buf, size_t * buf_sz); +/** + * \brief I^2^C puzzle bus command types + * + * The first byte of a puzzle bus message's data indicates the command type. + */ +enum pb_cmd { + PB_CMD_READ, //!< read a puzzle module property + PB_CMD_WRITE, //!< write to a puzzle module property + // PB_CMD_UPDATE, //!< request an update +}; + +/** \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 +}; + #ifdef __cplusplus } #endif -- cgit v1.2.3