Fixed two issues: Now uploads raw data as well as processed data and will upload ALARM events in preference to WARNING events (you only get one ALARM event uploaded even if the data goes OK->WARNING->ALARM->WARNING->OK

This commit is contained in:
Graham Jones
2022-01-05 10:41:50 +00:00
parent 68bf89b0ff
commit 93c0fc91cc
2 changed files with 7 additions and 2 deletions

View File

@@ -387,7 +387,11 @@ public class LogManager implements AuthCallbackInterface, EventCallbackInterface
public void uploadSdData() { public void uploadSdData() {
int eventId = -1; int eventId = -1;
Log.v(TAG, "uploadSdData()"); Log.v(TAG, "uploadSdData()");
// First try uploading full alarms, and only if we do not have any of those, upload warnings.
eventId = getNextEventToUpload(false);
if (eventId==-1) {
eventId = getNextEventToUpload(true); eventId = getNextEventToUpload(true);
}
if (eventId != -1) { if (eventId != -1) {
Log.v(TAG, "uploadSdData() - eventId=" + eventId); Log.v(TAG, "uploadSdData() - eventId=" + eventId);
String eventJsonStr = getDatapointById(eventId); String eventJsonStr = getDatapointById(eventId);

View File

@@ -213,6 +213,7 @@ public class SdData implements Parcelable {
for (int i = 0; i< rawData.length;i++) { for (int i = 0; i< rawData.length;i++) {
rawArr.put(rawData[i]); rawArr.put(rawData[i]);
} }
jsonObj.put("rawData",rawArr);
} }
retval = jsonObj.toString(); retval = jsonObj.toString();