adapted to latest changes in gwen (msgio API v2 becomes v1).
This commit is contained in:
@@ -143,7 +143,7 @@ int main(int argc, char **argv)
|
||||
int _serve(GWEN_DB_NODE *dbArgs)
|
||||
{
|
||||
const char *pidFile;
|
||||
GWEN_MSG_ENDPOINT2 *epTcp;
|
||||
GWEN_MSG_ENDPOINT *epTcp;
|
||||
ITEM_LIST *itemList;
|
||||
int rv;
|
||||
int timeout;
|
||||
@@ -186,7 +186,7 @@ int _serve(GWEN_DB_NODE *dbArgs)
|
||||
rv=AqHomeMqttLog_MqttConnect(epTcp);
|
||||
if (rv<0) {
|
||||
DBG_INFO(NULL, "here (%d)", rv);
|
||||
GWEN_MsgEndpoint2_free(epTcp);
|
||||
GWEN_MsgEndpoint_free(epTcp);
|
||||
Item_List_free(itemList);
|
||||
return rv;
|
||||
}
|
||||
@@ -194,7 +194,7 @@ int _serve(GWEN_DB_NODE *dbArgs)
|
||||
rv=AqHomeMqttLog_Subscribe(epTcp, "#");
|
||||
if (rv<0) {
|
||||
DBG_INFO(NULL, "here (%d)", rv);
|
||||
GWEN_MsgEndpoint2_free(epTcp);
|
||||
GWEN_MsgEndpoint_free(epTcp);
|
||||
Item_List_free(itemList);
|
||||
return rv;
|
||||
}
|
||||
@@ -203,14 +203,14 @@ int _serve(GWEN_DB_NODE *dbArgs)
|
||||
|
||||
while(!stopService) {
|
||||
DBG_DEBUG(NULL, "Next loop");
|
||||
GWEN_MsgEndpoint2_IoLoop(epTcp, 2000); /* 2000 ms */
|
||||
if (GWEN_MsgEndpoint2_GetState(epTcp)!=GWEN_MSG_ENDPOINT_STATE_CONNECTED) {
|
||||
GWEN_MsgEndpoint_IoLoop(epTcp, 2000); /* 2000 ms */
|
||||
if (GWEN_MsgEndpoint_GetState(epTcp)!=GWEN_MSG_ENDPOINT_STATE_CONNECTED) {
|
||||
DBG_INFO(NULL, "Not connected...");
|
||||
}
|
||||
else {
|
||||
GWEN_MSG *msg;
|
||||
|
||||
msg=GWEN_MsgEndpoint2_TakeFirstReceivedMessage(epTcp);
|
||||
msg=GWEN_MsgEndpoint_TakeFirstReceivedMessage(epTcp);
|
||||
if (msg) {
|
||||
#ifdef FULL_DEBUG
|
||||
DBG_ERROR(NULL, "Received this message:");
|
||||
@@ -267,7 +267,7 @@ int _serve(GWEN_DB_NODE *dbArgs)
|
||||
if (pidFile && *pidFile)
|
||||
remove(pidFile);
|
||||
|
||||
GWEN_MsgEndpoint2_free(epTcp);
|
||||
GWEN_MsgEndpoint_free(epTcp);
|
||||
Item_List_free(itemList);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user