- 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.
`stream` seems unaffected by this but other future interfaces may not be so forgiving.
- removed the unused disconnect handler that we passed to bindings in tests.
- moved shouldReject to a test global
- unit tested unixRead
- use async functions
- use Object.entries/Object.values
- use Object spreading
BREAKING CHANGE: bindings now use async functions so they’ll never throw, only reject
- adds `npm run outdated` to our scripts that ensures every package in the monorepo is checked for outdated npm packages.
- upgrade nan for node 12 support
- upgrade debug and promirepl (no major changes)
- upgrade mocha and nyc
This is a crazy diff that's unreadable. Prettier has gained a lot of traction I personally like it and a lot of code looks like this these days. It also supports linting and formatting that eslint doesn't on its own. That alone helps keep the code more standard. This PR is equivalent of ripping off a bandaid.
- Add prittier
- `npm run format`
Libraries, LTS support and a large enough amount of users have all dropped node 4. As part of this years [J5 summit](https://github.com/rwaldron/johnny-five/issues/1463) we discussed supporting all Active, Maintenance and Current LTS releases only. This will greatly reduce maintenance overhead and make this maintainer a little bit more happy. The last version of serialport to support node 4 will be `serialport@6`.
- remove "use strict;"
- add engines directives to all package.json's
- drop safe-buffer as they're all safe now
- let eslint-plugin-node use the engines directive
- use new language features in a few random places to feel better about this
- stop including the package-lock.json
- upgrade a few packages
BREAKING: Dropping support for node 4
* 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
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
* 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.