WICG / webusb

Connecting hardware to the web.
https://wicg.github.io/webusb/
Other
1.31k stars 131 forks source link

SerialPort.open() bufferSize option specifies the upper limit of the transfer size? #222

Closed qcscofield closed 2 years ago

qcscofield commented 2 years ago

For example: device.open({baudRate: 115200, flowControl: "hardware", bufferSize: 8192}); If I set the bufferSize is 8192 byte. I want to transfer 1MB data. What should I do ? Only run close and open function repeatedly ?

reillyeon commented 2 years ago

This seems like a duplicate of https://github.com/WICG/serial/issues/166. This question relates to the Web Serial API but this repository is for the WebUSB API. The bufferSize parameter` controls the size of the buffer used for passing data between JavaScript and the operating system. You can write a chunk that is larger than the buffer. It will just be split into pieces.