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
fdb6e15d
Commit
fdb6e15d
authored
Mar 10, 2015
by
Alexander Korolkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get first elements of tuples returned by struct.unpack()
parent
94d2a77b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
opcua/uatypes.py
opcua/uatypes.py
+4
-4
No files found.
opcua/uatypes.py
View file @
fdb6e15d
...
@@ -290,13 +290,13 @@ class NodeId(object):
...
@@ -290,13 +290,13 @@ class NodeId(object):
elif
nid
.
NodeIdType
==
NodeIdType
.
Numeric
:
elif
nid
.
NodeIdType
==
NodeIdType
.
Numeric
:
nid
.
NamespaceIndex
,
nid
.
Identifier
=
struct
.
unpack
(
"<HI"
,
data
.
read
(
6
))
nid
.
NamespaceIndex
,
nid
.
Identifier
=
struct
.
unpack
(
"<HI"
,
data
.
read
(
6
))
elif
nid
.
NodeIdType
==
NodeIdType
.
String
:
elif
nid
.
NodeIdType
==
NodeIdType
.
String
:
nid
.
NamespaceIndex
=
struct
.
unpack
(
"<H"
,
data
.
read
(
2
))
nid
.
NamespaceIndex
=
struct
.
unpack
(
"<H"
,
data
.
read
(
2
))
[
0
]
nid
.
Identifier
=
unpack_string
(
data
)
nid
.
Identifier
=
unpack_string
(
data
)
elif
nid
.
NodeIdType
==
NodeIdType
.
ByteString
:
elif
nid
.
NodeIdType
==
NodeIdType
.
ByteString
:
nid
.
NamespaceIndex
=
struct
.
unpack
(
"<H"
,
data
.
read
(
2
))
nid
.
NamespaceIndex
=
struct
.
unpack
(
"<H"
,
data
.
read
(
2
))
[
0
]
nid
.
Identifier
=
unpack_bytes
(
data
)
nid
.
Identifier
=
unpack_bytes
(
data
)
elif
nid
.
NodeIdType
==
NodeIdType
.
Guid
:
elif
nid
.
NodeIdType
==
NodeIdType
.
Guid
:
nid
.
NamespaceIndex
=
struct
.
unpack
(
"<H"
,
data
.
read
(
2
))
nid
.
NamespaceIndex
=
struct
.
unpack
(
"<H"
,
data
.
read
(
2
))
[
0
]
nid
.
Identifier
=
Guid
.
from_binary
(
data
)
nid
.
Identifier
=
Guid
.
from_binary
(
data
)
else
:
else
:
raise
Exception
(
"Unknown NodeId encoding: "
+
str
(
nid
.
NodeIdType
))
raise
Exception
(
"Unknown NodeId encoding: "
+
str
(
nid
.
NodeIdType
))
...
@@ -482,7 +482,7 @@ class Variant(object):
...
@@ -482,7 +482,7 @@ class Variant(object):
if
vtype
.
name
in
UaTypes
:
if
vtype
.
name
in
UaTypes
:
return
unpack_uatype_array
(
vtype
.
name
,
data
)
return
unpack_uatype_array
(
vtype
.
name
,
data
)
else
:
else
:
length
=
struct
.
unpack
(
"<i"
,
data
.
read
(
4
))
length
=
struct
.
unpack
(
"<i"
,
data
.
read
(
4
))
[
0
]
res
=
[]
res
=
[]
for
_
in
range
(
0
,
length
):
for
_
in
range
(
0
,
length
):
res
.
append
(
Variant
.
_unpack_val
(
vtype
,
data
))
res
.
append
(
Variant
.
_unpack_val
(
vtype
,
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