adapted to latest changes in gwen, more work on data and nodes servers.
This commit is contained in:
@@ -182,6 +182,93 @@ void AQH_MergeConfigFileIntoConfig(GWEN_DB_NODE *dbArgs, const char *destDbGroup
|
||||
|
||||
|
||||
|
||||
int AQH_ValueType_fromString(const char *s)
|
||||
{
|
||||
if (s) {
|
||||
if (strcasecmp(s, "sensor")==0)
|
||||
return AQH_ValueType_Sensor;
|
||||
else if (strcasecmp(s, "actor")==0)
|
||||
return AQH_ValueType_Actor;
|
||||
}
|
||||
return AQH_ValueType_Unknown;
|
||||
}
|
||||
|
||||
|
||||
|
||||
const char *AQH_ValueType_toString(int i)
|
||||
{
|
||||
switch (i) {
|
||||
case AQH_ValueType_Sensor: return "sensor";
|
||||
case AQH_ValueType_Actor: return "actor";
|
||||
case AQH_ValueType_Unknown:
|
||||
default: return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
int AQH_ValueDataType_fromString(const char *s)
|
||||
{
|
||||
if (s) {
|
||||
if (strcasecmp(s, "int")==0)
|
||||
return AQH_ValueDataType_Int;
|
||||
else if (strcasecmp(s, "dword")==0)
|
||||
return AQH_ValueDataType_Dword;
|
||||
else if (strcasecmp(s, "rational")==0)
|
||||
return AQH_ValueDataType_Rational;
|
||||
}
|
||||
return AQH_ValueDataType_Unknown;
|
||||
}
|
||||
|
||||
|
||||
|
||||
const char *AQH_ValueDataType_toString(int i)
|
||||
{
|
||||
switch(i) {
|
||||
case AQH_ValueDataType_Int: return "int";
|
||||
case AQH_ValueDataType_Dword: return "dword";
|
||||
case AQH_ValueDataType_Rational: return "rational";
|
||||
case AQH_ValueDataType_Unknown:
|
||||
default: return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
int AQH_ValueModality_fromString(const char *s)
|
||||
{
|
||||
if (s) {
|
||||
if (strcasecmp(s, "temperature")==0)
|
||||
return AQH_ValueModality_Temperature;
|
||||
else if (strcasecmp(s, "humidity")==0)
|
||||
return AQH_ValueModality_Humidity;
|
||||
else if (strcasecmp(s, "door")==0)
|
||||
return AQH_ValueModality_Door;
|
||||
else if (strcasecmp(s, "rgb")==0)
|
||||
return AQH_ValueModality_RGB;
|
||||
else if (strcasecmp(s, "rgbw")==0)
|
||||
return AQH_ValueModality_RGBW;
|
||||
}
|
||||
return AQH_ValueModality_Unknown;
|
||||
}
|
||||
|
||||
|
||||
|
||||
const char *AQH_ValueModality_toString(int i)
|
||||
{
|
||||
switch(i) {
|
||||
case AQH_ValueModality_Temperature: return "temperature";
|
||||
case AQH_ValueModality_Humidity: return "humidity";
|
||||
case AQH_ValueModality_Door: return "door";
|
||||
case AQH_ValueModality_RGB: return "rgb";
|
||||
case AQH_ValueModality_RGBW: return "rgbw";
|
||||
case AQH_ValueModality_Unknown:
|
||||
default: return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user