Started working on aqhome-nodes which will replace aqhomed.
This commit is contained in:
@@ -156,6 +156,17 @@ uint16_t AQH_MqttClientEndpoint_GetNextPacketId(const GWEN_MSG_ENDPOINT *ep)
|
||||
|
||||
|
||||
|
||||
void _moveMessagesBetweenLists(GWEN_MSG_LIST *srcList, GWEN_MSG_LIST *dstList)
|
||||
{
|
||||
GWEN_MSG *msg;
|
||||
|
||||
while( (msg=GWEN_Msg_List_First(srcList)) ) {
|
||||
GWEN_Msg_List_Del(msg);
|
||||
GWEN_Msg_List_Add(msg, dstList);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void _addSockets(GWEN_MSG_ENDPOINT *ep, GWEN_SOCKETSET *readSet, GWEN_SOCKETSET *writeSet, GWEN_SOCKETSET *xSet)
|
||||
{
|
||||
@@ -270,6 +281,19 @@ void _addSocketsWhenConnected(GWEN_MSG_ENDPOINT *ep, GWEN_MSG_ENDPOINT *epChild,
|
||||
|
||||
|
||||
|
||||
void _checkSocketsWhenConnected(GWEN_MSG_ENDPOINT *ep, GWEN_MSG_ENDPOINT *epChild,
|
||||
GWEN_SOCKETSET *readSet, GWEN_SOCKETSET *writeSet, GWEN_SOCKETSET *xSet)
|
||||
{
|
||||
_moveMessagesBetweenLists(GWEN_MsgEndpoint_GetSendMessageList(ep), GWEN_MsgEndpoint_GetSendMessageList(epChild));
|
||||
GWEN_MsgEndpoint_CheckSockets(epChild, readSet, writeSet, xSet);
|
||||
_moveMessagesBetweenLists(GWEN_MsgEndpoint_GetReceivedMessageList(epChild), GWEN_MsgEndpoint_GetReceivedMessageList(ep));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void _checkSocketsWhenConnecting(GWEN_MSG_ENDPOINT *ep, GWEN_MSG_ENDPOINT *epChild,
|
||||
GWEN_SOCKETSET *readSet, GWEN_SOCKETSET *writeSet, GWEN_SOCKETSET *xSet)
|
||||
{
|
||||
@@ -310,16 +334,6 @@ void _checkSocketsWhenConnecting(GWEN_MSG_ENDPOINT *ep, GWEN_MSG_ENDPOINT *epChi
|
||||
|
||||
|
||||
|
||||
void _checkSocketsWhenConnected(GWEN_MSG_ENDPOINT *ep, GWEN_MSG_ENDPOINT *epChild,
|
||||
GWEN_SOCKETSET *readSet, GWEN_SOCKETSET *writeSet, GWEN_SOCKETSET *xSet)
|
||||
{
|
||||
_moveMessagesBetweenLists(GWEN_MsgEndpoint_GetSendMessageList(ep), GWEN_MsgEndpoint_GetSendMessageList(epChild));
|
||||
GWEN_MsgEndpoint_CheckSockets(epChild, readSet, writeSet, xSet);
|
||||
_moveMessagesBetweenLists(GWEN_MsgEndpoint_GetReceivedMessageList(epChild), GWEN_MsgEndpoint_GetReceivedMessageList(ep));
|
||||
}
|
||||
|
||||
|
||||
|
||||
int _startConnect(GWEN_MSG_ENDPOINT *ep)
|
||||
{
|
||||
GWEN_MSG_ENDPOINT *epChild;
|
||||
@@ -347,18 +361,3 @@ int _startConnect(GWEN_MSG_ENDPOINT *ep)
|
||||
|
||||
|
||||
|
||||
void _moveMessagesBetweenLists(GWEN_MSG_LIST *srcList, GWEN_MSG_LIST *dstList)
|
||||
{
|
||||
GWEN_MSG *msg;
|
||||
|
||||
while( (msg=GWEN_Msg_List_First(srcList)) ) {
|
||||
GWEN_Msg_List_Del(msg);
|
||||
GWEN_Msg_List_Add(msg, dstList);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user