- We now only return a port object if it's open and list and open methods are now exported on an interface
- hardware tests now work and only require a loopback (no ready event)
- Test pass on darwin (not on mock - it's not up to date yet and coverage is going to drop)
- cleanup up tests with modern javascript
- Breaking - change the names of the exported types
- No more constructors, now all binding specicific open options are specificd on open
- Arduino test file for loopback
This change migrates to typescript. The tests have been modified to conform to typescript and to cleanup cases when they weren't actually working (only one or two cases).
I've defined the existing bindings interface for all platforms. There are changes I'd love to make but didn't here (update/set/get/getBaudRate etc are messy). This should in theory be a drop in for the existing bindings. If there are bugs I imagine they're type related not functionality.
I dropped abstract bindings as having it a separate package didn't make sense during the refactor. I'd like to iterate on the design a bit more before returning to that class. Mockbinding may also now be drifted slightly from this package. I'll clean those inconsistencies up when I upgrade the main repo.
Serial numbers in win32 from USB devices cannot be readily derived from the PnP ID.
This adds some logic to iterate through the win32 registry, as per the research in #1459.
* 250k baudrate now works
* Generic linux non-standard baudrate setting using termios2
* Tested successfully with an FTDI usb chip with the tx and rx pins bridged. Previous solution using the B38400 hack returned gibberish in same setup.
* Test for linux and win32 baudrate setting. Darwin stubbed out.
The arbitrary baud interface has been working on darwin up to this point so it's
likely that it works properly. The GetBaudRate extension should still get
written to be thorough but for now, this will let the CI tests pass properly and
still throw a warning about the check being disabled.
That is, of course, if anyone's testing with the arduino hardware on darwin,
otherwise, these tests never run anyway.
- [osx] remove the 0x from productID and locationId and vendorId
- [linux] remove the starting 0x from any values, small refactor
- [linux] Fixup output using the hex encoded fields
- [windows] Grab the serial number from the pnp id
- Isolate list functions to their own platform files (c++)
- Better ensure our serialports fields are present
closes#1220
The 16k water mark was set a long time ago, 64k is the default for `fs.ReadStream` You should experiment with your application and baudrate.
We also now allocate a buffer pool during object initialization because 99% of the time we'll be doing during runtime and why not take the perf hit upfront instead on first byte.
A side note: The source behind `Buffer.poolSize` and how buffers are allocated and the `ReadStream`'s `BufferList` are fascinating reads. It's obvious a lot of work has gone into these systems.
Drains don't make any sense if called on a closed port or before any writes. I'm queuing drains so they run one the port opens, just like `write()` this allows for a much easier time ensuring all data is written in a script.
- `drain()` waits for an open event if the port is closed
- mock-bindings now cancel pending reads
closes#1229