Skip to content

Commit c7d0a04

Browse files
authored
Merge pull request #160 from JohnDMcMaster/ps6000EnumerateUnits_NULL
ps6000EnumerateUnits: NULL workaround
2 parents 87a247e + af08965 commit c7d0a04

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

picoscope/ps6000.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
# float is always defined as 32 bits
6060
# double is defined as 64 bits
6161
from ctypes import byref, POINTER, create_string_buffer, c_float, \
62-
c_int16, c_int32, c_uint32, c_uint64, c_void_p
62+
c_int8, c_int16, c_int32, c_uint32, c_uint64, c_void_p
6363
from ctypes import c_int32 as c_enum
6464

6565
from picoscope.picobase import _PicoscopeBase
@@ -198,7 +198,10 @@ def _lowLevelCloseUnit(self):
198198

199199
def _lowLevelEnumerateUnits(self):
200200
count = c_int16(0)
201-
m = self.lib.ps6000EnumerateUnits(byref(count), None, None)
201+
serials = c_int8(0)
202+
serialLth = c_int16(0)
203+
m = self.lib.ps6000EnumerateUnits(byref(count), byref(serials),
204+
byref(serialLth))
202205
self.checkResult(m)
203206
# a serial number is rouhgly 8 characters
204207
# an extra character for the comma

0 commit comments

Comments
 (0)