Commit 19446e14 authored by Patrick's avatar Patrick

passing [0] to sendReadings

parent de43bc43
......@@ -235,7 +235,7 @@ int16_t teal_mallet_gsm::sendReadings(PGM_P param, PGM_P quali, PGM_P dtype, PGM
// (optional) print the JSON nicely with tabs and spaces (comment out for fewer characters)
json.prettyPrint();
// build the json array (outputting to nowhere)
buildAMON(param, quali, dtype, units, perid, the_measurements, read_head, read_tail);
buildAMON(param[0], quali[0], dtype[0], units[0], perid[0], the_measurements, read_head, read_tail);
// then send how many bytes that took
s->println(json.length());
// finish the headers with a blank line
......@@ -243,7 +243,7 @@ int16_t teal_mallet_gsm::sendReadings(PGM_P param, PGM_P quali, PGM_P dtype, PGM
// then restart jsonPrint with a new target (sending to client)
json.begin(*s);
// build the json
buildAMON(param, quali, dtype, units, perid, the_measurements, read_head, read_tail);
buildAMON(param[0], quali[0], dtype[0], units[0], perid[0], the_measurements, read_head, read_tail);
// finish the last line of the message (jsonPrint won't press return)
s->println();
}
......
......@@ -45,7 +45,7 @@ uint8_t readings_tail = 0;
// sends happen after a fixed number of ordinals
t_SensorData last_sending_time;
// how many readings should be collected for sending (<NUM_MMNT)
#define NUM_TO_SEND 5
#define NUM_TO_SEND 1
#if NUM_TO_SEND >= NUM_MMNT
#error "Can't hold all the readings, reduce NUM_TO_SEND below NUM_MMNT"
......@@ -203,7 +203,7 @@ void send_reading() {
#if DEBUG_MODE > 0
Serial.println(F("sendReadings..."));
#endif
TM.sendReadings(param, quali, dtype, units, perid, measurements, readings_head, readings_tail);
TM.sendReadings(param[0], quali[0], dtype[0], units[0], perid[0], measurements, readings_head, readings_tail);
#if DEBUG_MODE > 0
Serial.println(F("endConnection..."));
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment