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
- Constructor now throws errors when given invalid options
- The Constructor’s callback is given to `.open()` if `openImmediately` is set
- Depreciation warning when using the old style SerialPort.SerialPort
- Fix bug where write callback was being called multiple times when write operations blocked
- [windows] refactored write code to be less complex
- [unix] refactored write code to be less complex
- added arduino required integration tests
- Errors should always be an error or null
- bindings.close doesn't throw with proper args so why are we catching?
- throw on update if given bad options
- support and test updating and opening with custom baud rates
- Error with the provided com port name instead of the mess we use under the hood to talk to the apis
- update _snprintf calls to _snprintf_s as the former is depreciated
- Add a binding test for bad ports
- Better argument handling
- Switch to commander as optimist is deprecated
- more output formats for serial port list
- give serialportterm a list option
- Test requiring the library as part of the build processes on all platforms
- move all js code into ./lib
- move all the easy stuff into ./lib/bindings the rest will bring breaking changes probably
We had ambiguous behavior and documentation around these settings and functions, this preserves all of the previous behavior and defines it in documentation and tests. This is a step towards separating out and cleaning up user supplied options to the constructor.
- isOpen() now pays attention to if we're in the middle of closing
Our faux state machine for opening and closing consists for 4 states
- closed
- opening
- open
- closing
Currently we only really care about if we're in open or not because that's when all our operations can happen. `#open` and `#close` care if they're opening or closing.
- Eliminates use of node-pre-gyp as an actual module dependency (just a package dependency, this might even be just a devDep now?)
- Reduces 5 blocking fs operations to 1
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>