- 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