Ver código fonte

align client getendpoints with naming conventions

Julius Pfrommer 9 anos atrás
pai
commit
525e5a1404
3 arquivos alterados com 11 adições e 8 exclusões
  1. 4 4
      examples/client.c
  2. 3 2
      include/ua_client.h
  3. 4 2
      src/client/ua_client.c

+ 4 - 4
examples/client.c

@@ -25,8 +25,9 @@ int main(int argc, char *argv[]) {
     //listing endpoints
     UA_EndpointDescription* endpointArray = NULL;
     size_t endpointArraySize = 0;
-    UA_StatusCode retval = UA_client_getEndpoints(client, UA_ClientConnectionTCP,
-            "opc.tcp://localhost:16664", &endpointArraySize, &endpointArray);
+    UA_StatusCode retval =
+        UA_Client_getEndpoints(client, UA_ClientConnectionTCP, "opc.tcp://localhost:16664",
+                               &endpointArraySize, &endpointArray);
 
     //freeing the endpointArray
     if(retval != UA_STATUSCODE_GOOD) {
@@ -45,8 +46,7 @@ int main(int argc, char *argv[]) {
     UA_Array_delete(endpointArray,endpointArraySize, &UA_TYPES[UA_TYPES_ENDPOINTDESCRIPTION]);
 
     //connect to a server
-    retval = UA_Client_connect(client, UA_ClientConnectionTCP,
-                                             "opc.tcp://localhost:16664");
+    retval = UA_Client_connect(client, UA_ClientConnectionTCP, "opc.tcp://localhost:16664");
 
     if(retval != UA_STATUSCODE_GOOD) {
         UA_Client_delete(client);

+ 3 - 2
include/ua_client.h

@@ -64,8 +64,9 @@ typedef UA_Connection (*UA_ConnectClientConnection)(UA_ConnectionConfig localCon
  * @return Indicates whether the operation succeeded or returns an error code
  */
 UA_StatusCode UA_EXPORT
-UA_client_getEndpoints(UA_Client *client, UA_ConnectClientConnection connectFunc,
-        const char *serverUrl, size_t* endpointDescriptionsSize, UA_EndpointDescription** endpointDescriptions);
+UA_Client_getEndpoints(UA_Client *client, UA_ConnectClientConnection connectFunc,
+                       const char *serverUrl, size_t* endpointDescriptionsSize,
+                       UA_EndpointDescription** endpointDescriptions);
 /**
  * start a connection to the selected server
  *

+ 4 - 2
src/client/ua_client.c

@@ -504,8 +504,10 @@ static UA_StatusCode CloseSecureChannel(UA_Client *client) {
     return retval;
 }
 
-UA_StatusCode UA_client_getEndpoints(UA_Client *client, UA_ConnectClientConnection connectFunc,
-        const char *serverUrl, size_t* endpointDescriptionsSize, UA_EndpointDescription** endpointDescriptions) {
+UA_StatusCode
+UA_Client_getEndpoints(UA_Client *client, UA_ConnectClientConnection connectFunc,
+                       const char *serverUrl, size_t* endpointDescriptionsSize,
+                       UA_EndpointDescription** endpointDescriptions) {
     if(client->state == UA_CLIENTSTATE_CONNECTED)
         return UA_STATUSCODE_GOOD;
     if(client->state == UA_CLIENTSTATE_ERRORED) {