diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2014-12-07 00:06:27 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2014-12-07 00:06:27 +0100 |
commit | 90f5e8958e0f49e2c303abfb9d1f557e28caf78c (patch) | |
tree | af1e110bedb83c4a9c69b81c83d14c6b31b1d3f1 /app.h | |
parent | d015c05c7a141f183647fe0cd64c332b7af23800 (diff) | |
download | fiken_status_panel-master.tar.gz fiken_status_panel-master.tar.bz2 fiken_status_panel-master.tar.xz fiken_status_panel-master.zip |
Diffstat (limited to 'app.h')
-rw-r--r-- | app.h | 53 |
1 files changed, 50 insertions, 3 deletions
@@ -3,10 +3,57 @@ #include <stdint.h> -#define FSP_CMD_GAUGE_COUNT 1 -#define FSP_CMD_GAUGE_INFO 2 +enum fsp_cmd_code { + FSP_CMD_GET_GAUGE_COUNT = 1, + FSP_CMD_SET_GAUGE = 2, + FSP_CMD_GET_GAUGE = 3, + FSP_CMD_FAIL = 255, +}; -bool send_ctrl(uint8_t *data, uint8_t len); +struct fsp_get_gauge_count_req { +}; + +struct fsp_get_gauge_count_res { + uint8_t count; +}; + +struct fsp_set_gauge_req { + uint8_t gauge; + uint8_t value; +}; + +struct fsp_set_gauge_res { +}; + +struct fsp_get_gauge_req { + uint8_t gauge; +}; + +struct fsp_get_gauge_res { + uint8_t gauge; + uint8_t value; +}; + +struct fsp_req { + uint8_t code; + union { + struct fsp_get_gauge_count_req get_gauge_count; + struct fsp_get_gauge_req get_gauge; + struct fsp_set_gauge_req set_gauge; + }; +}; + +struct fsp_res { + uint8_t len; + uint8_t code; + union { + struct fsp_get_gauge_count_res get_gauge_count; + struct fsp_get_gauge_res get_gauge; + struct fsp_set_gauge_res set_gauge; + }; +}; + +bool send_ctrl(struct fsp_res *res); void on_gauge_data(uint8_t *data, uint8_t len); void on_gauge_ctrl(uint8_t *data, uint8_t len); |