diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2015-06-21 19:15:37 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2015-06-21 19:15:37 +0200 |
commit | 67b1ba7ea0a86eac679eafc8c724fcb6bb4f8c4f (patch) | |
tree | 1c03a13e9a0bd8d19cd7ea657c94ef781f5ab69b /app.h | |
parent | 933beebfa58618745c2f99de830be61036446d18 (diff) | |
download | trygvisio_soil_moisture-67b1ba7ea0a86eac679eafc8c724fcb6bb4f8c4f.tar.gz trygvisio_soil_moisture-67b1ba7ea0a86eac679eafc8c724fcb6bb4f8c4f.tar.bz2 trygvisio_soil_moisture-67b1ba7ea0a86eac679eafc8c724fcb6bb4f8c4f.tar.xz trygvisio_soil_moisture-67b1ba7ea0a86eac679eafc8c724fcb6bb4f8c4f.zip |
o Letting each sensor use the configured update interval.
o Changing the ID of the "get value" command. It has to include the sensor index when used as a notification message.
Dunno if this is the best strategy. I guess messages are cheap, but complexity is expensive.
Diffstat (limited to 'app.h')
-rw-r--r-- | app.h | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -7,14 +7,18 @@ #define SENSOR_NAME_LEN 10 +// TODO: Randomize these numbers. There are no reason why they should be in order. + enum sm_cmd_code { SM_CMD_GET_SENSOR_COUNT = 1, - SM_CMD_GET_VALUE = 2, + // Used to be 2 + SM_CMD_GET_VALUE = 8, SM_CMD_SET_WARNING_VALUE = 3, SM_CMD_GET_WARNING_VALUE = 4, SM_CMD_SET_SENSOR_NAME = 5, SM_CMD_GET_SENSOR_NAME = 6, SM_CMD_SET_UPDATE_INTERVAL = 7, + // 8 is used SM_CMD_FAIL = 255, }; @@ -29,7 +33,11 @@ struct sm_get_value_req { uint8_t sensor; }; +/** + * This includes the sensor id because it can be used as a notification too + */ struct sm_get_value_res { + uint8_t sensor; uint16_t value; }; @@ -126,4 +134,3 @@ void write_res(struct sm_res const& res); #endif // vim: set ft=arduino: - |