Commit graph

115 commits

Author SHA1 Message Date
Francis Gulotta
095b7c50be
chore: cleanup single package repository 2021-12-29 21:53:13 -05:00
Francis Gulotta
826545bd0a
chore: change to a monorepo structure with Lerna (#1586)
- move from istanbul to nyc and update coverage reporting
- global docs
- global linting
- global tests
2018-07-24 01:15:09 -04:00
Rony Kubat
384eb379e3 Add support for beaglebone serial ports. (#1600) 2018-07-20 23:40:33 -04:00
shodan8192
9006bd61f4 fix: memory leak in unix serialport poller (#1572) 2018-06-23 21:37:42 -04:00
Francis Gulotta
d829ada7b5
chore: change to new parser packages and upgrade (fix builds) (#1562) 2018-05-06 02:25:50 -04:00
Francis Gulotta
a31078f054 docs: Switch to @reconbot/jsdoc-theme for docs
It looks a little nicer and has a github link. This also upgrades eslint and tweaks the config.
2018-04-15 22:12:17 -04:00
Francis Gulotta
4bccb62e47 chore: move parsers to their new packages and clean up docs 2018-03-25 17:33:17 -04:00
Сковорода Никита Андреевич
0c1533b825 chore: Avoid using deprecated Buffer constructor (#1510)
safe-buffer is already used and provides Buffer.alloc polyfill, so
just use Buffer.alloc directly to avoid hitting deprecated API.

Refs:
https://nodejs.org/api/deprecations.html#deprecations_dep0005_buffer_constructor
2018-03-02 18:27:44 -05:00
Per Kristian Schanke
45b3a2feb5 feat(windows): Fetch USB serial number by lookups in win registry (#1483)
Serial numbers in win32 from USB devices cannot be readily derived from the PnP ID.
This adds some logic to iterate through the win32 registry, as per the research in #1459.
2018-02-28 07:37:49 -05:00
Francis Gulotta
41f1d2d2d6 docs(parsers): improve the parser examples 2018-02-27 23:07:07 -05:00
Francis Gulotta
e8b73c2784
docs: fix missing options objects and descriptions (#1504) 2018-02-27 22:49:33 -05:00
Jade Bilkey
910438c2ca feat(linux): Custom baud rates for linux (eg 250k baudrate) (#1464)
* 250k baudrate now works
* Generic linux non-standard baudrate setting using termios2
* Tested successfully with an FTDI usb chip with the tx and rx pins bridged. Previous solution using the B38400 hack returned gibberish in same setup.
* Test for linux and win32 baudrate setting. Darwin stubbed out.

The arbitrary baud interface has been working on darwin up to this point so it's
likely that it works properly. The GetBaudRate extension should still get
written to be thorough but for now, this will let the CI tests pass properly and
still throw a warning about the check being disabled.

That is, of course, if anyone's testing with the arduino hardware on darwin,
otherwise, these tests never run anyway.
2018-02-05 09:33:11 -05:00
Rodrigo Saboya
6a3ab65f09 feat(parsers): Adding option to include delimiter in the DelimiterParser transform. (#1453) 2018-01-25 15:59:28 -05:00
Francis Gulotta
f7eb2f0df4
feat(parsers): ByteLength is now more efficient (#1402)
And better documented
2017-11-16 12:50:48 -05:00
Francis Gulotta
dcd256d27a
docs(readyParser): correct the required parameters (#1392) 2017-11-04 23:48:09 -04:00
Francis Gulotta
60fc047289
feat(docs): Switch to JSDOC docs not in the readme (#1383)
- Improve a few docs here and there
- Rename the repo
- Remove the authors field in the package.json
2017-10-31 23:42:59 -04:00
Frank Lemanschik
bcb492f386 feat(parsers): Add cctalk parsers (#1342)
* Added Working CCTalk Parser
* add basic tests
* compiled docs for cctalk parser
2017-10-01 17:03:38 -04:00
Francis Gulotta
a3b8d35597 feat(open): Throw on incorrect baudrate option (#1347)
This was causing a lot of issues, lets make it easier on people.
2017-09-24 17:14:58 -04:00
Francis Gulotta
3faadac88a fix(docs): add missing parsers to properties list 2017-09-07 00:24:29 -04:00
Francis Gulotta
e83ec4e585 fix(docs): correct default highWaterMark to 65536 bytes 2017-08-10 16:30:33 -04:00
Francis Gulotta
0b554d7368 fix(windows): Parse more types of pnpIds (#1288)
This should give us more serial numbers on windows.

fixes #1220
2017-08-06 23:21:37 -04:00
Francis Gulotta
56074f606f fix(tests): fixup for #1279 (#1285) 2017-08-06 20:49:51 -04:00
Erik Kallen
bf46f682d4 fix(linux): The productID should be a number not a description string (#1279)
fix: #1278
2017-08-06 20:28:53 -04:00
Francis Gulotta
92c7dd4bfd docs: Fix missing new thanks to @patrykkalinowski 2017-07-31 23:05:40 -04:00
Francis Gulotta
af82d40cdb Remove console.log from regex parser 2017-07-29 20:28:39 -04:00
Francis Gulotta
4fc1404c8c [all] Unify the serialport.list output (#1266)
- [osx] remove the 0x from productID and locationId and vendorId
- [linux] remove the starting 0x from any values, small refactor
- [linux] Fixup output using the hex encoded fields
- [windows] Grab the serial number from the pnp id
- Isolate list functions to their own platform files (c++)
- Better ensure our serialports fields are present

closes #1220
2017-07-29 19:40:39 -04:00
Francis Gulotta
8b07a48576 [all] Change parsers to be es6 classes
- Reduces code a bit
- Provides a better code example
- clean up options passing into transform streams
2017-07-29 17:41:53 -04:00
Francis Gulotta
63c5554fee [unix] fix a bug when poller errors would be unhandled
They will now be handled by the reads and writes that use it.
2017-07-29 01:37:09 -04:00
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
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
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
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
c47b924aa1 Baudrate.250000 (#1239)
* Test for 250k baud rate
2017-07-16 22:42:51 -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
f97ea3aec3 notes on port.write error callback 2017-07-16 15:19:08 -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
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
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
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
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
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