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] Create a LibSerialStream from a C file descriptor [sf#2] #40

Open
crayzeewulf opened this issue Jun 3, 2015 · 2 comments
Open
Assignees

Comments

@crayzeewulf
Copy link
Owner

*Reported by anonymous on 2008-07-27 05:44 UTC
I want to use the library with RFCOMM (serial over bluetooth).

In that case, a C file descriptor is provided to communicate with the device.

There is a really simple example on this page:
http://people.csail.mit.edu/albert/bluez-intro/x502.html
(see the example 4-3 for instance).

Would it be possible to add a constructor to LibSerialStream to be able to construct the object from a file descriptor?

Thanks.

@crayzeewulf crayzeewulf changed the title Create a LibSerialStream from a C file descriptor [Feature] Create a LibSerialStream from a C file descriptor [sf#2] Jun 3, 2015
@crayzeewulf crayzeewulf self-assigned this Jun 3, 2015
@crayzeewulf
Copy link
Owner Author

Commented by crayzeewulf on 2008-07-28 23:27 UTC
Logged In: YES
user_id=645118
Originator: NO

I am not sure what will happen if one tries to call termios functions on a descriptor returned by socket(). Furthermore, the SerialPort implementation is dependent on the fact that the descriptor be opened with specified flags (O_RDWR|O_NOCTTY|O_NONBLOCK). Additionally, keeping the descriptor hidden from users of the class ensures that the descriptor is completely controlled by the class and does not, for example, get closed by someone else while it is in use.

However, this is an interesting idea and worth investigating. I will look into it further and post updates based on what I find.

@crayzeewulf
Copy link
Owner Author

Updated by crayzeewulf on 2008-07-28 23:29 UTC

  • assigned_to: nobody --> crayzeewulf

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

No branches or pull requests

2 participants