mirror of
https://github.com/open62541/open62541.git
synced 2025-06-03 04:00:21 +00:00
add client to dataChangeHandler
This commit is contained in:
parent
e4e3f1e6eb
commit
65db398dcb
@ -6,7 +6,7 @@
|
||||
|
||||
#ifdef UA_ENABLE_SUBSCRIPTIONS
|
||||
static void
|
||||
handler_TheAnswerChanged(UA_UInt32 monId, UA_DataValue *value, void *context) {
|
||||
handler_TheAnswerChanged(UA_Client *client, UA_UInt32 monId, UA_DataValue *value, void *context) {
|
||||
printf("The Answer has changed!\n");
|
||||
}
|
||||
#endif
|
||||
|
@ -43,7 +43,7 @@ static void stopHandler(int sign) {
|
||||
}
|
||||
|
||||
static void
|
||||
handler_currentTimeChanged(UA_UInt32 monId, UA_DataValue *value, void *context) {
|
||||
handler_currentTimeChanged(UA_Client *client, UA_UInt32 monId, UA_DataValue *value, void *context) {
|
||||
UA_LOG_INFO(logger, UA_LOGCATEGORY_USERLAND, "currentTime has changed!");
|
||||
if(UA_Variant_hasScalarType(&value->value, &UA_TYPES[UA_TYPES_DATETIME])) {
|
||||
UA_DateTime raw_date = *(UA_DateTime *) value->value.data;
|
||||
|
@ -597,8 +597,8 @@ UA_Client_Subscriptions_manuallySendPublishRequest(UA_Client *client);
|
||||
|
||||
/* Addition of monitored DataChanges */
|
||||
/* TODO for v0.4: Rename method to _DataChange. */
|
||||
typedef void (*UA_MonitoredItemHandlingFunction)(UA_UInt32 monId, UA_DataValue *value,
|
||||
void *context);
|
||||
typedef void (*UA_MonitoredItemHandlingFunction)(UA_Client *client, UA_UInt32 monId,
|
||||
UA_DataValue *value, void *context);
|
||||
|
||||
UA_StatusCode UA_EXPORT
|
||||
UA_Client_Subscriptions_addMonitoredItems(UA_Client *client, const UA_UInt32 subscriptionId,
|
||||
|
@ -424,7 +424,8 @@ UA_Client_processPublishResponse(UA_Client *client, UA_PublishRequest *request,
|
||||
continue;
|
||||
}
|
||||
|
||||
mon->handler.dataChangeHandler(mon->monitoredItemId, &mitemNot->value, mon->handlerContext);
|
||||
mon->handler.dataChangeHandler(client, mon->monitoredItemId,
|
||||
&mitemNot->value, mon->handlerContext);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ static void teardown(void) {
|
||||
UA_Boolean notificationReceived;
|
||||
UA_UInt32 countNotificationReceived = 0;
|
||||
|
||||
static void monitoredItemHandler(UA_UInt32 monId, UA_DataValue *value, void *context) {
|
||||
static void monitoredItemHandler(UA_Client *client, UA_UInt32 monId, UA_DataValue *value, void *context) {
|
||||
notificationReceived = true;
|
||||
countNotificationReceived++;
|
||||
}
|
||||
|
@ -360,7 +360,7 @@ translateBrowsePathsToNodeIdsRequest(UA_Client *client) {
|
||||
|
||||
|
||||
static void
|
||||
monitoredItemHandler(UA_UInt32 monId, UA_DataValue *value, void *context) {
|
||||
monitoredItemHandler(UA_Client *client, UA_UInt32 monId, UA_DataValue *value, void *context) {
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user