Przeglądaj źródła

Client: Remove ackResponseCallback

Julius Pfrommer 6 lat temu
rodzic
commit
43ac1ee9e7

+ 1 - 2
src/client/ua_client.c

@@ -535,8 +535,7 @@ receivePacketAsync(UA_Client *client) {
     UA_StatusCode retval = UA_STATUSCODE_GOOD;
     if (UA_Client_getState(client) == UA_CLIENTSTATE_DISCONNECTED ||
             UA_Client_getState(client) == UA_CLIENTSTATE_WAITING_FOR_ACK) {
-        retval = UA_Connection_receiveChunksNonBlocking(
-                &client->connection, client, client->ackResponseCallback);
+        retval = UA_Connection_receiveChunksNonBlocking(&client->connection, client, processACKResponseAsync);
     }
     else if(UA_Client_getState(client) == UA_CLIENTSTATE_CONNECTED) {
         retval = UA_Connection_receiveChunksNonBlocking(

+ 1 - 2
src/client/ua_client_connect_async.c

@@ -50,7 +50,7 @@ static UA_StatusCode
 requestGetEndpoints(UA_Client *client, UA_UInt32 *requestId);
 
 /*receives hello ack, opens secure channel*/
-static UA_StatusCode
+UA_StatusCode
 processACKResponseAsync(void *application, UA_Connection *connection,
                          UA_ByteString *chunk) {
     UA_Client *client = (UA_Client*)application;
@@ -567,7 +567,6 @@ UA_Client_connect_async(UA_Client *client, const char *endpointUrl,
     UA_ChannelSecurityToken_init(&client->channel.securityToken);
     client->channel.state = UA_SECURECHANNELSTATE_FRESH;
     /* Set up further callback function to handle secure channel and session establishment  */
-    client->ackResponseCallback = processACKResponseAsync;
     client->openSecureChannelResponseCallback = processOPNResponse;
     client->endpointsHandshake = true;
 

+ 4 - 1
src/client/ua_client_internal.h

@@ -157,7 +157,6 @@ struct UA_Client {
     UA_NodeId authenticationToken;
     UA_UInt32 requestHandle;
     /* Connection Establishment (async) */
-    UA_Connection_processChunk ackResponseCallback;
     UA_Connection_processChunk openSecureChannelResponseCallback;
     UA_Boolean endpointsHandshake;
 
@@ -200,6 +199,10 @@ UA_Client_getEndpointsInternal(UA_Client *client,
 UA_StatusCode
 receivePacketAsync(UA_Client *client);
 
+UA_StatusCode
+processACKResponseAsync(void *application, UA_Connection *connection,
+                        UA_ByteString *chunk);
+
 UA_StatusCode
 openSecureChannel(UA_Client *client, UA_Boolean renew);