瀏覽代碼

Merge branch 'StalderT-patch-9'

Stasik0 8 年之前
父節點
當前提交
9e557bf89f
共有 3 個文件被更改,包括 6 次插入3 次删除
  1. 2 1
      examples/client.c
  2. 2 1
      include/ua_client_highlevel.h
  3. 2 1
      src/client/ua_client_highlevel_subscriptions.c

+ 2 - 1
examples/client.c

@@ -46,7 +46,8 @@ 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);

+ 2 - 1
include/ua_client_highlevel.h

@@ -280,7 +280,8 @@ UA_StatusCode UA_EXPORT UA_Client_Subscriptions_manuallySendPublishRequest(UA_Cl
 UA_StatusCode UA_EXPORT
 UA_Client_Subscriptions_addMonitoredItem(UA_Client *client, UA_UInt32 subscriptionId,
                                          UA_NodeId nodeId, UA_UInt32 attributeID,
-                                         void *handlingFunction, void *handlingContext,
+                                         void (*handlingFunction)(UA_UInt32 handle, UA_DataValue *value, void *context),
+                                         void *handlingContext,
                                          UA_UInt32 *newMonitoredItemId);
 
 UA_StatusCode UA_EXPORT

+ 2 - 1
src/client/ua_client_highlevel_subscriptions.c

@@ -91,7 +91,8 @@ UA_StatusCode UA_Client_Subscriptions_remove(UA_Client *client, UA_UInt32 subscr
 UA_StatusCode
 UA_Client_Subscriptions_addMonitoredItem(UA_Client *client, UA_UInt32 subscriptionId,
                                          UA_NodeId nodeId, UA_UInt32 attributeID,
-                                         void *handlingFunction, void *handlingContext,
+                                         void (*handlingFunction)(UA_UInt32 handle, UA_DataValue *value, void *context),
+                                         void *handlingContext,
                                          UA_UInt32 *newMonitoredItemId) {
     UA_Client_Subscription *sub;
     LIST_FOREACH(sub, &client->subscriptions, listEntry) {