Commit 3af3d9d9 authored by Stefan Profanter's avatar Stefan Profanter Committed by Stefan Profanter
Browse files

Also add client to monitoredEvent callback

Showing with 18 additions and 3 deletions
+18 -3
This changelog reports changes to the public API. Internal refactorings and bug
fixes are not reported here.
2018-02-05 pro <profanter at fortiss.org>
* Also pass client to monitoredItem/Events callback
The UA_MonitoredItemHandlingFunction and UA_MonitoredEventHandlingFunction
did not include a reference to the corresponding client used for the call of
processPublishResponse.
This now also allows to get the client context within the monitored item
handling function.
The API changes are detected by the type-matching in the compiler. So there
is little risk for bugs due to unaligned implementations.
2017-09-07 jpfr <julius.pfrommer at web.de>
* Make Client Highlevel Interface consistent
......
......@@ -14,7 +14,8 @@ static void stopHandler(int sig) {
#ifdef UA_ENABLE_SUBSCRIPTIONS
static void
handler_events(const UA_UInt32 monId, const size_t nEventFields,
handler_events(UA_Client *client,
const UA_UInt32 monId, const size_t nEventFields,
const UA_Variant *eventFields, void *context) {
UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_USERLAND, "Notification");
......
......@@ -617,7 +617,8 @@ UA_Client_Subscriptions_addMonitoredItem(UA_Client *client, UA_UInt32 subscripti
/* Monitored Events have different payloads from DataChanges. So they use a
* different callback method signature. */
typedef void (*UA_MonitoredEventHandlingFunction)(const UA_UInt32 monId,
typedef void (*UA_MonitoredEventHandlingFunction)(UA_Client *client,
const UA_UInt32 monId,
const size_t nEventFields,
const UA_Variant *eventFields,
void *context);
......
......@@ -458,7 +458,7 @@ UA_Client_processPublishResponse(UA_Client *client, UA_PublishRequest *request,
continue;
}
mon->handler.eventHandler(mon->monitoredItemId, eventFieldList->eventFieldsSize,
mon->handler.eventHandler(client, mon->monitoredItemId, eventFieldList->eventFieldsSize,
eventFieldList->eventFields, mon->handlerContext);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment