Comments (4)
I worked on examples/hardware_check.rs
a while ago but stalled due to lack of time.
from serialport-rs.
Sirhcel,
Based on your feedback, I understand that the immediate plan for crate 'serialport-rs' is to cleanup existing examples and library logic so they function robustly, but without significantly modifying existing example functionality.
I'll proceed to generate a new test example application (named 'bulk_xfr.rs') which transmits a specified quantity of sequenced serial data, and where the receiver verifies all transmitted data in-fact is received correctly. The 'bulk_xfr' example test will require running two instances, with command line arguments that indicate if the instance is the transmitter (XMT) or the receiver (RCV).
When each instance is launched and before their full transfer begins, the XMT and RCV instances shall perform an initial pre-defined bi-directional handshake sequence (protocol) in which the RCV and XMT instances confirm they are ready to proceed with the initial test buffer transfer. The startup handshake sequence permits the XMT and RCV example instances to be launched in either order, with some reasonable time-period in seconds permitted after the first instance launches until the second instance launches. If this initial startup handshake is unsuccessful for any reason, then the instances report an informative error message and exit.
The core bulk transfer data pattern will be an auto-generated byte stream consisting of an ascending binary byte-sequence repeated cycling between 0 and 255 which satisfies the user designated transfer length. The receiver is provided the designated transfer length and repeat count values by the transmitter instance during the launch-time initial handshake sequence. Details of this handshake shall be documented in the example source code.
Both port flow control settings will default to 'None'.
Both port read timeout's will be set as 'TBD'.
There will be command line arguments which specify:
- The transfer port name (for example --PORT="/dev/ttyUSB1"),
- The current role, either (--role="XMT") or (--role="RCV"),
- The number of sequenced value bytes for the transmit (for example --XFRLEN="50_000"),
- The baud rate (for example --BAUD="250_000").
- An optional repeat receive count value (for example --REPEAT="10"). Default repeat value will be 1.
This test example may involve two 'bulk_xfr' instances (and serial ports) executing on the same (platform) computer system, or otherwise a pair of instances each executing on distinct computer systems with either the same or different OSes.
Once I code and verify the new example with a connected Windows and Linux test system, we can then request someone with a Mac verify it as well.
Additional functionality, such as timeout testing and flow-control. could be added to this or another new example once the core ''bulk_xfr.rs' example is working as described above.
Does this sound reasonable - your thoughts?
from serialport-rs.
Further reading: We had some serious amount of discussion in #107
from serialport-rs.
I've generated and tested a serialport crate stand-alone test and characterization application, named 'receive_timing_info', which characterizes the write() and read() trait methods timing under various operating conditions. I've built and tested it on both Windows 10 and Ubuntu 22.04 LTS, using two FTDI USB serial port cables. The test currently accepts ten (10) command line arguments which allows multiple testing scenarios. I've written a corresponding support document "SerialPort_rs Receive_Timing_Info Test Description.pdf" which details this. I've also generated and tested, the test application's source file, named 'receive_timing_info.rs'. The document describes building the test application from the serialport-rs crate's examples folder with cargo build. This test application saves all of its run-time metrics data in a log-file, since there is impractical to display it all on the console (and this would significantly slow down the run-time execution. Finally, since developing this test I've used it to characterize the Windows write() and read() behavior, especially its blocking and time-out characteristics, and have identified some clear differences between the Windows and Linux crate behavior, which is described in the document. I've also generated and tested a simple patch to the crates' Windows version of 'set_timeout()' which eliminates a fairly important problem with the current windows timeout logic. I would like to cover this (in summary) at the planned August 17 crate planning meeting.
from serialport-rs.
Related Issues (20)
- Auto reconnect HOT 1
- use read_to_end always return TimedOut err HOT 2
- Stuck when writing data to the serial port if paired port is not open [Windows 11] HOT 2
- USB ports detected as unknown in docker HOT 1
- Print to COM port via USB to SERIAL converter cable on Windows HOT 1
- Set a Custom Baudrate HOT 1
- Unplug serial device cause system shutdown on windows HOT 8
- Fast receive missing beginning of packet HOT 3
- Tracking issue for WebSerial support. HOT 1
- Can Add Mark and Space to Parity? HOT 1
- Configurable buffer size HOT 1
- Update dependency on nix to 0.28 HOT 3
- Potentially confusing read_exact timeout semantics HOT 1
- wrong serial number for FTDI modules ? HOT 1
- Timeout reading SerialUSB from Arduino DUE or GIGA HOT 3
- Outdated documentation for TTYPort HOT 2
- Opening a COM port on Windows fails HOT 5
- Cannot list virtual serial ports on Windows 10 HOT 3
- Data misread from serial adapter (serialport only) HOT 12
- Serial port operation has different performance in (windows10 \ MacOS) HOT 3
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.