Commit graph

31 commits

Author SHA1 Message Date
Francis Gulotta
c65bfc310e Show MockBinding.reset() in examples 2017-07-29 20:02:03 -04:00
Francis Gulotta
470afbcae6 Queue drains
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
2017-07-24 17:03:05 -07:00
Francis Gulotta
e8d9d2b16c Add write recording capabilities to the mock bindings (#1249)
- change echo default
- add a bunch of logging and serialport serialnumbers
2017-07-22 10:42:32 -07:00
Francis Gulotta
61e23d0907 [all] Have drain wait for pending JS write operations before calling system drain
This should allow drain to be a lot easier to use.

Bonus:
- More logging!
- Bluebird in tests with it's great long stack traces!
2017-07-16 22:05:58 -04:00
Francis Gulotta
ee7315f59c Make the mock bindings example work properly and the bindings easier to use 2017-07-15 12:24:33 -04:00
Francis Gulotta
2ab967db5a Mocking examples and testing entry point 2017-07-08 16:09:47 -04:00
Francis Gulotta
6455ecbb51 [unix] New read/write subsystem (#1212)
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
2017-07-05 09:12:31 -04:00
Francis Gulotta
5f53a45cae Buffer upgrades (#1168)
* 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.
2017-05-14 12:58:56 -04:00
Jessica Quynh Tran
b8b77e725f Add socketio example (#1081)
* Add socketio example
* fix json in .eslintrc file
2017-02-19 19:39:54 -05:00
Francis Gulotta
414057c4dc Promised based bindings.
- Base bindings class to extend
- Move docs to base binding
- Make all bindings classes
- Ditch push bindings because it doesn't make anything cleaner
2017-01-10 23:02:51 -05:00
Francis Gulotta
c40c24972a Reorganize files for clarity
- Move Parsers into a directory
- Move Bindings into a directory
- Add a linter for require calls
2017-01-07 00:23:20 -05:00
Francis Gulotta
453a477944 Update the examples for 5x 2017-01-03 23:44:41 -05:00
Francis Gulotta
c15eb841cb linting for es6 (#1040)
* linting for es6
2016-12-21 21:09:43 -05: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
fivdi
e6282a30df remove references to bytesWritten 2016-05-18 20:07:36 +02:00
Francis Gulotta
b9304d5225 Update README on opening ports and cleanup examples (#750) 2016-04-10 11:41:04 -04:00
Jacob Rosenthal
6f453b60ac whitespace 2015-03-01 22:04:40 -07:00
Jacob Rosenthal
55cce115a3 merged new break control signal for both windows and unix platforms 2015-03-01 20:28:05 -07:00
Jacob Rosenthal
7f965a846c rts and cts are default true 2015-03-01 20:00:11 -07:00
Jacob Rosenthal
f25074409d break mispelled and put a timeout after clear break too 2015-03-01 19:00:51 -07:00
Jacob Rosenthal
52abeb002f preliminary unix support for break 2015-02-24 06:14:20 -07:00
Jacob Rosenthal
7664fc5497 osx control signaling 2014-11-23 19:13:48 -07:00
Donald Ness
d6f82c9072 Fix undefined duration to calls 2013-12-12 18:54:12 -07:00
Donald Ness
0a000298b1 Add example to demonstrate drain() 2013-12-12 14:46:30 -07:00
Mike OShea
c33eac4552 Fixed delimiter choice 2013-03-28 18:11:53 -07:00
Mike OShea
105c96dccf A full example that really works
Just change the serial port name to match where your arduino is plugged in.
2013-03-28 16:03:34 -07:00
Chris Williams
cb6f17cde8 don't eat all the files. 2012-01-03 16:03:10 -05:00
Chris Williams
a607951b7d Reorder output statement to ensure that it has opened. 2012-01-03 11:26:52 -05:00
Chris Williams
92b72372d7 Make it run regardless of if the port is present (and restart if it is present) 2012-01-03 10:49:07 -05:00
Chris Williams
c8442b160e Adding example for logger code base. 2012-01-03 10:28:57 -05:00