@@ -46,10 +46,14 @@ class PPK2_Modes():
46
46
47
47
48
48
class PPK2_API ():
49
- def __init__ (self , port , read_timeout = 1 , write_timeout = 1 ):
49
+ def __init__ (self , port : str , ** kwargs ):
50
+ '''
51
+ port - port where PPK2 is connected
52
+ **kwargs - keyword arguments to pass to the pySerial constructor
53
+ '''
50
54
51
55
self .ser = None
52
- self .ser = serial .Serial (port , exclusive = True , timeout = read_timeout , write_timeout = write_timeout )
56
+ self .ser = serial .Serial (port , ** kwargs )
53
57
self .ser .baudrate = 9600
54
58
55
59
self .modifiers = {
@@ -435,13 +439,14 @@ class PPK2_MP(PPK2_API):
435
439
Multiprocessing variant of the object. The interface is the same as for the regular one except it spawns
436
440
a background process on start_measuring()
437
441
'''
438
- def __init__ (self , port , buffer_max_size_seconds = 10 , buffer_chunk_seconds = 0.1 ):
442
+ def __init__ (self , port , buffer_max_size_seconds = 10 , buffer_chunk_seconds = 0.1 , ** kwargs ):
439
443
'''
440
444
port - port where PPK2 is connected
441
445
buffer_max_size_seconds - how many seconds of data to keep in the buffer
442
446
buffer_chunk_seconds - how many seconds of data to put in the queue at once
447
+ **kwargs - keyword arguments to pass to the pySerial constructor
443
448
'''
444
- super ().__init__ (port )
449
+ super ().__init__ (port , ** kwargs )
445
450
446
451
self ._fetcher = None
447
452
self ._quit_evt = threading .Event ()
0 commit comments