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

Serial port support #77

Open
radarsat1 opened this issue Apr 10, 2019 · 3 comments
Open

Serial port support #77

radarsat1 opened this issue Apr 10, 2019 · 3 comments
Labels
wishlist items that are not just enhancements of existing API but completely new features

Comments

@radarsat1
Copy link
Owner

It should be possible to leverage the stream support to add serial port support on all supported operating system, avoiding the need to use an external library or custom code for this common scenario of using OSC to interact with devices.

@radarsat1 radarsat1 added the wishlist items that are not just enhancements of existing API but completely new features label Apr 10, 2019
@radarsat1
Copy link
Owner Author

I should say that this seemingly is unneeded with respect to #76, as the user could use an external serial library, but since serial port APIs are quite stable on supported operating systems it would be really cool for liblo to just support it directly.

@7890
Copy link
Contributor

7890 commented Apr 10, 2019

I have thought about that too - for talking to serial devices like a breeze with liblo.
The serial part on linux seems simple enough.
This is a fully working serial program (tiny, around 150 LOC w/out comments):
https://raw.githubusercontent.com/7890/csnip/master/com/com.c
It just needs some ringbuffers at the right places to connect with liblo.
As you mentioned, maybe serial will be one instance of a broader design towards streaming to/from all kinds of transports.

@7890
Copy link
Contributor

7890 commented Nov 29, 2019

@radarsat1 I might try this out. What would be the preferred place to hook it into the API?

I thought of using the message handler callbacks that would be attached to a serial connection. A common sequence would be:
-setup serial, get connection
-add message callback handler to serial connection (similar to lo_server_add_method())
-use the available message handlers
I'm unsure if raw messages with or without boundaries or SLIP makes more sense for the raw data. Let me know if you already have an idea on how and where it would integrate with the low-level API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wishlist items that are not just enhancements of existing API but completely new features
Projects
None yet
Development

No branches or pull requests

2 participants