Commit graph

52 commits

Author SHA1 Message Date
Francis Gulotta
223d39ff3f Remove readable-stream
Streams3 are stable in node 4+ so we don't need readable-stream anymore
2016-12-13 23:55:42 -05:00
Francis Gulotta
1643dd1c81 Remove Polyfills and upgrade node-pre-gyp
- Remove object.assign
- Remove buffer-indexof
- Remove lie
2016-12-12 22:26:47 -05:00
Munyiri Kamau
91d7f4a55c Remove space before function parentheses 2016-11-21 19:11:04 -08:00
Munyiri Kamau
975b270ba3 Adding WindowsBinding reading 2016-11-16 19:30:47 -08:00
Francis Gulotta
777cd99619 Ensure we always call callbacks asynchronously
- Some code cleanup too
- docs on debugging + some more debugging
2016-11-06 01:46:34 -04:00
Francis Gulotta
27788ceae9 Stop autoOpening on next tick
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
2016-11-06 00:23:29 -04:00
Francis Gulotta
5306b7f5e1 Give anonymous functions names for debugging
Also throw in some manual testing scripts.
2016-11-05 23:56:22 -04:00
Francis Gulotta
672e8319c3 Conform to NodeJS error message formats (#998)
https://github.com/nodejs/node/pull/3374
2016-11-04 23:29:07 -04:00
Francis Gulotta
39d0103937 Streams rewrite
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
- 🎉
2016-11-04 21:03:35 -04:00
Brian White
d4b4d2f210 Remove unnecessary 'inherits' dependency 2016-10-30 19:08:57 -04:00
Francis Gulotta
0d757fd72c Merge pull request #967 from jgillick/master
Get modem status bits (CTS, DSR, DCD)
2016-10-21 17:50:49 -04:00
Francis Gulotta
22a369112e put the dataCallback back for windows reads (#976) 2016-10-21 17:34:09 -04:00
jgillick
c1d6786cbc Generate docs 2016-10-20 23:25:17 -07:00
Jacob
bd022bc44a Flipped ByteLength & Delimiter descriptions 2016-10-19 15:16:32 -05:00
Francis Gulotta
72fc5b2597 rename ReadLineParser to ReadlineParser
matches gnu and nodejs conventions for `readline`
2016-10-13 02:26:05 +01:00
Andrew Koroluk
672abb4936 depreciated -> deprecated 2016-10-11 01:15:53 -04:00
Francis Gulotta
0597034194 Plug a hole in the linux/unix read function (#945)
`this.buffer` is never initialized so if we close the port while reading we'll get an error. This has no tests but doesn't fail any of our current tests. With the streams rewrite this is no longer an issue and instead of testing it fully here I'd rather concentrate on a new implementation of it.
2016-09-28 14:15:06 -04:00
jgillick
71a069f447 Add get function and bindings for modem status bits 2016-09-19 09:10:43 -07:00
Francis Gulotta
7c4b947490 update parser docs re data event (#928) 2016-09-09 12:57:03 -04:00
Francis Gulotta
d2bb973382
Transform parsers into streams
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.
2016-09-08 19:18:36 -04:00
Francis Gulotta
3247987c1f Allow opening after an open error. (#910)
fixes #908
2016-08-16 21:49:35 -04:00
Francis Gulotta
3400822e80 [unix] Flush now gives errors and flushes tx and rx (#900)
- Bonus less structs as many functions return nothing or error
2016-08-08 15:13:04 -04:00
Francis Gulotta
b3404072cf
Test the write non binding code a bit more 2016-08-08 00:35:23 -04:00
Francis Gulotta
5616664ed6 Change isOpen() to a propterty (#899) 2016-08-06 21:51:56 -04:00
Francis Gulotta
3aafa77e2c Remove lowercase options and properly define .path (#898) 2016-08-06 20:26:49 -04:00
Francis Gulotta
73e0713861 Module level JSDocs (#892)
* Document parsers
* Customize how events are displayed
2016-07-29 21:46:30 -04:00
Francis Gulotta
0e1b533e51 switch to the lie promise library (#891)
- it’s smaller by a tiny bit
 - doesn’t have a buggy polyfill
 - mimics the nodejs promise behavior closer with `unhandledRejection` errors
2016-07-29 18:07:03 -04:00
arve0
c5c7440415 parsers.byteDelimiter: compare arrays instead of increasing nextDelimIndex 2016-07-28 14:37:06 +02:00
arve0
0da7d00ec4 parsers.byteDelimiter: fix, emit only on following delimiters 2016-07-28 13:38:49 +02:00
Francis Gulotta
3d509b12b0 Use jsdoc to generate the api docs (#882)
This moves a lot of docs into JSDOC and provides a doc build system including throwing a CI error if the docs are out of date or if the wrong file was edited. Docs are put into the README for now but html docs are possible. Updated contributors guide to explain how to update the docs.

Todo: 
 - transition static methods and parsers into jsdoc
 - options objects and callbacks show as instance methods
2016-07-25 12:05:21 -04:00
Francis Gulotta
dcfe2ab4ee Switch up testing infrastructure (#881)
- 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
2016-07-24 22:20:23 -04:00
Francis Gulotta
333afbec0f Upgrade es6-promise and add note (#865) 2016-07-03 19:12:50 -04:00
Iskren Slavov
21ecbf603a Update list-unix.js 2016-06-26 10:02:04 +03:00
Iskren Slavov
44ea97c19c Do not redefine global Promise when it is available 2016-06-26 09:24:30 +03:00
Francis Gulotta
36be232bb1 Cleanup disconnect path (#855)
- make the disconnect path more consistent
 - call callback in the context of the port
2016-06-16 00:21:42 -04:00
Francis Gulotta
c84c9a22c9 Cleanup some callbacks (#851)
- remove the dataCallback option
 - remove the disconnectedCallback option
 - call callback in the context of the port
2016-06-14 23:12:44 -04:00
Francis Gulotta
7eca965961 Enable locking and sharing of the serialport (#840) 2016-06-11 22:34:07 -04:00
Francis Gulotta
e986563c75 Make sure .drain and .set error on all platforms. (#834) 2016-05-29 16:03:18 -04:00
Francis Gulotta
77c4ea37eb Remove the openImmediatly flag in favor of the autoOpen option (#830)
closes #809
2016-05-28 21:33:52 -04:00
Francis Gulotta
9a98ede77f Remove the serial port factory and throw errors on invalid arguments (#822)
- 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
2016-05-26 11:40:58 -04:00
Francis Gulotta
079777b694 Flowcontrol (#821)
Remove the extra flow control settings
2016-05-23 23:45:11 -04:00
Francis Gulotta
4b984e8995 write binding tests and cleanup (#808)
- 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
2016-05-16 21:33:00 -04:00
Francis Gulotta
77b1cbc2f7 Tighten up the graphics on level 4
I mean the linter rules, whitespace only.
2016-05-14 19:12:52 -04:00
Francis Gulotta
0063e13364 Make update cross platform for baud rates (#763)
- 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
2016-05-12 13:03:59 -04:00
Francis Gulotta
8d95d6f532 Fix an error in listUnix where we were filtering improperly (#792) 2016-05-08 22:16:04 -04:00
Francis Gulotta
92ae904c51 Drop some dependencies for a smaller bundle size (#767)
- Drop `bluebird` 168kb for `es6-promise` 37.1kb (vs 18.1kb library code) bundled sizes
 - Move `node-pre-gyp-github` to dev deps so it's not always installed (5.8MB package size)
 - Stop bundling `node-pre-gyp-github` as it's only needed during publishing
2016-04-26 14:18:08 -04:00
Francis Gulotta
edfa5e72bf Remove the last bit of references to self (#765)
- Sometimes we didn’t need it, sometimes a bind was cleaner
2016-04-25 10:56:30 -04:00
Francis Gulotta
555136f36b Stop removing all event listeners on close and disconnect (#764) 2016-04-25 10:02:24 -04:00
Francis Gulotta
1bd3e06c58 SerialportList updates (#761)
- Errors are now consistent across platforms
 - List is now completely async and promise ready
 - Test the bindings abstraction not the bindings itself
2016-04-23 12:43:31 -04:00
Francis Gulotta
6945217c0b Isolate the bindings (#755)
- 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
2016-04-15 23:54:58 -04:00