Selaa lähdekoodia

Merge branch 'Aleskey78-subs_cb_monid'

Stasik0 8 vuotta sitten
vanhempi
commit
8d2b8f1e75

+ 1 - 1
examples/client.c

@@ -14,7 +14,7 @@
 
 #include <stdio.h>
 
-static void handler_TheAnswerChanged(UA_UInt32 handle, UA_DataValue *value) {
+static void handler_TheAnswerChanged(UA_UInt32 monId, UA_DataValue *value, void *context) {
     printf("The Answer has changed!\n");
     return;
 }

+ 1 - 1
src/client/ua_client_highlevel_subscriptions.c

@@ -235,7 +235,7 @@ UA_Client_processPublishRx(UA_Client *client, UA_PublishResponse response) {
                 // find this client handle
                 LIST_FOREACH(mon, &sub->MonitoredItems, listEntry) {
                     if(mon->ClientHandle == mitemNot->clientHandle) {
-                        mon->handler(mitemNot->clientHandle, &mitemNot->value, mon->handlerContext);
+                        mon->handler(mon->MonitoredItemId, &mitemNot->value, mon->handlerContext);
                         break;
                     }
                 }

+ 1 - 1
src/client/ua_client_internal.h

@@ -24,7 +24,7 @@ typedef struct UA_Client_MonitoredItem_s {
     UA_Double  SamplingInterval;
     UA_UInt32  QueueSize;
     UA_Boolean DiscardOldest;
-    void       (*handler)(UA_UInt32 handle, UA_DataValue *value, void *context);
+    void       (*handler)(UA_UInt32 monId, UA_DataValue *value, void *context);
     void       *handlerContext;
     LIST_ENTRY(UA_Client_MonitoredItem_s)  listEntry;
 } UA_Client_MonitoredItem;