Update qng_wrapper_linux.py

Fixed missing arg for reset and *char to python str conversion
This commit is contained in:
Newton Winter 2020-12-21 14:07:51 +03:00 committed by GitHub
parent ddc0e67712
commit 7cdd5990c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,7 +19,7 @@
# SOFTWARE.
import platform
from ctypes import cdll, c_void_p, c_int, c_double, POINTER, c_char
from ctypes import cdll, c_void_p, c_int, c_double, POINTER, c_char, c_char_p, cast
class QngWrapperLinux:
@ -43,10 +43,10 @@ class QngWrapperLinux:
def deviceId(self):
try:
return self._qwqng_wrapper.DeviceID(self._qng_pointer)
return cast(self._qwqng_wrapper.DeviceID(self._qng_pointer), c_char_p).value.decode("utf-8")
except:
self._qwqng_wrapper.Reset()
return self._qwqng_wrapper.DeviceID(self._qng_pointer)
self._qwqng_wrapper.Reset(self._qng_pointer)
return cast(self._qwqng_wrapper.DeviceID(self._qng_pointer), c_char_p).value.decode("utf-8")
def randint32(self):
try: