Skip to content

Commit 8594396

Browse files
committed
Add caveat for usb_cdc.Serial.connected
1 parent 103632f commit 8594396

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

shared-bindings/usb_cdc/Serial.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
//| """You cannot create an instance of `usb_cdc.Serial`.
4343
//|
4444
//| Serial objects are pre-constructed for each CDC device in the USB
45-
//| descriptor and added to the ``usb_cdc.ports`` tuple."""
45+
//| descriptor and are included in the ``usb_cdc.serials`` tuple."""
4646
//| ...
4747
//|
4848

@@ -124,7 +124,12 @@ STATIC mp_uint_t usb_cdc_serial_ioctl_stream(mp_obj_t self_in, mp_uint_t request
124124
}
125125

126126
//| connected: bool
127-
//| """True if this Serial is connected to a host. (read-only)"""
127+
//| """True if this Serial is connected to a host. (read-only)
128+
//|
129+
//| .. note:: The host is considered to be connected if it is asserting DTR (Data Terminal Ready).
130+
//| Most terminal programs and ``pyserial`` assert DTR when opening a serial connection.
131+
//| However, the C# ``SerialPort`` API does not. You must set ``SerialPort.DtrEnable``.
132+
//| """
128133
//|
129134
STATIC mp_obj_t usb_cdc_serial_get_connected(mp_obj_t self_in) {
130135
usb_cdc_serial_obj_t *self = MP_OBJ_TO_PTR(self_in);

0 commit comments

Comments
 (0)