Comments (6)
Does bytes_to_read
indicate that there are 52 bytes available when you read?
Do you always get the same number of bytes from the first read request, or does it vary?
I'm wondering if the OS driver is doing some sort of buffering here...
from serialport-rs.
I haven't check the bytes_to_read function I can do that. But the amount of bytes to read is is variable based on the type of message that is being sent. All other messages are requests and don't have a data payload so each other message is the same size about 14 bytes in size.
from serialport-rs.
I will also say that I checked against my rust application by creating a quick python script using pyserial and was able to read all the data in one read.
from serialport-rs.
Raspberry PI Uart is 16 bytes. PySerial probably caches internally to another buffer transparently to read by other processes.
You're gonna need to read in a loop until there are no more bytes to read, stuffing them into a bigger buffer
from serialport-rs.
Here, it reads into a buffer in a loop, only returning when the buffer is full, or timeout.
You will need to imple the same logic as serialport-rs is pretty low level.
from serialport-rs.
This seems like a bug not a feature.. I'd expect a serial interface reader to read until the buffer is full or the transmission has timed-out if I can configure buffer size and timeout duration..
Is there a use-case where this is desired behaviour?
from serialport-rs.
Related Issues (20)
- Missing serial_number HOT 4
- Encountered a problem during the process of making this library into a Flutter plugin HOT 8
- Bootstrap (or resurrect) a cross-platform port-to-port serial transmit/receive test application HOT 4
- UsbPorts are detected as PciPorts on Raspberry Pi 4b HOT 9
- Dependency on unmaintained crates HOT 12
- Publish 4.2.2 version on crates.io HOT 2
- Type of a serialport HOT 2
- Last port.write does not send all bytes on FTDI dongle HOT 7
- Read always timeout in arm-unknown-linux-musleabihf HOT 5
- Serial write stalls application on some Windows machines HOT 7
- Windows USB001 possible? HOT 2
- Wrong informations with Com port HOT 2
- FlowControl::Hardware not set on Siliconlabs Ember dongle on Linux HOT 9
- Linux: `serialport::available_ports()` returns generic USB strings instead of actual descriptor values HOT 3
- Add supported architecture HOT 2
- After dropping lock serialport is still locked HOT 5
- New release? HOT 8
- Hardware flow control permanently asserts RTS HOT 2
- how to open a COM port with serialport::new in Windows HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serialport-rs.