GDP group 24 node core
Dependencies: EthernetInterface SDFileSystem mbed-rtos mbed snail MbedJSONValue
Diff: sensorinterface.cpp
- Revision:
- 16:3ac37613f849
- Parent:
- 14:bc0e2fa25f94
- Child:
- 20:fb2a9f4d2de7
--- a/sensorinterface.cpp Tue Jan 13 22:48:25 2015 +0000 +++ b/sensorinterface.cpp Tue Jan 13 23:36:58 2015 +0000 @@ -172,9 +172,15 @@ reply.type = currentSensor->second.type; - for (int i = 2; i < bufSize; i++) + for (int i = 2; i < bufSize; i += currentSensor->second.readingSize) { - reply.readings.push_back(buffer[i]); + int r = 0; + for (int j = 0; j < currentSensor->second.readingSize; j++) + { + r = r << 8; + r += buffer[i+j]; + } + reply.readings.push_back(r); } if (buffer[0] != 'D')