mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-04 03:36:32 +02:00
Move Arduino_JSON
to AirGradient
libries
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
#include "AgConfigure.h"
|
||||
#include "EEPROM.h"
|
||||
#include "Libraries/Arduino_JSON/src/Arduino_JSON.h"
|
||||
|
||||
const char *CONFIGURATION_CONTROL_NAME[] = {
|
||||
[ConfigurationControlLocal] = "local",
|
||||
@ -12,6 +13,15 @@ const char *LED_BAR_MODE_NAMES[] = {
|
||||
[LedBarModeCO2] = "co2",
|
||||
};
|
||||
|
||||
static bool jsonTypeInvalid(JSONVar root, String validType) {
|
||||
String type = JSON.typeof_(root);
|
||||
if (type == validType || type == "undefined" || type == "unknown" ||
|
||||
type == "null") {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get LedBarMode Name
|
||||
*
|
||||
@ -706,14 +716,6 @@ bool Configuration::isUpdated(void) {
|
||||
return updated;
|
||||
}
|
||||
|
||||
bool Configuration::jsonTypeInvalid(JSONVar root, String validType) {
|
||||
String type = JSON.typeof_(root);
|
||||
if (type == validType || type == "undefined" || type == "unknown" || type == "null") {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
String Configuration::jsonTypeInvalidMessage(String name, String type) {
|
||||
return "'" + name + "' type invalid, it's should '" + type + "'";
|
||||
}
|
||||
|
Reference in New Issue
Block a user