aqhome: handle types for CO2 and TVOC.
This commit is contained in:
@@ -123,6 +123,8 @@ const char *AQH_Value3Msg_GetValueTypeName(const GWEN_MSG *msg)
|
||||
case AQH_MSG_VALUE3_TYPE_HUMIDITY: return "humidity";
|
||||
case AQH_MSG_VALUE3_TYPE_DOOR: return "door_window";
|
||||
case AQH_MSG_VALUE3_TYPE_MOTION: return "motion";
|
||||
case AQH_MSG_VALUE3_TYPE_CO2: return "CO2";
|
||||
case AQH_MSG_VALUE3_TYPE_TVOC: return "TVOC";
|
||||
default: break;
|
||||
}
|
||||
return "unknown";
|
||||
@@ -152,6 +154,8 @@ const char *AQH_Value3Msg_GetValueTypeUnits(const GWEN_MSG *msg)
|
||||
case AQH_MSG_VALUE3_TYPE_TEMP: return "Celsius";
|
||||
case AQH_MSG_VALUE3_TYPE_HUMIDITY: return "%";
|
||||
case AQH_MSG_VALUE3_TYPE_DOOR: return NULL;
|
||||
case AQH_MSG_VALUE3_TYPE_CO2: return "ppm";
|
||||
case AQH_MSG_VALUE3_TYPE_TVOC: return "ppb";
|
||||
default: break;
|
||||
}
|
||||
return NULL;
|
||||
@@ -195,7 +199,8 @@ void AQH_Value3Msg_DumpToBuffer(const GWEN_MSG *msg, GWEN_BUFFER *dbuf, const ch
|
||||
}
|
||||
|
||||
if (AQH_Value3Msg_GetValueType(msg)==AQH_MSG_VALUE3_TYPE_DOOR)
|
||||
GWEN_Buffer_AppendArgs(dbuf, "0x%02x->0x%02x: VALUE3(%s) %s (uid=0x%08x, msgId=%u, value_id=0x%02x type=%s value=%s)\n",
|
||||
GWEN_Buffer_AppendArgs(dbuf,
|
||||
"0x%02x->0x%02x: VALUE3(%s) %s (uid=0x%08x, msgId=%u, value_id=0x%02x type=%s value=%s [%04x/%04x])\n",
|
||||
AQH_NodeMsg_GetSourceAddress(msg),
|
||||
AQH_NodeMsg_GetDestAddress(msg),
|
||||
sCmd,
|
||||
@@ -204,7 +209,9 @@ void AQH_Value3Msg_DumpToBuffer(const GWEN_MSG *msg, GWEN_BUFFER *dbuf, const ch
|
||||
(unsigned int)AQH_Value3Msg_GetMsgId(msg),
|
||||
AQH_Value3Msg_GetValueId(msg),
|
||||
AQH_Value3Msg_GetValueTypeName(msg),
|
||||
AQH_Value3Msg_GetValueAsWindowStateString(msg));
|
||||
AQH_Value3Msg_GetValueAsWindowStateString(msg),
|
||||
AQH_Value3Msg_GetValueNom(msg),
|
||||
AQH_Value3Msg_GetValueDenom(msg));
|
||||
else
|
||||
GWEN_Buffer_AppendArgs(dbuf,
|
||||
"0x%02x->0x%02x: VALUE3(%s) %s (uid=0x%08x, msgId=%u, value_id=0x%02x type=%s value=%f [%04x/%04x])\n",
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
#define AQH_MSG_VALUE3_TYPE_HUMIDITY 2
|
||||
#define AQH_MSG_VALUE3_TYPE_DOOR 3
|
||||
#define AQH_MSG_VALUE3_TYPE_MOTION 6
|
||||
#define AQH_MSG_VALUE3_TYPE_CO2 7
|
||||
#define AQH_MSG_VALUE3_TYPE_TVOC 8
|
||||
|
||||
|
||||
AQHOME_API GWEN_MSG *AQH_Value3Msg_new(uint8_t srcAddr, uint8_t destAddr,
|
||||
|
||||
Reference in New Issue
Block a user