From 8594396a07e3841803f1f3e0ffad39c6e94f55dc Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sun, 7 Mar 2021 13:49:41 -0500 Subject: Add caveat for usb_cdc.Serial.connected --- shared-bindings/usb_cdc/Serial.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/shared-bindings/usb_cdc/Serial.c b/shared-bindings/usb_cdc/Serial.c index c813dce5b..4913ac85a 100644 --- a/shared-bindings/usb_cdc/Serial.c +++ b/shared-bindings/usb_cdc/Serial.c @@ -42,7 +42,7 @@ //| """You cannot create an instance of `usb_cdc.Serial`. //| //| Serial objects are pre-constructed for each CDC device in the USB -//| descriptor and added to the ``usb_cdc.ports`` tuple.""" +//| descriptor and are included in the ``usb_cdc.serials`` tuple.""" //| ... //| @@ -124,7 +124,12 @@ STATIC mp_uint_t usb_cdc_serial_ioctl_stream(mp_obj_t self_in, mp_uint_t request } //| connected: bool -//| """True if this Serial is connected to a host. (read-only)""" +//| """True if this Serial is connected to a host. (read-only) +//| +//| .. note:: The host is considered to be connected if it is asserting DTR (Data Terminal Ready). +//| Most terminal programs and ``pyserial`` assert DTR when opening a serial connection. +//| However, the C# ``SerialPort`` API does not. You must set ``SerialPort.DtrEnable``. +//| """ //| STATIC mp_obj_t usb_cdc_serial_get_connected(mp_obj_t self_in) { usb_cdc_serial_obj_t *self = MP_OBJ_TO_PTR(self_in); -- cgit v1.2.3