{"action":"created","comment":{"url":"https://api.github.com/repos/open62541/open62541/pulls/comments/180068498","pull_request_review_id":110423009,"id":180068498,"diff_hunk":"@@ -146,10 +148,108 @@ void MonitoredItem_ensureQueueSpace(UA_MonitoredItem *mon) {\n     /* TODO: Infobits for Events? */\n }\n \n+static UA_INLINE UA_Boolean\n+outOfDeadBand(const void *data1, const void *data2, const size_t index, const UA_DataType *type, const UA_Double deadbandValue) {\n+    if (type == &UA_TYPES[UA_TYPES_SBYTE]) {\n+        if (abs(((const UA_SByte*)data1)[index] - ((const UA_SByte*)data2)[index]) <= deadbandValue)\n+            return false;\n+    } else\n+    if (type == &UA_TYPES[UA_TYPES_BYTE]) {\n+        if (((const UA_Byte*)data1)[index] > ((const UA_Byte*)data2)[index]) {\n+            if ((((const UA_Byte*)data1)[index] - ((const UA_Byte*)data2)[index]) <= deadbandValue)\n+                return false;\n+        } else {\n+            if ((((const UA_Byte*)data2)[index] - ((const UA_Byte*)data1)[index]) <= deadbandValue)\n+                return false;\n+        }\n+    } else\n+    if (type == &UA_TYPES[UA_TYPES_INT16]) {\n+        if (abs(((const UA_Int16*)data1)[index] - ((const UA_Int16*)data2)[index]) <= deadbandValue)\n+            return false;\n+    } else\n+    if (type == &UA_TYPES[UA_TYPES_UINT16]) {\n+        if (((const UA_UInt16*)data1)[index] > ((const UA_UInt16*)data2)[index]) {\n+            if ((((const UA_UInt16*)data1)[index] - ((const UA_UInt16*)data2)[index]) <= deadbandValue)\n+                return false;\n+        } else {\n+            if ((((const UA_UInt16*)data2)[index] - ((const UA_UInt16*)data1)[index]) <= deadbandValue)\n+                return false;\n+        }\n+    } else\n+    if (type == &UA_TYPES[UA_TYPES_INT32]) {\n+        if (abs(((const UA_Int32*)data1)[index] - ((const UA_Int32*)data2)[index]) <= deadbandValue)\n+            return false;\n+    } else\n+    if (type == &UA_TYPES[UA_TYPES_UINT32]) {\n+        if (((const UA_UInt32*)data1)[index] > ((const UA_UInt32*)data2)[index]) {\n+            if ((((const UA_UInt32*)data1)[index] - ((const UA_UInt32*)data2)[index]) <= deadbandValue)\n+                return false;\n+        } else {\n+            if ((((const UA_UInt32*)data2)[index] - ((const UA_UInt32*)data1)[index]) <= deadbandValue)\n+                return false;\n+        }\n+    } else\n+    if (type == &UA_TYPES[UA_TYPES_INT64]) {\n+        if (llabs(((const UA_Int64*)data1)[index] - ((const UA_Int64*)data2)[index]) <= deadbandValue)\n+            return false;\n+    } else\n+    if (type == &UA_TYPES[UA_TYPES_UINT64]) {\n+        if (((const UA_UInt64*)data1)[index] > ((const UA_UInt64*)data2)[index]) {\n+            if ((((const UA_UInt64*)data1)[index] - ((const UA_UInt64*)data2)[index]) <= deadbandValue)\n+                return false;\n+        } else {\n+            if ((((const UA_UInt64*)data2)[index] - ((const UA_UInt64*)data1)[index]) <= deadbandValue)\n+                return false;\n+        }\n+    } else\n+    if (type == &UA_TYPES[UA_TYPES_FLOAT]) {\n+        if (fabsf(((const UA_Float*)data1)[index] - ((const UA_Float*)data2)[index]) <= deadbandValue)\n+            return false;\n+    } else\n+    if (type == &UA_TYPES[UA_TYPES_DOUBLE]) {\n+        if (fabs(((const UA_Double*)data1)[index] - ((const UA_Double*)data2)[index]) <= deadbandValue)\n+            return false;\n+    }\n+    return true;\n+}\n+\n+static UA_INLINE UA_Boolean\n+updateNeededForFilteredValue(const UA_Variant *value, const UA_Variant *oldValue, const UA_Double deadbandValue) {\n+    if (value->arrayLength != oldValue->arrayLength) {\n+        return true;\n+    }\n+    if (value->type != oldValue->type) {\n+        return true;\n+    }\n+    if (UA_Variant_isScalar(value)) {\n+        return outOfDeadBand(value->data, oldValue->data, 0, value->type, deadbandValue);\n+    } else {\n+        for (size_t i = 0; i < value->arrayLength; ++i) {\n+            if (outOfDeadBand(value->data, oldValue->data, i, value->type, deadbandValue))\n+                return true;\n+        }\n+    }\n+    return false;\n+}\n+\n /* Errors are returned as no change detected */\n static UA_Boolean\n detectValueChangeWithFilter(UA_MonitoredItem *mon, UA_DataValue *value,\n                             UA_ByteString *encoding) {\n+    if (isDataTypeNumeric(value->value.type)\n+            && (mon->filter.trigger == UA_DATACHANGETRIGGER_STATUSVALUE","path":"src/server/ua_subscription_datachange.c","position":83,"original_position":109,"commit_id":"ad9566c483263195c3a3706c06a3e3b8dd9c58e8","original_commit_id":"bbf85dac3e6153b20bcea9eaac98a9828755a3f3","user":{"login":"peter-rustler-basyskom","id":38132922,"avatar_url":"https://avatars3.githubusercontent.com/u/38132922?v=4","gravatar_id":"","url":"https://api.github.com/users/peter-rustler-basyskom","html_url":"https://github.com/peter-rustler-basyskom","followers_url":"https://api.github.com/users/peter-rustler-basyskom/followers","following_url":"https://api.github.com/users/peter-rustler-basyskom/following{/other_user}","gists_url":"https://api.github.com/users/peter-rustler-basyskom/gists{/gist_id}","starred_url":"https://api.github.com/users/peter-rustler-basyskom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peter-rustler-basyskom/subscriptions","organizations_url":"https://api.github.com/users/peter-rustler-basyskom/orgs","repos_url":"https://api.github.com/users/peter-rustler-basyskom/repos","events_url":"https://api.github.com/users/peter-rustler-basyskom/events{/privacy}","received_events_url":"https://api.github.com/users/peter-rustler-basyskom/received_events","type":"User","site_admin":false},"body":"filter is a value based member and can't be null. It is no pointer in the monitored item.\r\n","created_at":"2018-04-09T11:49:27Z","updated_at":"2018-04-09T11:49:27Z","html_url":"https://github.com/open62541/open62541/pull/1726#discussion_r180068498","pull_request_url":"https://api.github.com/repos/open62541/open62541/pulls/1726","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/open62541/open62541/pulls/comments/180068498"},"html":{"href":"https://github.com/open62541/open62541/pull/1726#discussion_r180068498"},"pull_request":{"href":"https://api.github.com/repos/open62541/open62541/pulls/1726"}},"in_reply_to_id":179819368},"pull_request":{"url":"https://api.github.com/repos/open62541/open62541/pulls/1726","id":179945108,"html_url":"https://github.com/open62541/open62541/pull/1726","diff_url":"https://github.com/open62541/open62541/pull/1726.diff","patch_url":"https://github.com/open62541/open62541/pull/1726.patch","issue_url":"https://api.github.com/repos/open62541/open62541/issues/1726","number":1726,"state":"open","locked":false,"title":"Add filter support for numeric absolute filters","user":{"login":"peter-rustler-basyskom","id":38132922,"avatar_url":"https://avatars3.githubusercontent.com/u/38132922?v=4","gravatar_id":"","url":"https://api.github.com/users/peter-rustler-basyskom","html_url":"https://github.com/peter-rustler-basyskom","followers_url":"https://api.github.com/users/peter-rustler-basyskom/followers","following_url":"https://api.github.com/users/peter-rustler-basyskom/following{/other_user}","gists_url":"https://api.github.com/users/peter-rustler-basyskom/gists{/gist_id}","starred_url":"https://api.github.com/users/peter-rustler-basyskom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peter-rustler-basyskom/subscriptions","organizations_url":"https://api.github.com/users/peter-rustler-basyskom/orgs","repos_url":"https://api.github.com/users/peter-rustler-basyskom/repos","events_url":"https://api.github.com/users/peter-rustler-basyskom/events{/privacy}","received_events_url":"https://api.github.com/users/peter-rustler-basyskom/received_events","type":"User","site_admin":false},"body":"The following changes are made for server support:\r\n * Creating an DEADBANDTYPE_ABSOLUTE filter for non numeric data type from client fail with BADFILTERNOTALLOWED\r\n * Creating a DEADBANDTYPE_PERCENT filter will fail with BADNOTIMPLEMENTED (impementing it is not possible as long we do not have the EURange)\r\n * Updates to clients will be filtered for DEADBANDTYPE_ABSOLUTE filters for numeric scalar and array types\r\n\r\nIf this is also code which should go into 0.3 release, I can also do a pull request for 0.3 branch. In my opinion the first 2 bullet points fixes bugs, because we do always report GOOD when applying filters by clients, but do not handle them right.","created_at":"2018-04-06T13:14:36Z","updated_at":"2018-04-09T11:49:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2d9d97d6f955fb9ec46fed1062c1816cf09e8e31","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/open62541/open62541/pulls/1726/commits","review_comments_url":"https://api.github.com/repos/open62541/open62541/pulls/1726/comments","review_comment_url":"https://api.github.com/repos/open62541/open62541/pulls/comments{/number}","comments_url":"https://api.github.com/repos/open62541/open62541/issues/1726/comments","statuses_url":"https://api.github.com/repos/open62541/open62541/statuses/ad9566c483263195c3a3706c06a3e3b8dd9c58e8","head":{"label":"peter-rustler-basyskom:feature/absolute_filter_master","ref":"feature/absolute_filter_master","sha":"ad9566c483263195c3a3706c06a3e3b8dd9c58e8","user":{"login":"peter-rustler-basyskom","id":38132922,"avatar_url":"https://avatars3.githubusercontent.com/u/38132922?v=4","gravatar_id":"","url":"https://api.github.com/users/peter-rustler-basyskom","html_url":"https://github.com/peter-rustler-basyskom","followers_url":"https://api.github.com/users/peter-rustler-basyskom/followers","following_url":"https://api.github.com/users/peter-rustler-basyskom/following{/other_user}","gists_url":"https://api.github.com/users/peter-rustler-basyskom/gists{/gist_id}","starred_url":"https://api.github.com/users/peter-rustler-basyskom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peter-rustler-basyskom/subscriptions","organizations_url":"https://api.github.com/users/peter-rustler-basyskom/orgs","repos_url":"https://api.github.com/users/peter-rustler-basyskom/repos","events_url":"https://api.github.com/users/peter-rustler-basyskom/events{/privacy}","received_events_url":"https://api.github.com/users/peter-rustler-basyskom/received_events","type":"User","site_admin":false},"repo":{"id":128393004,"name":"open62541","full_name":"peter-rustler-basyskom/open62541","owner":{"login":"peter-rustler-basyskom","id":38132922,"avatar_url":"https://avatars3.githubusercontent.com/u/38132922?v=4","gravatar_id":"","url":"https://api.github.com/users/peter-rustler-basyskom","html_url":"https://github.com/peter-rustler-basyskom","followers_url":"https://api.github.com/users/peter-rustler-basyskom/followers","following_url":"https://api.github.com/users/peter-rustler-basyskom/following{/other_user}","gists_url":"https://api.github.com/users/peter-rustler-basyskom/gists{/gist_id}","starred_url":"https://api.github.com/users/peter-rustler-basyskom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peter-rustler-basyskom/subscriptions","organizations_url":"https://api.github.com/users/peter-rustler-basyskom/orgs","repos_url":"https://api.github.com/users/peter-rustler-basyskom/repos","events_url":"https://api.github.com/users/peter-rustler-basyskom/events{/privacy}","received_events_url":"https://api.github.com/users/peter-rustler-basyskom/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/peter-rustler-basyskom/open62541","description":"Open source implementation of OPC UA (OPC Unified Architecture) aka IEC 62541 licensed under Mozilla Public License v2.0","fork":true,"url":"https://api.github.com/repos/peter-rustler-basyskom/open62541","forks_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/forks","keys_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/keys{/key_id}","collaborators_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/teams","hooks_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/hooks","issue_events_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/issues/events{/number}","events_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/events","assignees_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/assignees{/user}","branches_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/branches{/branch}","tags_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/tags","blobs_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/git/refs{/sha}","trees_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/git/trees{/sha}","statuses_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/statuses/{sha}","languages_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/languages","stargazers_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/stargazers","contributors_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/contributors","subscribers_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/subscribers","subscription_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/subscription","commits_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/commits{/sha}","git_commits_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/git/commits{/sha}","comments_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/comments{/number}","issue_comment_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/issues/comments{/number}","contents_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/contents/{+path}","compare_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/compare/{base}...{head}","merges_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/merges","archive_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/downloads","issues_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/issues{/number}","pulls_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/pulls{/number}","milestones_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/milestones{/number}","notifications_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/labels{/name}","releases_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/releases{/id}","deployments_url":"https://api.github.com/repos/peter-rustler-basyskom/open62541/deployments","created_at":"2018-04-06T12:39:12Z","updated_at":"2018-04-06T12:39:15Z","pushed_at":"2018-04-09T11:30:37Z","git_url":"git://github.com/peter-rustler-basyskom/open62541.git","ssh_url":"git@github.com:peter-rustler-basyskom/open62541.git","clone_url":"https://github.com/peter-rustler-basyskom/open62541.git","svn_url":"https://github.com/peter-rustler-basyskom/open62541","homepage":"http://open62541.org","size":15505,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"open62541:master","ref":"master","sha":"f144f0eabc3a2bf53fa4cd11fc55d3f69ef868ec","user":{"login":"open62541","id":16096536,"avatar_url":"https://avatars1.githubusercontent.com/u/16096536?v=4","gravatar_id":"","url":"https://api.github.com/users/open62541","html_url":"https://github.com/open62541","followers_url":"https://api.github.com/users/open62541/followers","following_url":"https://api.github.com/users/open62541/following{/other_user}","gists_url":"https://api.github.com/users/open62541/gists{/gist_id}","starred_url":"https://api.github.com/users/open62541/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open62541/subscriptions","organizations_url":"https://api.github.com/users/open62541/orgs","repos_url":"https://api.github.com/users/open62541/repos","events_url":"https://api.github.com/users/open62541/events{/privacy}","received_events_url":"https://api.github.com/users/open62541/received_events","type":"Organization","site_admin":false},"repo":{"id":15333809,"name":"open62541","full_name":"open62541/open62541","owner":{"login":"open62541","id":16096536,"avatar_url":"https://avatars1.githubusercontent.com/u/16096536?v=4","gravatar_id":"","url":"https://api.github.com/users/open62541","html_url":"https://github.com/open62541","followers_url":"https://api.github.com/users/open62541/followers","following_url":"https://api.github.com/users/open62541/following{/other_user}","gists_url":"https://api.github.com/users/open62541/gists{/gist_id}","starred_url":"https://api.github.com/users/open62541/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open62541/subscriptions","organizations_url":"https://api.github.com/users/open62541/orgs","repos_url":"https://api.github.com/users/open62541/repos","events_url":"https://api.github.com/users/open62541/events{/privacy}","received_events_url":"https://api.github.com/users/open62541/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/open62541/open62541","description":"Open source implementation of OPC UA (OPC Unified Architecture) aka IEC 62541 licensed under Mozilla Public License v2.0","fork":false,"url":"https://api.github.com/repos/open62541/open62541","forks_url":"https://api.github.com/repos/open62541/open62541/forks","keys_url":"https://api.github.com/repos/open62541/open62541/keys{/key_id}","collaborators_url":"https://api.github.com/repos/open62541/open62541/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/open62541/open62541/teams","hooks_url":"https://api.github.com/repos/open62541/open62541/hooks","issue_events_url":"https://api.github.com/repos/open62541/open62541/issues/events{/number}","events_url":"https://api.github.com/repos/open62541/open62541/events","assignees_url":"https://api.github.com/repos/open62541/open62541/assignees{/user}","branches_url":"https://api.github.com/repos/open62541/open62541/branches{/branch}","tags_url":"https://api.github.com/repos/open62541/open62541/tags","blobs_url":"https://api.github.com/repos/open62541/open62541/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/open62541/open62541/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/open62541/open62541/git/refs{/sha}","trees_url":"https://api.github.com/repos/open62541/open62541/git/trees{/sha}","statuses_url":"https://api.github.com/repos/open62541/open62541/statuses/{sha}","languages_url":"https://api.github.com/repos/open62541/open62541/languages","stargazers_url":"https://api.github.com/repos/open62541/open62541/stargazers","contributors_url":"https://api.github.com/repos/open62541/open62541/contributors","subscribers_url":"https://api.github.com/repos/open62541/open62541/subscribers","subscription_url":"https://api.github.com/repos/open62541/open62541/subscription","commits_url":"https://api.github.com/repos/open62541/open62541/commits{/sha}","git_commits_url":"https://api.github.com/repos/open62541/open62541/git/commits{/sha}","comments_url":"https://api.github.com/repos/open62541/open62541/comments{/number}","issue_comment_url":"https://api.github.com/repos/open62541/open62541/issues/comments{/number}","contents_url":"https://api.github.com/repos/open62541/open62541/contents/{+path}","compare_url":"https://api.github.com/repos/open62541/open62541/compare/{base}...{head}","merges_url":"https://api.github.com/repos/open62541/open62541/merges","archive_url":"https://api.github.com/repos/open62541/open62541/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/open62541/open62541/downloads","issues_url":"https://api.github.com/repos/open62541/open62541/issues{/number}","pulls_url":"https://api.github.com/repos/open62541/open62541/pulls{/number}","milestones_url":"https://api.github.com/repos/open62541/open62541/milestones{/number}","notifications_url":"https://api.github.com/repos/open62541/open62541/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/open62541/open62541/labels{/name}","releases_url":"https://api.github.com/repos/open62541/open62541/releases{/id}","deployments_url":"https://api.github.com/repos/open62541/open62541/deployments","created_at":"2013-12-20T08:45:05Z","updated_at":"2018-04-09T07:26:34Z","pushed_at":"2018-04-09T11:30:39Z","git_url":"git://github.com/open62541/open62541.git","ssh_url":"git@github.com:open62541/open62541.git","clone_url":"https://github.com/open62541/open62541.git","svn_url":"https://github.com/open62541/open62541","homepage":"http://open62541.org","size":15557,"stargazers_count":406,"watchers_count":406,"language":"C","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":227,"mirror_url":null,"archived":false,"open_issues_count":78,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":227,"open_issues":78,"watchers":406,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/open62541/open62541/pulls/1726"},"html":{"href":"https://github.com/open62541/open62541/pull/1726"},"issue":{"href":"https://api.github.com/repos/open62541/open62541/issues/1726"},"comments":{"href":"https://api.github.com/repos/open62541/open62541/issues/1726/comments"},"review_comments":{"href":"https://api.github.com/repos/open62541/open62541/pulls/1726/comments"},"review_comment":{"href":"https://api.github.com/repos/open62541/open62541/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/open62541/open62541/pulls/1726/commits"},"statuses":{"href":"https://api.github.com/repos/open62541/open62541/statuses/ad9566c483263195c3a3706c06a3e3b8dd9c58e8"}},"author_association":"NONE"}}
{"actor":{"display_login":"peter-rustler-basyskom"}}