Commit graph

1031 commits

Author SHA1 Message Date
Francis Gulotta
f69407dc6a [all] Change the default high water mark to 64k (#1255)
The 16k water mark was set a long time ago, 64k is the default for `fs.ReadStream` You should experiment with your application and baudrate.

We also now allocate a buffer pool during object initialization because 99% of the time we'll be doing during runtime and why not take the perf hit upfront instead on first byte.

A side note: The source behind `Buffer.poolSize` and how buffers are allocated and the `ReadStream`'s `BufferList` are fascinating reads. It's obvious a lot of work has gone into these systems.
2017-07-24 18:24:40 -07: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
greenkeeper[bot]
38606f492a fix(package): update bindings to version 1.3.0 2017-07-24 13:43:19 -07:00
Jesus
2e45249078 lint & fixes 2017-07-23 08:19:39 -07:00
Jesus
c32ea9b5dd readline parser 2017-07-23 08:19:39 -07:00
Jesus
caffe7167a tests 2017-07-23 08:19:39 -07:00
Jesus
d55979d42a linted 2017-07-23 08:19:39 -07:00
Jesus
6de1d2bc28 call udevadm single time 2017-07-23 08:19:39 -07:00
Francis Gulotta
61cbcb39fe gussy up the docs and keywords describing uses 2017-07-22 17:46:27 -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
Rick Waldron
fb86820e4e Lift arguments object reference up to origin scope
See explanation: https://github.com/EmergingTechnologyAdvisors/node-serialport/issues/1245

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2017-07-21 14:44:06 -04:00
Francis Gulotta
468dfc29d7 [osx] Return the tty instead of the cu for osx serialports
For the record, tty's are `DialinDevice`s and cu's are `CalloutDevice`s

Thanks to @kishinmanglani for helping me solve this!

The closest we could come to docs. https://opensource.apple.com/source/IOSerialFamily/IOSerialFamily-7/IOSerialFamily.kmodproj/IOSerialKeys.h
2017-07-18 21:14:25 -04:00
Rick Waldron
45ea93a9b2 Add more npm ignorable things to the .npmignore file
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2017-07-18 18:01:09 -04:00
Francis Gulotta
6f3d5e1cae Bump to beta8 2017-07-17 09:28:24 -04:00
Francis Gulotta
c47b924aa1 Baudrate.250000 (#1239)
* Test for 250k baud rate
2017-07-16 22:42:51 -04:00
Francis Gulotta
9a826e5011 add a little to the upgrade guide 2017-07-16 22:28:48 -04: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
b822721855 refactor some test logic 2017-07-16 16:21:08 -04:00
Francis Gulotta
f97ea3aec3 notes on port.write error callback 2017-07-16 15:19:08 -04:00
Francis Gulotta
9c67ee2a43 [unix] Move setting up the baudrate to the end of the open()
- Test 1000000 baud
2017-07-15 13:06:44 -04:00
Francis Gulotta
2361fa599a Add the ttyAP subsystem to serialport list 2017-07-15 12:53:36 -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
36510e5402 upgrade packages 2017-07-15 12:01:13 -04:00
Francis Gulotta
33d61b301b Bump to beta7 2017-07-10 15:33:12 -04:00
Francis Gulotta
2045d8542f Remove the disconnect event 2017-07-09 21:54:53 -04:00
Francis Gulotta
1888efc944 Ensure flushing doesn't cause a read error which closes the port 2017-07-09 21:25:02 -04:00
Francis Gulotta
2ed7b119d0 Test flushing data
- [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
2017-07-09 21:25:02 -04:00
Francis Gulotta
2ab967db5a Mocking examples and testing entry point 2017-07-08 16:09:47 -04:00
Francis Gulotta
4cf9f4c7a4 remove the unnecessary disabled lint rules, make the repl easier (#1219) 2017-07-05 10:01:45 -04:00
Francis Gulotta
14bab11c82 Bump 5.0.0-beta6 2017-07-05 09:33:57 -04:00
Francis Gulotta
fc483b24a4 fix docs 2017-07-05 09:13:14 -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
fe55216268 fix docs 2017-06-29 10:30:05 -04:00
Mike
94a41df9ee argument-less SerialPort.list() returns promise
Calling SerialPort.list() previously returned promise but it always required callback argument to be present which goes against why promise is returned in the first place.
2017-06-29 10:28:58 -04:00
Francis Gulotta
ac4c082881 Don't build electron 32bit 2017-06-21 17:06:25 -04:00
Francis Gulotta
78db496d3e template for readme spelling correction 2017-06-20 15:43:19 -04:00
alaq
bd01ad8c1f typo, post to port 2017-06-20 15:42:43 -04:00
Francis Gulotta
81c1b90726 Drop windows 32bit node 4 because it can't install without a hack
Hopefully this now allows publishing with npm3+ and the latest node-pregyp and pregyp github
2017-06-19 22:25:33 -04:00
Francis Gulotta
78b5876e45 Version 5.0.0-beta5
- [docs] An overhaul of the format and language in our docs thanks to @LappleApple
- [all] Remove the c++ write queue
- [all] Add node 8 support and drop node 7 support
2017-06-19 21:21:17 -04:00
Francis Gulotta
4984943543 Pull out the c++ write queue (#1198) 2017-06-19 21:13:45 -04:00
greenkeeper[bot]
06543aa317 Update dependencies to enable Greenkeeper 🌴 (#1195)
* 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
2017-06-18 22:09:13 -04:00
Francis Gulotta
ab4b55c0a0 Pull README edits into the template and JS Doc
Updated the generated section of the docs but not all changes can be preserved.
2017-06-18 21:24:51 -04:00
Lauri Apple
4d6f6cf276 Update README.md 2017-06-18 21:24:51 -04:00
Francis Gulotta
427ac6fca2 Upgrade packages and add an package-lock.json 2017-06-17 22:23:55 -04:00
Francis Gulotta
dced3c99d4 build for node 8 and drop node 7 support 2017-06-17 14:04:59 -04:00
Francis Gulotta
1be9519634 Version 5.0.0-beta4
- [all] add regex stream parser and tests
- [all] upgrade to non deprecated buffer methods
- [docs] Add socketio example
- [windows] Fix unhandled promise rejection when calling read on Windows
2017-06-17 12:43:35 -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
Francis Gulotta
b619a8c572 new docs I guess 2017-05-14 11:31:11 -04:00
greenkeeperio-bot
f356b3fb59 chore(package): update eslint-plugin-standard to version 3.0.1
https://greenkeeper.io/
2017-05-14 11:24:16 -04:00
greenkeeperio-bot
24181bc5fb chore(package): update nan to version 2.6.2
https://greenkeeper.io/
2017-05-14 11:23:48 -04:00