From 67785ed99ba313cba99b3656473f05b3f0803c20 Mon Sep 17 00:00:00 2001 From: Phat Nguyen Date: Thu, 29 Feb 2024 15:20:19 +0700 Subject: [PATCH] Update API naming --- examples/BASIC_v4/BASIC_v4.ino | 12 ++++++------ examples/ONE_I-9PSL/ONE_I-9PSL.ino | 12 ++++++------ examples/Open_Air/Open_Air.ino | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/examples/BASIC_v4/BASIC_v4.ino b/examples/BASIC_v4/BASIC_v4.ino index 43a61c4..6dc0efb 100644 --- a/examples/BASIC_v4/BASIC_v4.ino +++ b/examples/BASIC_v4/BASIC_v4.ino @@ -115,7 +115,7 @@ public: * @return true Success * @return false Failure */ - bool fetchServerConfigure(String id) { + bool fetchServerConfiguration(String id) { String uri = "http://hw.airgradient.com/sensors/airgradient:" + id + "/one/config"; @@ -368,7 +368,7 @@ static bool wifiHasConfig = false; /** */ static void boardInit(void); static void failedHandler(String msg); static void co2Calibration(void); -static void serverConfigUpdate(void); +static void updateServerConfiguration(void); static void co2Update(void); static void pmUpdate(void); static void tempHumUpdate(void); @@ -382,7 +382,7 @@ bool hasSensorS8 = true; bool hasSensorPMS = true; bool hasSensorSHT = true; int pmFailCount = 0; -AgSchedule configSchedule(SERVER_CONFIG_UPDATE_INTERVAL, serverConfigUpdate); +AgSchedule configSchedule(SERVER_CONFIG_UPDATE_INTERVAL, updateServerConfiguration); AgSchedule serverSchedule(SERVER_SYNC_INTERVAL, sendDataToServer); AgSchedule dispSchedule(DISP_UPDATE_INTERVAL, dispHandler); AgSchedule co2Schedule(SENSOR_CO2_UPDATE_INTERVAL, co2Update); @@ -413,7 +413,7 @@ void setup() { wifiHasConfig = true; sendPing(); - agServer.fetchServerConfigure(getDevId()); + agServer.fetchServerConfiguration(getDevId()); if (agServer.isCo2Calib()) { co2Calibration(); } @@ -576,8 +576,8 @@ static void co2Calibration(void) { } } -static void serverConfigUpdate(void) { - if (agServer.fetchServerConfigure(getDevId())) { +static void updateServerConfiguration(void) { + if (agServer.fetchServerConfiguration(getDevId())) { if (agServer.isCo2Calib()) { if (hasSensorS8) { co2Calibration(); diff --git a/examples/ONE_I-9PSL/ONE_I-9PSL.ino b/examples/ONE_I-9PSL/ONE_I-9PSL.ino index c7955d6..fc99d54 100644 --- a/examples/ONE_I-9PSL/ONE_I-9PSL.ino +++ b/examples/ONE_I-9PSL/ONE_I-9PSL.ino @@ -174,7 +174,7 @@ public: * @return true Success * @return false Failure */ - bool fetchServerConfigure(String id) { + bool fetchServerConfiguration(String id) { String uri = "http://hw.airgradient.com/sensors/airgradient:" + id + "/one/config"; @@ -681,7 +681,7 @@ static String wifiSSID = ""; static void boardInit(void); static void failedHandler(String msg); -static void serverConfigUpdate(void); +static void updateServerConfiguration(void); static void co2Calibration(void); static void setRGBledPMcolor(int pm25Value); static void ledSmHandler(int sm); @@ -711,7 +711,7 @@ bool hasSensorSHT = true; int pmFailCount = 0; uint32_t factoryBtnPressTime = 0; AgSchedule dispLedSchedule(DISP_UPDATE_INTERVAL, displayAndLedBarUpdate); -AgSchedule configSchedule(SERVER_CONFIG_UPDATE_INTERVAL, serverConfigUpdate); +AgSchedule configSchedule(SERVER_CONFIG_UPDATE_INTERVAL, updateServerConfiguration); AgSchedule serverSchedule(SERVER_SYNC_INTERVAL, sendDataToServer); AgSchedule co2Schedule(SENSOR_CO2_UPDATE_INTERVAL, co2Update); AgSchedule pmsSchedule(SENSOR_PM_UPDATE_INTERVAL, pmUpdate); @@ -786,7 +786,7 @@ void setup() { Serial.println(WiFi.localIP()); /** Get first connected to wifi */ - agServer.fetchServerConfigure(getDevId()); + agServer.fetchServerConfiguration(getDevId()); if (agServer.isConfigFailed()) { dispSmHandler(APP_SM_WIFI_OK_SERVER_OK_SENSOR_CONFIG_FAILED); ledSmHandler(APP_SM_WIFI_OK_SERVER_OK_SENSOR_CONFIG_FAILED); @@ -1721,8 +1721,8 @@ static void failedHandler(String msg) { /** * @brief Send data to server */ -static void serverConfigUpdate(void) { - if (agServer.fetchServerConfigure(getDevId())) { +static void updateServerConfiguration(void) { + if (agServer.fetchServerConfiguration(getDevId())) { if (agServer.isCo2Calib()) { if (hasSensorS8) { co2Calibration(); diff --git a/examples/Open_Air/Open_Air.ino b/examples/Open_Air/Open_Air.ino index c1cc73d..e07b822 100644 --- a/examples/Open_Air/Open_Air.ino +++ b/examples/Open_Air/Open_Air.ino @@ -175,7 +175,7 @@ public: * @return true Success * @return false Failure */ - bool fetchServerConfigure(String id) { + bool fetchServerConfiguration(String id) { String uri = "http://hw.airgradient.com/sensors/airgradient:" + id + "/one/config"; @@ -713,7 +713,7 @@ static void tvocUpdate(void); static void pmUpdate(void); static void sendDataToServer(void); static void co2Update(void); -static void serverConfigUpdate(void); +static void updateServerConfiguration(void); static const char *getFwMode(int mode); static void showNr(void); static void webServerInit(void); @@ -726,7 +726,7 @@ bool hasSensorPMS1 = true; bool hasSensorPMS2 = true; bool hasSensorSGP = true; uint32_t factoryBtnPressTime = 0; -AgSchedule configSchedule(SERVER_CONFIG_UPDATE_INTERVAL, serverConfigUpdate); +AgSchedule configSchedule(SERVER_CONFIG_UPDATE_INTERVAL, updateServerConfiguration); AgSchedule serverSchedule(SERVER_SYNC_INTERVAL, sendDataToServer); AgSchedule co2Schedule(SENSOR_CO2_UPDATE_INTERVAL, co2Update); AgSchedule pmsSchedule(SENSOR_PM_UPDATE_INTERVAL, pmUpdate); @@ -764,7 +764,7 @@ void setup() { wifiHasConfig = true; sendPing(); - agServer.fetchServerConfigure(getDevId()); + agServer.fetchServerConfiguration(getDevId()); if (agServer.isConfigFailed()) { ledSmHandler(APP_SM_WIFI_OK_SERVER_OK_SENSOR_CONFIG_FAILED); delay(DISPLAY_DELAY_SHOW_CONTENT_MS); @@ -1139,8 +1139,8 @@ static void co2Update(void) { Serial.printf("CO2 index: %d\r\n", co2Ppm); } -static void serverConfigUpdate(void) { - if (agServer.fetchServerConfigure(getDevId())) { +static void updateServerConfiguration(void) { + if (agServer.fetchServerConfiguration(getDevId())) { /** Only support CO2 S8 sensor on FW_MODE_PST */ if (fw_mode == FW_MODE_PST) { if (agServer.isCo2Calib()) {