puzzlebox
|
Parsed message handler routing. More...
These functions form a tree-shaped call graph, and are used to handle specific commands received from pb_i2c_recv()
.
Functions | |
void | pb_route_msg (pb_msg_t *msg) |
Handle a message with type {PROP, STATE, MAGIC}. | |
void | pb_route_cmd_prop (pb_msg_t *msg) |
Handle a PROP message with action {REQ, RES, SET}. | |
void | pb_route_cmd_state (pb_msg_t *msg) |
Handle a STATE message with action {REQ, RES, SET}. | |
void | pb_route_cmd_magic (pb_msg_t *msg) |
Handle a MAGIC message with action {REQ, RES}. | |
void | pb_route_cmd_prop_req (pb_msg_t *msg) |
Handle a PROP message with action REQ. | |
void | pb_route_cmd_prop_res (pb_msg_t *msg) |
Handle a PROP message with action RES. | |
void | pb_route_cmd_prop_set (pb_msg_t *msg) |
Handle a PROP message with action SET. | |
void | pb_route_cmd_state_req (pb_msg_t *msg) |
Handle a STATE message with action REQ. | |
void | pb_route_cmd_state_res (pb_msg_t *msg) |
Handle a STATE message with action RES. | |
void | pb_route_cmd_state_set (pb_msg_t *msg) |
Handle a STATE message with action SET. | |
void | pb_route_cmd_magic_req (pb_msg_t *msg) |
Handle a MAGIC message with action REQ. | |
void | pb_route_cmd_magic_res (pb_msg_t *msg) |
Handle a MAGIC message with action RES. | |
void pb_route_cmd_magic | ( | pb_msg_t * | msg | ) |
Calls the next handler depending on msg->action
.
MAGIC
and action SET
will be silently ignored, as there is no such command.void pb_route_cmd_magic_req | ( | pb_msg_t * | msg | ) |
The default implementation of this function does the following:
MAGIC
RES
message. void pb_route_cmd_magic_res | ( | pb_msg_t * | msg | ) |
The default implementation of this function is empty, as only the main controller handles this type of command. (link)
This function registers the I²C address of the puzzle module that replied to the MAGIC
REQ
command into a list of "known puzzle modules", which are then periodically updated during gameplay.
void pb_route_cmd_prop | ( | pb_msg_t * | msg | ) |
Calls the next handler depending on msg->action
.
void pb_route_cmd_prop_req | ( | pb_msg_t * | msg | ) |
The default implementation of this function is empty, as puzzle module properties are user-defined.
void pb_route_cmd_prop_res | ( | pb_msg_t * | msg | ) |
The default implementation of this function is empty, as puzzle module properties are user-defined.
void pb_route_cmd_prop_set | ( | pb_msg_t * | msg | ) |
The default implementation of this function is empty, as puzzle module properties are user-defined.
void pb_route_cmd_state | ( | pb_msg_t * | msg | ) |
Calls the next handler depending on msg->action
.
void pb_route_cmd_state_req | ( | pb_msg_t * | msg | ) |
The default implementation of this function does the following:
pb_hook_ev_module_init()
if this is the first received STATE
REQ
command.pb_hook_ev_main_state_update()
if the main controller state has changed.STATE
RES
message. void pb_route_cmd_state_res | ( | pb_msg_t * | msg | ) |
The default implementation of this function is empty, as only the main controller handles this type of command.
void pb_route_cmd_state_set | ( | pb_msg_t * | msg | ) |
The default implementation of this function does the following:
pb_hook_mod_state_write()
. void pb_route_msg | ( | pb_msg_t * | msg | ) |
Calls the next handler depending on msg->type
.