Commit graph

56 commits

Author SHA1 Message Date
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
Francis Gulotta
ecc4c31bd8 Fix memory-leaks in SerialPortParity and cleanup (#989)
This should stop a leak in bindings.open() which calls ToParityEnum().

Thanks to @indutny for walking me through the changes and teaching me about valgrind!
2016-11-03 15:24:20 -04:00
Francis Gulotta
23de171055 Do error checking when getting modem control flags 2016-10-21 21:35:50 -04:00
jgillick
d3dcac14fa Fix code typos (duplicate ->cts) 2016-09-28 02:56:09 -07:00
jgillick
71a069f447 Add get function and bindings for modem status bits 2016-09-19 09:10:43 -07: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
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
67e84d950e Dry up serialport.cpp (#818) 2016-05-23 21:39:50 -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
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
cf41ef76bd Update the errors for unix to always include the err string and tests for close (#790) 2016-05-06 23:38:17 -04:00
Francis Gulotta
7b815fd6a4 Using clang and cpplint lint our c++ as much as I can (#762)
The `src/win/" vendor files are scary
2016-04-24 00:19:35 -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
39946c4bc0 Make the output of .list undefined if it’s an empty string (#740)
Add some tests to start defining the bindings.
2016-04-08 11:18:37 -04:00
Cong Liu
866e4153b2 Upgrade to Nan 2.0.0 2015-10-11 22:00:46 +02:00
Chris Williams
eaa4f0a721 Merge fix. 2015-05-07 11:01:03 -04:00
Jacob Rosenthal
7eba3f8d41 unix support for update baudrate 2015-04-10 16:36:27 -07:00
Jonathan Bendes
3f6c7192cd Added hang up on close option to constructor. 2015-04-06 12:44:32 -04:00
Jacob Rosenthal
b428c3d940 Revert "Add BREAK command, useful for CISCO router to break into rommon"
This reverts commit f37d1e690d.
2015-03-17 11:11:16 -07:00
Jérôme Marteaux
f37d1e690d Add BREAK command, useful for CISCO router to break into rommon 2015-03-06 15:12:08 +01:00
Jacob Rosenthal
52abeb002f preliminary unix support for break 2015-02-24 06:14:20 -07:00
Rob Giseburt
2c39fa8d9b Fixed uninitialized pointer. 2015-02-19 15:19:35 -06:00
Rob Giseburt
44328582e7 Temporarily removing cleanup on close. 2015-02-19 15:19:35 -06:00
Rob Giseburt
1d44fc97a5 Minor tweaks to close handling of write queue. 2015-02-19 15:19:35 -06:00
Rob Giseburt
5e93743d2c Multiple serial ports will now have their own write queue and thread. 2015-02-19 15:19:34 -06:00
Chris Williams
a742c97279 Merge branch 'master' of github.com:voodootikigod/node-serialport into develop 2014-12-10 20:04:15 -05:00
Chris Williams
92ff632b75 Merge pull request #418 from jacobrosenthal/controlsignals
osx control signaling
2014-12-10 20:03:46 -05:00
David Resseguie
b29fb12844 comment out "write again..." fprintf 2014-12-05 23:55:35 -05:00
Jacob Rosenthal
7664fc5497 osx control signaling 2014-11-23 19:13:48 -07:00
Chris Williams
cc754d2b4a Merge branch 'JohannesRudolph-issue-402' into develop 2014-11-07 10:02:53 -05:00
Chris Williams
42951ea56f Solves for issue #401 2014-11-07 08:02:56 -05:00
Johannes Rudolph
7668a1eea6 Seems we can't use NanScope (or anything v8 for that matter) on the libuv threadpool without getting a segfault. Parse options before opening instead and add a small structure with platform options. 2014-10-27 15:04:55 +01:00
Johannes Rudolph
38237cb18d Add options.platformOptions to allow setting platform specific options on .open() 2014-10-27 12:56:40 +01:00
Chris Williams
f1323b2300 Merge branch 'master' of https://github.com/giseburt/node-serialport into giseburt-master 2014-10-24 22:09:47 -04:00
Rob Giseburt
2325786066 Possible fix for #398 — dropped characters in each write().
Replaced crazy queue.h file with easier-to-understand (and working) doubly-linked-list semantics.
2014-10-16 16:32:21 -05:00
Oliver Schneider
5671b98815 Detect serial device disconnect on linux while polling and stop poling to prevent infinite loop 2014-10-05 21:54:12 +02:00
Chris Williams
010027673a Merge pull request #345 from voodootikigod/requewrites
Don't requeue the write if it fails
2014-08-07 16:23:41 -04:00
Chris Williams
11d368b7b0 Identified delete error. 2014-08-02 09:13:58 -04:00
Chris Williams
ddd3c0415a Update. 2014-08-02 09:01:41 -04:00
Asher Baker
1ceda2cecf Update for Node 0.11.x 2014-07-13 15:19:34 +01:00
yateya
ff51364e32 Don't requeue the write if it fails
Re-queuing write will give infinite loop if write consistently-fails; which is the case of total serial connection loss.
2014-06-11 12:38:06 -04:00
Rod Vagg
b1ea084ab5 convert to NAN for 0.8->0.11+ compatibility 2013-12-18 13:34:37 +11:00
Donald Ness
2bd51cccfb Add drain method to wait until output is transmitted 2013-10-31 10:05:34 -06:00
Robert Giseburt
dcadb0d842 Fixing write to support non-blocking. 2013-10-01 10:15:35 -05:00
Robert Giseburt
512bc80c2d Fix for close() (#150), support flow control (#203).
Flow control options haven't been added to windows yet.
2013-08-19 00:46:38 -05:00
Chris Williams
8bd63d8a24 Flushing changes for the new flowcontrol handling. 2013-08-13 14:37:10 -04:00
mscdex
eb11daf928 src: lint 2013-04-21 10:50:25 -04:00
Adriano Raiano
0cb7070150 added manufacturer and serialNumber in mac for 108#issuecomment-15285753 2013-03-22 11:10:14 +01:00
Adriano Raiano
07ca55b210 solve merge conflicts of pull request #108 2013-03-14 15:12:12 +01:00