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

Support for serialport v6 #20

Open
ekawahyu opened this issue Dec 5, 2017 · 7 comments
Open

Support for serialport v6 #20

ekawahyu opened this issue Dec 5, 2017 · 7 comments

Comments

@ekawahyu
Copy link

ekawahyu commented Dec 5, 2017

When would be the timeline for virtual-serialport to support serialport v6? According to node-serialport documentation, 'data' event is not a preferable way to read from the serial port. Instead, it suggests to use .read().

So, when I use other libraries that support serialport v6, they mostly don't listen to 'data' event anymore. The virtual-serialport is broken in this regard. I have no idea how to move forward to fix this issue.

@ekawahyu
Copy link
Author

ekawahyu commented Dec 5, 2017

Here is the recently updated h5.modbus with support only for serialport > 6:
https://github.com/ekawahyu/h5.modbus/tree/master

I made a branch to support 'data' event temporarily here:
https://github.com/ekawahyu/h5.modbus/tree/fix/virtual-serialport-support

Please help to make some necessary changes to make it work with the latest h5.modbus. Thank you.

@Apollon77
Copy link

Also the parsers have changed and a lot more ...

@Apollon77
Copy link

Additionally: Maybe an update for serialport 6.x is not needed at all ...
Serialport 6 has a "Mocking" feature where you can define a port and can interact in a comparable way with serialport directly.
Currently you need to have direct access to the initialized Serialport instance, but maybe they change it (i opened an issue with them or this).

@Lucas-C
Copy link

Lucas-C commented Nov 15, 2022

Serialport 6 has a "Mocking" feature where you can define a port and can interact in a comparable way with serialport directly.

Indeed, this lib is no longer necesseray: https://serialport.io/docs/api-binding-mock

@Apollon77
Copy link

@Lucas-C Really?

What about

Currently you need to have direct access to the initialized Serialport instance, but maybe they change it (i opened an issue with them or this).

I think this is even not changed in the MockBinding

@Lucas-C
Copy link

Lucas-C commented Nov 17, 2022

I introduced a MockBinding.getOpenMockPort() method in this PR: serialport/binding-mock#20
I use it on my project with patch-package to get access to the MockPortBinding.
Just sharing, maybe that won't answer your need, but I hope it can help 😊

@Apollon77
Copy link

That indeed could work

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

No branches or pull requests

3 participants