mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-30 17:07:16 +02:00
Fix esp8266 build issue
This commit is contained in:
@ -124,6 +124,14 @@ bool AgApiClient::postToServer(String data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String uri = apiRoot + "/sensors/airgradient:" + ag->deviceId() + "/measures";
|
String uri = apiRoot + "/sensors/airgradient:" + ag->deviceId() + "/measures";
|
||||||
|
#ifdef ESP8266
|
||||||
|
HTTPClient client;
|
||||||
|
WiFiClient wifiClient;
|
||||||
|
if (client.begin(wifiClient, uri) == false) {
|
||||||
|
getConfigFailed = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#else
|
||||||
HTTPClient client;
|
HTTPClient client;
|
||||||
client.setTimeout(timeoutMs);
|
client.setTimeout(timeoutMs);
|
||||||
if (apiRootChanged) {
|
if (apiRootChanged) {
|
||||||
@ -141,6 +149,7 @@ bool AgApiClient::postToServer(String data) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
client.addHeader("content-type", "application/json");
|
client.addHeader("content-type", "application/json");
|
||||||
int retCode = client.POST(data);
|
int retCode = client.POST(data);
|
||||||
client.end();
|
client.end();
|
||||||
|
Reference in New Issue
Block a user