Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Add an option to disable buffering writes to a closed port #1593

Open
maxwellhadley opened this issue Jul 5, 2018 · 3 comments
Labels
Milestone

Comments

@maxwellhadley
Copy link

  • SerialPort Version: 6.2.0

  • NodeJS Version: N/A

  • Operating System and Hardware Platform: N/A

  • Have you checked the right version of the api docs?: N/A

  • Are you having trouble installing and you checked the Installation Special Cases docs? N/A

  • Are you using Electron and have you checked the Electron Docs?: N/A

I have a device which is only intermittently connected, and requires a specific handshake sequence each time it is connected. The user may disconnect it without warning. Although I now test the isOpen property before every write, there is a race condition where a device disconnect occurs between the property access and the write, which results in the write being buffered. The next time the device is connected, the handshake sequence is not correct, because of the buffered write.

This could be avoided by adding a Serialport constructor option to disable buffering of writes to a closed port.

@reconbot
Copy link
Member

reconbot commented Jul 5, 2018 via email

@zoedepsi
Copy link

zoedepsi commented Jul 6, 2018

I have the similar question that my server read data from serialport every 30s,but about 100 times after,the data will be wrong because of the buffer data. so if there are a option to clear bufffer every time will be good, i think

@reconbot reconbot added the feature-request Feature or Enhancement label Jul 6, 2018
@reconbot reconbot added this to the Next milestone Sep 15, 2018
@maxwellhadley
Copy link
Author

Any chance of looking at this now, after the great re-organisation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants