aqhome: fixed endpoint code. Now works again.

This commit is contained in:
Martin Preuss
2023-03-18 01:57:20 +01:00
parent 6507f3896f
commit 12d197dae2
12 changed files with 561 additions and 762 deletions

View File

@@ -26,6 +26,8 @@ GWEN_INHERIT(GWEN_MSG_ENDPOINT_MGR, AQH_MSG_ENDPOINT_MGR);
static void GWENHYWFAR_CB _freeData(void *bp, void *p);
static void _msgLoopOnce(GWEN_MSG_ENDPOINT_MGR *emgr);
static void _handleEndpoint(GWEN_MSG_ENDPOINT_MGR *emgr, GWEN_MSG_ENDPOINT *ep);
static void _handleNodeEndpoint(GWEN_MSG_ENDPOINT_MGR *emgr, GWEN_MSG_ENDPOINT *ep);
static void _handleIpcEndpoint(GWEN_MSG_ENDPOINT_MGR *emgr, GWEN_MSG_ENDPOINT *ep);
@@ -62,6 +64,18 @@ void _freeData(void *bp, void *p)
int AQH_MsgEndpointMgr_LoopOnce(GWEN_MSG_ENDPOINT_MGR *emgr)
{
int rv;
rv=GWEN_MsgEndpointMgr_IoLoopOnce(emgr);
_msgLoopOnce(emgr);
GWEN_MsgEndpointMgr_RunAllEndpoints(emgr);
return rv;
}
void _msgLoopOnce(GWEN_MSG_ENDPOINT_MGR *emgr)
{
GWEN_MSG_ENDPOINT_LIST *endpointList;
@@ -131,17 +145,17 @@ void _distributeMsgFromNodeEndpoint(GWEN_MSG_ENDPOINT_MGR *emgr, GWEN_MSG_ENDPOI
ep=GWEN_MsgEndpoint_List_First(endpointList);
while(ep) {
if (ep!=srcEp) {
uint32_t acceptedGroupIds;
uint32_t acceptedMsgGroups;
DBG_DEBUG(AQH_LOGDOMAIN, "- checking endpoint %s", GWEN_MsgEndpoint_GetName(ep));
acceptedGroupIds=AQH_NodeEndpoint_GetAcceptedMsgGroups(ep);
acceptedMsgGroups=AQH_NodeEndpoint_GetAcceptedMsgGroups(ep);
DBG_DEBUG(AQH_LOGDOMAIN, "- checking endpoint %s (msgGroup=%08x, accept: %08x, flags: %08x)",
GWEN_MsgEndpoint_GetName(ep),
msgGroup, acceptedMsgGroups,
GWEN_MsgEndpoint_GetFlags(ep));
if (
!(GWEN_MsgEndpoint_GetFlags(ep) & AQH_MSGEP_NODE_FLAGS_NOMESSAGES) &&
(acceptedMsgGroups & msgGroup) &&
(acceptedGroupIds & srcGroupId)
(msgGroup & acceptedMsgGroups)
) {
/* endpoint accepts this message */
DBG_DEBUG(AQH_LOGDOMAIN, " - endpoint %s accepts message", GWEN_MsgEndpoint_GetName(ep));