Dear developers,
I am trying to run follwing code to open and get info about "/dev/ttyGS0"
port in BBB
#include <linux/serial.h>
bool foo()
{
const mode_t flags = O_RDWR | O_NONBLOCK | O_NOCTTY;
const int fd = ::open("/dev/ttyGS0", flags);
if (fd != -1) {
struct serial_struct serinfo;
const int retval = ::ioctl(fd, TIOCGSERIAL, &serinfo);
::close(fd);
if (retval != -1 && serinfo.type != PORT_UNKNOWN)
return true;
}
return false;
}
But I am getting "retval = -1" when following statement is run
const int retval = ::ioctl(fd, TIOCGSERIAL, &serinfo);
On further analysis I found that ioctl function call, return errno 25.
Can you please inform me what can be the reason for this error and how can
i solve it.
Please inform me if you need any other information from me.
Many thanks
Regards
Saurabh Jain
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beagleboard/1eb47495-bb87-485a-80da-f926a828464f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.