Commit b449c81c authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Apply the fix for swig proxy classes everywhere

parent e7486812
......@@ -218,8 +218,6 @@ class sdlHandler(QObject):
asn1_instance = getattr(ASN1, typename)()
setter = getattr(ASN1.DV, "SetDataFor_{}".format(typename))
setter(asn1_instance._ptr, swig_ptr)
#if not getattr(asn1_instance._ptr, '__long__', None):
# print dir(asn1_instance[0].__long__._ptr)
gser = asn1_instance.GSER()
as_pyside = vn.fromValueNotationToPySide(var, gser)
self.asn1_editor.updateVariable(as_pyside,
......@@ -284,8 +282,12 @@ class sdlHandler(QObject):
self.msc.emit('out', msg)
if param:
# Cast the SWIG type (ASN.1 Native format) to a ctypes pointer
param_ptr = ctypes.cast(param._ptr.__long__(),
ctypes.POINTER(ctypes.c_uint16))
try:
swig_ptr = int(param._ptr)
except TypeError:
# when swig uses a proxy class, pointer is in _ptr.this
swig_ptr = int(param._ptr.this)
param_ptr = ctypes.cast(swig_ptr, ctypes.POINTER(ctypes.c_uint32))
tc_func_ptr(param_ptr)
else:
tc_func_ptr()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment