- [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
- [unix] small changes to flushing data during port open and setup to prevent bad data
- [all] mock binding flush now works
- cleanup on mock-binding pending reads
- add `serialport-repl` as a bin and npm command
This has always been the dream. Use `fs.read` and `fs.write` to do reading and writing. To make that happen I've created a cross platform `Poller` object that notifies us once on `readable` and `writable` states.
- Reduce large write cpu usage from 100% to 1-2%
- Replace ReadPoller with a multi purpose poller because you can only have a single uv_poll_t on a fd at a time because reasons
- Experimented with doing this all in c++, maybe there are gains to doing that but I'd never finish.
- Some unrelated eslint changes
- Arduino echo should just echo, writing random bytes was messing it up
- use a file to disable tests in envs
- read and write errors can trigger disconnects
- disconnect event only happens if there are listeners, otherwise error events will be triggered
- a disconnect during write will always have a write error too
- win32 bindings seem to only trigger disconnects on writes
Calling SerialPort.list() previously returned promise but it always required callback argument to be present which goes against why promise is returned in the first place.
* chore(package): update dependencies
* docs(readme): add Greenkeeper badge
* Ignore package-lock.json and fix linting
* Work around some issues with ci's
* fix windows coverage
* upgrade to non deprecated buffer methods
* Don't lint on node 4 as it's now broken
I really wish packages would keep things working on LTS platforms.
Without this change, following error is signaled:
(node:12996) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: First argument must be an int
This allows for catching TypeErrors when open gets called
- Change MockBinding to properly throw and return errors on open
- Enforce bindings throwing on empty string paths