aqhome/mqtt: added messages regarding subscription.
This commit is contained in:
@@ -45,7 +45,6 @@ static void _processRecvStatsMessage(GWEN_MSG_ENDPOINT *ep, GWEN_MSG *nodeMsg);
|
||||
static void _publishDouble(GWEN_MSG_ENDPOINT *ep, uint32_t uid, int valueId, const char *valuePath, double v);
|
||||
static void _publishInt(GWEN_MSG_ENDPOINT *ep, uint32_t uid, int valueId, const char *valuePath, int v);
|
||||
static void _publishString(GWEN_MSG_ENDPOINT *ep, uint32_t uid, int valueId, const char *valuePath, const char *v);
|
||||
static const char *_valueTypeToString(int t);
|
||||
static int _isMsgComplete(GWEN_MSG_ENDPOINT *ep, GWEN_MSG *msg);
|
||||
static int _calcAndSetPayloadSizeAndOffset(GWEN_MSG *msg);
|
||||
|
||||
@@ -318,11 +317,18 @@ void _processOutMessage(GWEN_MSG_ENDPOINT *ep, GWEN_MSG *nodeMsg)
|
||||
|
||||
void _processValue2Message(GWEN_MSG_ENDPOINT *ep, GWEN_MSG *nodeMsg)
|
||||
{
|
||||
_publishDouble(ep,
|
||||
AQH_Value2Msg_GetUid(nodeMsg),
|
||||
AQH_Value2Msg_GetValueId(nodeMsg),
|
||||
_valueTypeToString(AQH_Value2Msg_GetValueId(nodeMsg)),
|
||||
AQH_Value2Msg_GetValue(nodeMsg));
|
||||
if (AQH_Value2Msg_GetValueType(nodeMsg)==AQH_MSG_VALUE2_TYPE_DOOR)
|
||||
_publishString(ep,
|
||||
AQH_Value2Msg_GetUid(nodeMsg),
|
||||
AQH_Value2Msg_GetValueId(nodeMsg),
|
||||
AQH_Value2Msg_GetValueTypeName(nodeMsg),
|
||||
AQH_Value2Msg_GetValueAsWindowStateString(nodeMsg));
|
||||
else
|
||||
_publishDouble(ep,
|
||||
AQH_Value2Msg_GetUid(nodeMsg),
|
||||
AQH_Value2Msg_GetValueId(nodeMsg),
|
||||
AQH_Value2Msg_GetValueTypeName(nodeMsg),
|
||||
AQH_Value2Msg_GetValue(nodeMsg));
|
||||
}
|
||||
|
||||
|
||||
@@ -437,17 +443,6 @@ void _publishString(GWEN_MSG_ENDPOINT *ep, uint32_t uid, int valueId, const char
|
||||
|
||||
|
||||
|
||||
const char *_valueTypeToString(int t)
|
||||
{
|
||||
switch(t) {
|
||||
case AQH_MSG_VALUE2_TYPE_TEMP: return "temperature";
|
||||
case AQH_MSG_VALUE2_TYPE_HUMIDITY: return "humidity";
|
||||
default: return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
int _isMsgComplete(GWEN_UNUSED GWEN_MSG_ENDPOINT *ep, GWEN_MSG *msg)
|
||||
{
|
||||
int rv;
|
||||
|
||||
Reference in New Issue
Block a user