Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
asn1-value-editor
Commits
d3a0f87e
Commit
d3a0f87e
authored
Jul 08, 2015
by
Maxime Perrotin
Browse files
Handle in and out parameters for procedure calls
parent
8b530c3b
Changes
2
Hide whitespace changes
Inline
Side-by-side
asn1_value_editor/asn1_value_editor.py
View file @
d3a0f87e
...
...
@@ -16,7 +16,7 @@
__author__
=
"Maxime Perrotin"
__license__
=
"LGPLv3"
__version__
=
"1.0.
2
"
__version__
=
"1.0.
3
"
__url__
=
"http://taste.tuxfamily.org"
import
sys
...
...
asn1_value_editor/sdlHandler.py
View file @
d3a0f87e
...
...
@@ -632,11 +632,29 @@ class sdlHandler(QObject):
as_bytes
.
contents
[
idx
])
setter
=
getattr
(
ASN1
.
DV
,
"SetDataFor_{}"
.
format
(
typename
))
setter
(
asn1_instance
.
_ptr
,
swig_ptr
)
gser
=
asn1_instance
.
GSER
()
print
'Input param:'
,
gser
interface
[
'in'
].
append
((
spec
,
asn1_instance
))
else
:
interface
[
'out'
].
append
((
spec
,
as_bytes
,
asn1_instance
))
# HERE: make the function call
#spec_in, asn1_inst_in = interface['in'][0]
#spec_out, as_bytes, asn1_inst_out = interface['out'][0]
#asn1_inst_out.Set(asn1_inst_in.Get() + 1)
# Copy the OUT parameters back from SWIG to ctypes
for
spec
,
as_bytes
,
asn1_instance
in
interface
[
'out'
]:
# Create new SWIG byte array
swig_ptr
=
ASN1
.
DV
.
new_byte_SWIG_PTR
(
len
(
as_bytes
.
contents
))
typename
=
spec
[
'type'
].
ReferencedTypeName
.
replace
(
'-'
,
'_'
)
setter
=
getattr
(
ASN1
.
DV
,
"SetDataFor_{}"
.
format
(
typename
))
setter
(
swig_ptr
,
asn1_instance
.
_ptr
)
for
idx
in
xrange
(
len
(
as_bytes
.
contents
)):
as_bytes
.
contents
[
idx
]
=
\
ASN1
.
DV
.
byte_SWIG_PTR_getitem
(
swig_ptr
,
idx
)
# At the end, delete allocated buffers
for
_
,
asn1_instance
in
interface
[
'in'
]:
del
(
asn1_instance
)
for
_
,
_
,
asn1_instance
in
interface
[
'out'
]:
del
(
asn1_instance
)
def
set_timer
(
self
,
name
,
duration
):
''' Callback function when the SDL model sets a timer '''
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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