Skip to content

Commit

Permalink
Update API naming
Browse files Browse the repository at this point in the history
  • Loading branch information
pnt325 committed Feb 29, 2024
1 parent 173e3ca commit 67785ed
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions examples/BASIC_v4/BASIC_v4.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -413,7 +413,7 @@ void setup() {
wifiHasConfig = true;
sendPing();

agServer.fetchServerConfigure(getDevId());
agServer.fetchServerConfiguration(getDevId());
if (agServer.isCo2Calib()) {
co2Calibration();
}
Expand Down Expand Up @@ -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();
Expand Down
12 changes: 6 additions & 6 deletions examples/ONE_I-9PSL/ONE_I-9PSL.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down
12 changes: 6 additions & 6 deletions examples/Open_Air/Open_Air.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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()) {
Expand Down

0 comments on commit 67785ed

Please sign in to comment.