- [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.
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
This is a major change. To reading, the poller and the bindings layer, there isn’t a great way to do this piecemeal. The goal here is to make bindings a plugin layer, our c++ bindings isolated and tested, and make Serialport a streams object.
- Move all bindings into platform specific modules DarwinBinding LinuxBinding, and WindowsBinding
- Separate out the bindings from the SerialPort class so it can be required by itself.
- Provide mock bindings as a tested first class bindings layer
- Mixin stream methods with `pushBindingWrap`, inspired from fs.readStream
- All integration tests now require an Arduino
- Ditch sandboxed modules as we don't need to be that heavy handed to test anymore
TODO
- windows binding
- performance test
- memory leak test
- 🎉
Parsers are now transform streams! I'm not 100% convinced this is easier to use but it is more clear about the mechanics. I think that might make it worthwhile. It also opens up a clear example to how to make your own parser.
Example:
```
var parser = byteDelimiter([0,0]);
parser(emit, new Buffer('\0hello\0world\0\0');
```
Expected: `emit` should be called once, upon `\0\0` with whole string.
What happens: `emit` is called twice, with `\0hello\0` and `world\0\0`.
- npm test now runs everything but stress tests
- TEST_PORT is optional but now requires an arduino, the travis provided OS X serial port wasn't worth it
- do some improvements to coverage
- Drop grunt for file size and complexity
- Eslint has dropped 0.10
I don't think Istanbul can detect coverage on sandboxed modules like our mocked bindings. Moving to an isolated binding will improve this situation.
I also don't think coveralls is working on travis