diff options
-rw-r--r-- | app.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -18,11 +18,11 @@ struct sm_sensor { uint16_t warning_value; uint16_t update_interval; uint8_t name_length; - uint8_t name[SENSOR_NAME_LEN]; + char name[SENSOR_NAME_LEN]; } sensors[SENSOR_COUNT] = { // A Pin, D1 Pin, D2 Pin, Value, Warning Value, Update Interval, Length of Name, Name - { 8, 3, 5, 0, 10, 0, 9, 'sensor #1'}, - { 10, 11, 12, 0, 10, 0, 9, 'sensor #2'}, + { 8, 3, 5, 0, 10, 0, 9, "Sensor #1"}, + { 10, 11, 12, 0, 10, 0, 9, "Sensor #2"}, }; static unsigned long next_update[SENSOR_COUNT]; @@ -100,8 +100,6 @@ static void write_name(uint8_t const* name, uint8_t len) { } void write_req(struct sm_req const& req) { - int i; - Serial.print(">> "); switch(req.code) { @@ -154,8 +152,6 @@ void write_req(struct sm_req const& req) { } void write_res(struct sm_res const& res) { - int i; - Serial.print("<< "); switch(res.code) { @@ -290,6 +286,7 @@ void on_soil_moisture_ctrl(uint8_t *data, uint8_t len) { break; default: + body_len = 0; res.code = SM_CMD_FAIL; break; } |