From 7cdd5990c676438e872992190ac9457487b5f729 Mon Sep 17 00:00:00 2001 From: Newton Winter <76408211+winternewt@users.noreply.github.com> Date: Mon, 21 Dec 2020 14:07:51 +0300 Subject: [PATCH] Update qng_wrapper_linux.py Fixed missing arg for reset and *char to python str conversion --- quanttp/data/qng_wrapper_linux.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/quanttp/data/qng_wrapper_linux.py b/quanttp/data/qng_wrapper_linux.py index f1e8260..a31376c 100644 --- a/quanttp/data/qng_wrapper_linux.py +++ b/quanttp/data/qng_wrapper_linux.py @@ -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: