ReadIntervalTimeout
A value of MAXDWORD, combined with zero values for both the ReadTotalTimeoutConstant and ReadTotalTimeoutMultiplier members, specifies that the read operation is to return immediately with the bytes that have already been received, even if no bytes have been received.
* Refactoring of EIO_List for Windows: …
1. use single API -- SetupAPI directly without COM-object
2. supply ResultItem with vendorId, productId and locationId (issue #877)
3. solve problem with pnpId not being returned on some systems
This is a major change. To reading, the poller and the bindings layer, there isn’t a great way to do this piecemeal. The goal here is to make bindings a plugin layer, our c++ bindings isolated and tested, and make Serialport a streams object.
- Move all bindings into platform specific modules DarwinBinding LinuxBinding, and WindowsBinding
- Separate out the bindings from the SerialPort class so it can be required by itself.
- Provide mock bindings as a tested first class bindings layer
- Mixin stream methods with `pushBindingWrap`, inspired from fs.readStream
- All integration tests now require an Arduino
- Ditch sandboxed modules as we don't need to be that heavy handed to test anymore
TODO
- windows binding
- performance test
- memory leak test
- 🎉
This should stop a leak in bindings.open() which calls ToParityEnum().
Thanks to @indutny for walking me through the changes and teaching me about valgrind!
- Fix bug where write callback was being called multiple times when write operations blocked
- [windows] refactored write code to be less complex
- [unix] refactored write code to be less complex
- added arduino required integration tests
- Errors should always be an error or null
- bindings.close doesn't throw with proper args so why are we catching?
- throw on update if given bad options
- support and test updating and opening with custom baud rates
- Error with the provided com port name instead of the mess we use under the hood to talk to the apis
- update _snprintf calls to _snprintf_s as the former is depreciated
- Add a binding test for bad ports
The unix version breaks the while loop by returning on certain errors.
On Windows, the errors were being contained because the while loop was
never breaking. For example, pulling the USB cable out would raise
“Access Denied” errors but the while loop would run forever and contain
that error.
HUPCL is a TTY control flag, not an FCNTL flag. Remove its effect on
open(2), and instead apply it tcsetattr(3).
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
- This replaces the removed shortcut methods to build a serial port
object with the non deprecated long form.
- Unit and Smoke tested on windows 10.
- Replaces #550 as that source tree has disappeared.
Fixes:
```
> serialport@2.0.1 install /Users/rwaldron/clonez/node-serialport
> node-pre-gyp install --fallback-to-build
(node) child_process: options.customFds option is deprecated. Use options.stdio instead.
CXX(target) Release/obj.target/serialport/src/serialport.o
CXX(target) Release/obj.target/serialport/src/serialport_unix.o
../src/serialport_unix.cpp:695:20: warning: comparison of array 'device.locationId' not
equal to a null pointer is always true [-Wtautological-pointer-compare]
if (device.locationId != NULL) {
~~~~~~~^~~~~~~~~~ ~~~~
../src/serialport_unix.cpp:698:20: warning: comparison of array 'device.vendorId' not
equal to a null pointer is always true [-Wtautological-pointer-compare]
if (device.vendorId != NULL) {
~~~~~~~^~~~~~~~ ~~~~
../src/serialport_unix.cpp:701:20: warning: comparison of array 'device.productId' not
equal to a null pointer is always true [-Wtautological-pointer-compare]
if (device.productId != NULL) {
~~~~~~~^~~~~~~~~ ~~~~
../src/serialport_unix.cpp:704:20: warning: comparison of array 'device.manufacturer' not
equal to a null pointer is always true [-Wtautological-pointer-compare]
if (device.manufacturer != NULL) {
~~~~~~~^~~~~~~~~~~~ ~~~~
../src/serialport_unix.cpp:707:20: warning: comparison of array 'device.serialNumber' not
equal to a null pointer is always true [-Wtautological-pointer-compare]
if (device.serialNumber != NULL) {
~~~~~~~^~~~~~~~~~~~ ~~~~
5 warnings generated.
```
It appears as though the registry topology has changed in 10.11.
In order to fix that, this code assumes nothing about the path, but
instead works on the assumption that we can already find the registry
entry as soon as the device is enumerated. By increasing the bounds
of the search we have a better chance of finding the registry entry
that we are looking for
refs: voodootikigod/node-serialport#552