mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-12-17 19:18:27 +01:00
Compare commits
1 Commits
develop
...
feat/ce-co
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
844674d8ee |
@@ -998,7 +998,7 @@ void initializeNetwork() {
|
||||
delay(2500);
|
||||
}
|
||||
|
||||
if (!agClient->begin(ag->deviceId().c_str())) {
|
||||
if (!agClient->begin(ag->deviceId().c_str(), AirgradientClient::ONE_OPENAIR)) {
|
||||
oledDisplay.setText("Client", "initialization", "failed");
|
||||
delay(5000);
|
||||
oledDisplay.showRebooting();
|
||||
@@ -1057,7 +1057,7 @@ void initializeNetwork() {
|
||||
return;
|
||||
}
|
||||
|
||||
std::string config = agClient->httpFetchConfig();
|
||||
std::string config = agClient->coapFetchConfig();
|
||||
configSchedule.update();
|
||||
// Check if fetch configuration failed or fetch succes but parsing failed
|
||||
if (agClient->isLastFetchConfigSucceed() == false ||
|
||||
@@ -1086,7 +1086,7 @@ static void configurationUpdateSchedule(void) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::string config = agClient->httpFetchConfig();
|
||||
std::string config = agClient->coapFetchConfig();
|
||||
if (agClient->isLastFetchConfigSucceed()) {
|
||||
configuration.parse(config.c_str(), false);
|
||||
}
|
||||
@@ -1428,7 +1428,7 @@ void postUsingCellular(bool forcePost) {
|
||||
xSemaphoreGive(mutexMeasurementCycleQueue);
|
||||
|
||||
// Attempt to send
|
||||
if (agClient->httpPostMeasures(payload, extendPmMeasures) == false) {
|
||||
if (agClient->coapPostMeasures(payload) == false) {
|
||||
// Consider network has a problem, retry in next schedule
|
||||
Serial.println("Post measures failed, retry in next schedule");
|
||||
return;
|
||||
|
||||
@@ -953,13 +953,7 @@ bool Configuration::parse(String data, bool isLocal) {
|
||||
String(value ? "true" : "false"));
|
||||
jconfig[jprop_extendedPmMeasures] = value;
|
||||
}
|
||||
}
|
||||
else if (JSON.typeof_(root[jprop_extendedPmMeasures]) == "null" and !isLocal) {
|
||||
// So if its not available on the json and json comes from aigradient server
|
||||
// then set its value to default (false)
|
||||
jconfig[jprop_extendedPmMeasures] = jprop_extendedPmMeasures_default;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (jsonTypeInvalid(root[jprop_extendedPmMeasures], "boolean")) {
|
||||
failedMessage = jsonTypeInvalidMessage(
|
||||
String(jprop_extendedPmMeasures), "boolean");
|
||||
|
||||
Submodule src/Libraries/airgradient-client updated: 0a2ff8abbb...3a37795565
Reference in New Issue
Block a user