#ifndef APP_H #define APP_H #include enum fsp_cmd_code { FSP_CMD_GET_GAUGE_COUNT = 1, FSP_CMD_SET_GAUGE = 2, FSP_CMD_GET_GAUGE = 3, FSP_CMD_FAIL = 255, }; 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); #endif