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

Ioctl and serial ports #1

Open
thawkins opened this issue Jan 13, 2016 · 4 comments
Open

Ioctl and serial ports #1

thawkins opened this issue Jan 13, 2016 · 4 comments

Comments

@thawkins
Copy link

I would love to see support for ioctl and serial ports, i spend a lot of time building projects for arduimos, and usb-serial is the best way of interfacing.

I can have a go at implementing the basics if you would be amenable to a pull request.

@jpedrosa
Copy link
Owner

That sounds good. I would love to see what you can come up with.

@thawkins
Copy link
Author

I suspect its mainly about getting ioctrl to work, the rest is just the
normal unbuffered file i/o using device files (/dev/tty*). Ioctrl is also
only really needed for physical serial devices, setting baudrate,
handshaking etc. Most use now is /dev/ttyXxxxx over usb, which ignores
baudrate and does not really need handshakes.

But a serial device wrapper class would be very useful.
On Jan 14, 2016 12:29 AM, "Joao Pedrosa" notifications@github.com wrote:

That sounds good. I would love to see what you can come up with.


Reply to this email directly or view it on GitHub
#1 (comment).

@jpedrosa jpedrosa reopened this Jan 13, 2016
@jpedrosa
Copy link
Owner

If you want to wrap a couple of C APIs, we can add it to the CSua existing module:
https://github.com/jpedrosa/csua_module

For now the CSua module is only wrapping the "environ" API for the environment variables. And they have recently started adding "environ" directly to Swift, at first only for the FreeBSD port apparently. I have yet to test it whether it's enabled for Glibc as well or not.

@thawkins
Copy link
Author

Noted, i will check it out, im mainly interested in this because i want to
use swift to write a bunch of utilities to drive my 3d printers. I belive
the issue with importing ioctrl directly is that it has a varadic function
signature in "C" and swift imports dont handle that very well at the
moment, so a simple "c" wrapper is probaly called for.

Note: i also created a simple script to manage building if swift on fedora
which is my prefered linux distro. Its that version of swift i am testing
with.

https://github.com/thawkins/fedora-swift

You will have to bear with me, im still learning swift, i come from a long
time c++ and modern PHP background.
On Jan 14, 2016 1:06 AM, "Joao Pedrosa" notifications@github.com wrote:

If you want to wrap a couple of C APIs, we can add it to the CSua existing
module:
https://github.com/jpedrosa/csua_module

For now the CSua module is only wrapping the "environ" API for the
environment variables. And they have recently started adding "environ"
directly to Swift, at first only for the FreeBSD port apparently. I have
yet to test it whether it's enabled for Glibc as well or not.


Reply to this email directly or view it on GitHub
#1 (comment).

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

2 participants