Skip to content

usb_cdc.serial.read() doc says it reads one byte, but it will read as much as possible #9365

Closed
@dhalbert

Description

@dhalbert

Right now the documentation for usb_cdc.serial.read() gives the signature as usb_cdc.serial.read(size = 1). That is, it reads a at most a single byte. This does not match the implementation: it actually tries to read as much as possible, because it uses the standard stream operation read(), which has those semantics.

Pyserial's read() has the same signature and does read only one byte if no argument is given. I think our original intention was to match pyserial.

So rather than change the documentation, we should probably fix the implementation.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions