mirror of
https://github.com/siemens-mobile-hacks/node-serialport-bindings-cpp.git
synced 2026-11-26 02:47:17 +00:00
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 |
||
|---|---|---|
| .. | ||
| parsers.js | ||
| serialport-basic.js | ||
| serialport-c.js | ||