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
874ce02d
Commit
874ce02d
authored
Dec 06, 2017
by
Mathias Lüdtke
Committed by
oroulet
Dec 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pack or unpack using Primitives if possible
parent
6dec8eaa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
opcua/ua/ua_binary.py
opcua/ua/ua_binary.py
+4
-0
No files found.
opcua/ua/ua_binary.py
View file @
874ce02d
...
...
@@ -269,6 +269,8 @@ def to_binary(uatype, val):
elif
isinstance
(
uatype
,
(
str
,
unicode
))
and
hasattr
(
ua
.
VariantType
,
uatype
):
vtype
=
getattr
(
ua
.
VariantType
,
uatype
)
return
pack_uatype
(
vtype
,
val
)
elif
isinstance
(
uatype
,
(
str
,
unicode
))
and
hasattr
(
Primitives
,
uatype
):
return
getattr
(
Primitives
,
uatype
).
pack
(
val
)
elif
isinstance
(
val
,
(
IntEnum
,
Enum
)):
return
Primitives
.
UInt32
.
pack
(
val
.
value
)
elif
isinstance
(
val
,
ua
.
NodeId
):
...
...
@@ -475,6 +477,8 @@ def from_binary(uatype, data):
elif
isinstance
(
uatype
,
(
str
,
unicode
))
and
hasattr
(
ua
.
VariantType
,
uatype
):
vtype
=
getattr
(
ua
.
VariantType
,
uatype
)
return
unpack_uatype
(
vtype
,
data
)
elif
isinstance
(
uatype
,
(
str
,
unicode
))
and
hasattr
(
Primitives
,
uatype
):
return
getattr
(
Primitives
,
uatype
).
unpack
(
data
)
else
:
return
struct_from_binary
(
uatype
,
data
)
...
...
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