More work on IPC code, added aqhomed daemon.

This commit is contained in:
Martin Preuss
2023-03-18 23:25:21 +01:00
parent c26119d34c
commit d1c21322b8
23 changed files with 1127 additions and 61 deletions

View File

@@ -8,6 +8,8 @@
#include "aqhome/msg/endpoint_node.h"
#include "aqhome/msg/endpoint_log.h"
#include "aqhome/msg/endpoint_tty.h"
#include "aqhome/ipc/endpoint_node_ipc_tcp.h"
#include "aqhome/msgmanager.h"
#include "aqhome/aqhome.h"
@@ -97,29 +99,37 @@ int testEndpoints()
GWEN_MSG_ENDPOINT_MGR *emgr;
GWEN_MSG_ENDPOINT *epTty;
GWEN_MSG_ENDPOINT *epLog;
GWEN_MSG_ENDPOINT *epTcp;
rv=AQH_Init();
if (rv<0) {
}
emgr=AQH_MsgEndpointMgr_new(0xc0);
epTty=AQH_TtyNodeEndpoint_new("/dev/ttyUSB0", AQH_MSG_ENDPOINTGROUP_NODE);
emgr=AQH_MsgManager_new(0xc0);
epTty=AQH_TtyNodeEndpoint_new("/dev/ttyUSB0", AQH_MSGMGR_ENDPOINTGROUP_NODE);
if (epTty==NULL) {
DBG_ERROR(NULL, "Error creating endpoint TTY");
return 2;
}
GWEN_MsgEndpointMgr_AddEndpoint(emgr, epTty);
epLog=AQH_LogEndpoint_new("endpoints.log", AQH_MSG_ENDPOINTGROUP_NODE);
epLog=AQH_LogEndpoint_new("endpoints.log", AQH_MSGMGR_ENDPOINTGROUP_NODE);
if (epLog==NULL) {
DBG_ERROR(AQH_LOGDOMAIN, "Error creating endpoint LOG");
return 2;
}
GWEN_MsgEndpointMgr_AddEndpoint(emgr, epLog);
epTcp=AQH_TcpIpcNodeEndpoint_new(NULL, "127.0.0.1", 45454, AQH_MSGMGR_ENDPOINTGROUP_IPC);
if (epTcp==NULL) {
DBG_ERROR(AQH_LOGDOMAIN, "Error creating endpoint TCP");
return 2;
}
GWEN_MsgEndpointMgr_AddEndpoint(emgr, epTcp);
for (;;) {
DBG_DEBUG(AQH_LOGDOMAIN, "Next loop");
AQH_MsgEndpointMgr_LoopOnce(emgr);
AQH_MsgManager_LoopOnce(emgr);
}
return 0;
}