aqhome apps: sending a message via aqhome-nodes to nodes now works.
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include "aqhome/msg/ipc/nodes/m_ipcn.h"
|
||||
#include "aqhome/msg/ipc/nodes/m_ipcn_getdevices_req.h"
|
||||
#include "aqhome/msg/ipc/nodes/m_ipcn_getdevices_rsp.h"
|
||||
#include "aqhome/msg/node/m_node.h"
|
||||
#include <aqhome/nodes/nodeinfo.h>
|
||||
|
||||
#include <gwenhywfar/args.h>
|
||||
@@ -78,6 +79,9 @@ int AQH_Tool_GetNodes(GWEN_DB_NODE *dbGlobalArgs, int argc, char **argv)
|
||||
|
||||
eventLoop=AQH_EventLoop_new();
|
||||
o=AQH_ToolClient_new(eventLoop, AQH_IPC_PROTOCOL_NODES_ID, AQH_IPC_PROTOCOL_NODES_VERSION, dbGlobalArgs, args);
|
||||
AQH_ToolClient_SetFlags(o, AQH_TOOL_CLIENT_CONNECTFLAGS_WITHCONNECTMSG | AQH_TOOL_CLIENT_CONNECTFLAGS_WITHGRPMSG);
|
||||
AQH_ToolClient_SetAcceptedGroups(o, AQH_MSG_TYPEGROUP_ALL);
|
||||
|
||||
AQH_ToolClient_SetCreateRequestMessageFn(o, _createRequestMessage);
|
||||
AQH_ToolClient_SetHandleResponseMessageFn(o, _handleResponseMessage);
|
||||
rv=AQH_ToolClient_ReadLocalArgs(o, argc, argv);
|
||||
|
||||
@@ -125,11 +125,11 @@ int _handleResponseMessage(AQH_OBJECT *o, const AQH_MESSAGE *msg, GWEN_UNUSED co
|
||||
code=AQH_NodeMessage_GetMsgType(msg);
|
||||
if ((code==AQH_MSG_TYPE_PONG) &&
|
||||
(nodeAddr==0 || nodeAddr==0xff || nodeAddr==AQH_NodeMessage_GetSourceAddress(msg))) {
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
DBG_INFO(NULL, "Unexpected message \"%d\"", code);
|
||||
return 3;
|
||||
DBG_ERROR(NULL, "Unexpected message \"%d\"", code);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user