Menu

#5 please provide a getter for the file descriptor

open
nobody
None
5
2015-04-20
2015-03-12
No

Can you please provide a getter for mFileDescriptor?

We would like to put the read from serial in a select/poll code, but the library doesn't return the open file descriptor

" mImpl->mFileDescriptor = ::open(filename.c_str(), flags) ;"

this feature I think would be really useful to us, we can provide a patch if needed!

thanks

Discussion

  • Crayzee Wulf

    Crayzee Wulf - 2015-04-03

    Gianfranco, that sounds good. I will add it and commit to SVN this weekend.

     
  • Crayzee Wulf

    Crayzee Wulf - 2015-04-17

    Thanks, Gianfranco!! Sorry for the delay. I did not get a chance to finish fixing the unit tests but hope to do it this weekend and will have the "getter" in there in the next commit.

     
  • Crayzee Wulf

    Crayzee Wulf - 2015-04-17

    Okay. I checked in my update that includes a GetFileDescriptor() method in class SerialPort. Please have a look and let me know if this works for you. I will get the unit tests working this weekend.

     
  • Gianfranco Costamagna

    Hi Crayzee,

    I noticed we were using SerialStream class, but if we use SerialPort class we can just call Read* functions and pass a timeout, to achieve a better result insteaf of leveraging the low level file descriptor.

    Is this correct? if yes, would be nice maybe to just revert this change, since it might be dangerous and useless :)
    (sorry for the noise)

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.