Skip to content

Commit

Permalink
Add caveat for usb_cdc.Serial.connected
Browse files Browse the repository at this point in the history
  • Loading branch information
dhalbert committed Mar 7, 2021
1 parent 103632f commit 8594396
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions shared-bindings/usb_cdc/Serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
//| ...
//|

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 8594396

Please sign in to comment.