@@ -28,8 +28,6 @@ class TeensyToAny:
2828 (0x16C0 , 0x0483 ),
2929 ]
3030
31- _device_name = "TeensyToAny"
32-
3331 @staticmethod
3432 def find (serial_numbers = None ):
3533 """Find all the serial ports that are associated with debuggers.
@@ -161,7 +159,7 @@ def device_serial_number_pairs(
161159 manufacturer = "TeensyToAny" ,
162160 ):
163161 if device_name is None :
164- device_name = TeensyToAny . _device_name
162+ device_name = " TeensyToAny"
165163 com = comports ()
166164 pairs = [
167165 (c .device , c .serial_number )
@@ -348,6 +346,7 @@ def __init__(
348346 baudrate = 115200 ,
349347 timeout = 0.205 ,
350348 open = True , # pylint: disable=redefined-builtin
349+ device_name = 'TeensyToAny' ,
351350 ):
352351 """A class to control the TeensyToAny Debugger.
353352
@@ -356,11 +355,22 @@ def __init__(
356355 serial_number: optional
357356 If provided, will attempt to open the specified serial number
358357
358+ baudrate: int
359+ Baudrate to use for the serial connection.
360+
359361 timeout: float
360362 Timeout before reading a command fails. A default value of 0.205
361363 was chosen so that the Serial connection adequately waits for
362364 hardware timeouts that may be as long as 0.200 seconds.
363365
366+ open: bool
367+ If True, will automatically open the device upon initialization.
368+ If False, the device must be opened manually using the `open` method.
369+
370+ device_name: str
371+ The name of the device returned during certain error messages.
372+
373+ .. versionadded:: 0.11.1
364374 """
365375
366376 self ._requested_serial_number = serial_number
@@ -369,6 +379,7 @@ def __init__(
369379 self ._serial = None
370380 self .serial_number = None
371381 self ._version = None
382+ self ._device_name = device_name
372383 if open :
373384 self .open ()
374385
0 commit comments