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>
- isOpen() now pays attention to if we're in the middle of closing
Our faux state machine for opening and closing consists for 4 states
- closed
- opening
- open
- closing
Currently we only really care about if we're in open or not because that's when all our operations can happen. `#open` and `#close` care if they're opening or closing.
- Installation now has more navigation links
- The `.list` function is now documented
- We now have more valid examples with consistent quotes
- Command line tools are now kinda documented
- Eliminates use of node-pre-gyp as an actual module dependency (just a package dependency, this might even be just a devDep now?)
- Reduces 5 blocking fs operations to 1
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
- Test for and stop the double opening of ports
- More tests around opening and disconnecting
- Fix mock darwin hardware to be async and hold off zalgo
- Fix broken tests that counted on non async darwin hardware
- Ports correctly respond to `isOpen` during a close event
- cleanup some assertions
- if a CI has a port to test with, open and close it
Bonus
- Appveyor seems to think if you have a `&` in your commit message you’re trying to run a command
We weren’t running these except on node v0.10 now we can! One day we might have a virtual serial port on each CI environment and we can test a lot more. That day isn’t today.
- add another test for listing ports
- mock some more things in our mock binding, specially the real bindings
- Refactor to fix bugs
- Remove the path behind `udevadm` as it’s not always in the same place but it’s so far it is always in the path
- Tests listUnix, (`pnpId` assumes a lot about `udevadm` =( )
- Adds `ttyMDF` to the list of serial ports for “High Speed UART device of Intel Medfield platform”
- turn down the verboseness on appveyor nam installs
- upgrade sandboxed-module for windows support
Fixes#650, #651, #634, #697 and #621
This test works with the ArduinoEcho.ino sketch. It runs well as long as
the remote device is sending reasonably infrequently (a few bytes every
10ms, for example). But when the remote device is sending constantly
(comment out the delay in arduinoEcho.ino), this will stop at 852 bytes.
I have yet to determine a cause for this. Buffer overflow, perhaps?
This patch combines #586 and #686
- A closed serialport now uses fd = null
- Emulate a proper fd in mock hardware
- Instead of using the device path as the file descriptor, use a generated
integer as the fd.
This have to use a starting fd of 1 as there are bugs when the fd is 0.
The open(2) manpage states that the file descriptor will be a small
nonnegative integer.
Checking if the fd is falsey leads to the incorrect classification of the
fd 0 as invalid. That is not the case, open(2) specifies the fd as "a
small, nonnegative integer".
This also adds tests for all the cases where the fd was previously
incorrectly considered invalid, which required adding three more methods
to the mock-hardware (update, set and drain).
This solves issue #472