aqhome-apps: all apps now work again.
This commit is contained in:
@@ -12,14 +12,15 @@
|
||||
|
||||
#include "./u_valueset.h"
|
||||
|
||||
#include "aqhome/ipc/data/msg_data_set.h"
|
||||
#include "aqhome/ipc/data/ipc_data.h"
|
||||
#include "aqhome/msg/ipc/data/m_ipcd.h"
|
||||
#include "aqhome/msg/ipc/data/m_ipcd_setdata.h"
|
||||
#include "aqhome/ipc2/endpoint.h"
|
||||
|
||||
#include <gwenhywfar/debug.h>
|
||||
#include <gwenhywfar/text.h>
|
||||
|
||||
|
||||
//#define DEBUG_DRY_RUN 1 /* don't actually set value if "1" */
|
||||
#define DEBUG_DRY_RUN 0 /* don't actually set value if "1" */
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------
|
||||
@@ -37,10 +38,8 @@
|
||||
*/
|
||||
|
||||
static void _cbInputData(AQHREACT_UNIT *unit, AQHREACT_PORT *port, const AQHREACT_DATAOBJECT *dataObject);
|
||||
static GWEN_MSG *_mkSetDataMsgString(GWEN_MSG_ENDPOINT *brokerEndpoint,
|
||||
const char *sValueName, const AQHREACT_DATAOBJECT *dataObject);
|
||||
static GWEN_MSG *_mkSetDataMsgDouble(GWEN_MSG_ENDPOINT *brokerEndpoint,
|
||||
const char *sValueName, const AQHREACT_DATAOBJECT *dataObject);
|
||||
static AQH_MESSAGE *_mkSetDataMsgString(AQH_OBJECT *brokerEndpoint, const char *sValueName, const AQHREACT_DATAOBJECT *dataObject);
|
||||
static AQH_MESSAGE *_mkSetDataMsgDouble(AQH_OBJECT *brokerEndpoint, const char *sValueName, const AQHREACT_DATAOBJECT *dataObject);
|
||||
|
||||
|
||||
|
||||
@@ -49,7 +48,7 @@ static GWEN_MSG *_mkSetDataMsgDouble(GWEN_MSG_ENDPOINT *brokerEndpoint,
|
||||
* ------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
AQHREACT_UNIT *AqHomeReact_UnitValueSet_new(AQHOME_REACT *aqh)
|
||||
AQHREACT_UNIT *AqHomeReact_UnitValueSet_new(AQH_OBJECT *aqh)
|
||||
{
|
||||
AQHREACT_UNIT *unit;
|
||||
AQHREACT_PORT *port;
|
||||
@@ -83,11 +82,11 @@ void _cbInputData(AQHREACT_UNIT *unit, AQHREACT_PORT *port, const AQHREACT_DATAO
|
||||
|
||||
sValueName=AQHREACT_Unit_GetParamValueString(unit, AQHOMEREACT_UNIT_VALUESET_PARAM_VALUENAME, NULL);
|
||||
if (sValueName && *sValueName) {
|
||||
GWEN_MSG_ENDPOINT *brokerEndpoint;
|
||||
AQH_OBJECT *brokerEndpoint;
|
||||
|
||||
brokerEndpoint=AqHomeReact_GetBrokerEndpoint(AQHREACT_Unit_GetAqHomeReact(unit));
|
||||
brokerEndpoint=AQH_ReactServer_GetBrokerEndpoint(AQHREACT_Unit_GetAqHomeReact(unit));
|
||||
if (brokerEndpoint) {
|
||||
GWEN_MSG *msgOut;
|
||||
AQH_MESSAGE *msgOut;
|
||||
|
||||
switch(AQHREACT_DataObject_GetDataType(dataObject)) {
|
||||
case AQHREACT_DATAOBJECTTYPE_DOUBLE:
|
||||
@@ -110,10 +109,10 @@ void _cbInputData(AQHREACT_UNIT *unit, AQHREACT_PORT *port, const AQHREACT_DATAO
|
||||
AQHREACT_DataObject_Dump(dataObject, dbuf, 0);
|
||||
DBG_ERROR(NULL, "%s\n", GWEN_Buffer_GetStart(dbuf));
|
||||
GWEN_Buffer_free(dbuf);
|
||||
GWEN_Msg_free(msgOut);
|
||||
AQH_Message_free(msgOut);
|
||||
#else
|
||||
DBG_INFO(NULL, "Sending data for value \"%s\"", sValueName);
|
||||
GWEN_MsgEndpoint_AddSendMessage(brokerEndpoint, msgOut);
|
||||
AQH_Endpoint_AddMsgOut(brokerEndpoint, msgOut);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -122,26 +121,27 @@ void _cbInputData(AQHREACT_UNIT *unit, AQHREACT_PORT *port, const AQHREACT_DATAO
|
||||
}
|
||||
|
||||
|
||||
GWEN_MSG *_mkSetDataMsgString(GWEN_MSG_ENDPOINT *brokerEndpoint, const char *sValueName, const AQHREACT_DATAOBJECT *dataObject)
|
||||
|
||||
AQH_MESSAGE *_mkSetDataMsgString(AQH_OBJECT *brokerEndpoint, const char *sValueName, const AQHREACT_DATAOBJECT *dataObject)
|
||||
{
|
||||
GWEN_MSG *msgOut;
|
||||
AQH_MESSAGE *msgOut;
|
||||
AQH_VALUE *v;
|
||||
|
||||
v=AQH_Value_new();
|
||||
AQH_Value_SetNameForSystem(v, sValueName);
|
||||
|
||||
msgOut=AQH_SetDataIpcMsg_new(AQH_MSGTYPE_IPC_DATA_SETDATA,
|
||||
GWEN_MsgEndpoint_GetNextMessageId(brokerEndpoint), 0,
|
||||
v, AQHREACT_DataObject_GetStringData(dataObject));
|
||||
msgOut=AQH_IpcdMessageSetData_new(AQH_MSGTYPE_IPC_DATA_SETDATA,
|
||||
AQH_Endpoint_GetNextMessageId(brokerEndpoint), 0,
|
||||
v, AQHREACT_DataObject_GetStringData(dataObject));
|
||||
AQH_Value_free(v);
|
||||
return msgOut;
|
||||
}
|
||||
|
||||
|
||||
|
||||
GWEN_MSG *_mkSetDataMsgDouble(GWEN_MSG_ENDPOINT *brokerEndpoint, const char *sValueName, const AQHREACT_DATAOBJECT *dataObject)
|
||||
AQH_MESSAGE *_mkSetDataMsgDouble(AQH_OBJECT *brokerEndpoint, const char *sValueName, const AQHREACT_DATAOBJECT *dataObject)
|
||||
{
|
||||
GWEN_MSG *msgOut;
|
||||
AQH_MESSAGE *msgOut;
|
||||
AQH_VALUE *v;
|
||||
double data;
|
||||
GWEN_BUFFER *buf;
|
||||
@@ -159,9 +159,9 @@ GWEN_MSG *_mkSetDataMsgDouble(GWEN_MSG_ENDPOINT *brokerEndpoint, const char *sVa
|
||||
return NULL;
|
||||
}
|
||||
|
||||
msgOut=AQH_SetDataIpcMsg_new(AQH_MSGTYPE_IPC_DATA_SETDATA,
|
||||
GWEN_MsgEndpoint_GetNextMessageId(brokerEndpoint), 0,
|
||||
v, GWEN_Buffer_GetStart(buf));
|
||||
msgOut=AQH_IpcdMessageSetData_new(AQH_MSGTYPE_IPC_DATA_SETDATA,
|
||||
AQH_Endpoint_GetNextMessageId(brokerEndpoint), 0,
|
||||
v, GWEN_Buffer_GetStart(buf));
|
||||
GWEN_Buffer_free(buf);
|
||||
AQH_Value_free(v);
|
||||
return msgOut;
|
||||
|
||||
Reference in New Issue
Block a user