Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
opcua-asyncio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nikola Balog
opcua-asyncio
Commits
cb397301
Commit
cb397301
authored
Dec 22, 2019
by
oroulet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support opc publisher calls from @asinitson
parent
5d9e874c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
2 deletions
+30
-2
asyncua/server/uaprocessor.py
asyncua/server/uaprocessor.py
+30
-2
No files found.
asyncua/server/uaprocessor.py
View file @
cb397301
...
...
@@ -64,7 +64,7 @@ class UaProcessor:
"""
#_logger.info("forward publish response %s", result)
while
True
:
if
not
len
(
self
.
_publish_requests
)
:
if
not
self
.
_publish_requests
:
self
.
_publish_results
.
append
(
result
)
_logger
.
info
(
"Server wants to send publish answer but no publish request is available,"
...
...
@@ -367,7 +367,7 @@ class UaProcessor:
# Store the Publish Request (will be used to send publish answers from server)
self
.
_publish_requests
.
append
(
data
)
# If there is an enqueued result forward it immediately
while
len
(
self
.
_publish_results
)
:
while
self
.
_publish_results
:
result
=
self
.
_publish_results
.
popleft
()
if
result
.
SubscriptionId
not
in
self
.
session
.
subscription_service
.
active_subscription_ids
:
# Discard the result if the subscription is no longer active
...
...
@@ -400,6 +400,34 @@ class UaProcessor:
response
.
Results
=
results
self
.
send_response
(
requesthdr
.
RequestHandle
,
seqhdr
,
response
)
elif
typeid
==
ua
.
NodeId
(
ua
.
ObjectIds
.
SetMonitoringModeRequest_Encoding_DefaultBinary
):
_logger
.
info
(
"set monitoring mode request"
)
params
=
struct_from_binary
(
ua
.
SetMonitoringModeParameters
,
body
)
# FIXME: Implement SetMonitoringMode
# For now send dummy results to keep clients happy
response
=
ua
.
SetMonitoringModeResponse
()
results
=
ua
.
SetMonitoringModeResult
()
ids
=
params
.
MonitoredItemIds
statuses
=
[
ua
.
StatusCode
(
ua
.
StatusCodes
.
Good
)
for
node_id
in
ids
]
results
.
Results
=
statuses
response
.
Parameters
=
results
_logger
.
info
(
"sending set monitoring mode response"
)
self
.
send_response
(
requesthdr
.
RequestHandle
,
seqhdr
,
response
)
elif
typeid
==
ua
.
NodeId
(
ua
.
ObjectIds
.
SetPublishingModeRequest_Encoding_DefaultBinary
):
_logger
.
info
(
"set publishing mode request"
)
params
=
struct_from_binary
(
ua
.
SetPublishingModeParameters
,
body
)
# FIXME: Implement SetPublishingMode
# For now send dummy results to keep clients happy
response
=
ua
.
SetPublishingModeResponse
()
results
=
ua
.
SetPublishingModeResult
()
ids
=
params
.
SubscriptionIds
statuses
=
[
ua
.
StatusCode
(
ua
.
StatusCodes
.
Good
)
for
node_id
in
ids
]
results
.
Results
=
statuses
response
.
Parameters
=
results
_logger
.
info
(
"sending set publishing mode response"
)
self
.
send_response
(
requesthdr
.
RequestHandle
,
seqhdr
,
response
)
else
:
_logger
.
warning
(
"Unknown message received %s"
,
typeid
)
raise
ServiceError
(
ua
.
StatusCodes
.
BadServiceUnsupported
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment