What to use as descriptor in ioctl for USB modem?
I finally got my wireless USB modem up and running at boot. I'd like to monitor the Carrier Detect (CD) signal, though, so that I can see when the wireless network has decided to drop me and I need to reconnect. I understand that I can look at what's returned by a function call to ioctl:
ioctl(fd, TIOCMGET, &flags);
... and if bitwise-ANDing flags with TIOCM_CAR yields nonzero, CD is asserted; otherwise, it's not.
Here's my question, though: How do I get the file descriptor (fd) for the ioctl function? Where do I find it? Is there a function (in usb.c, say) that will return it?
Thanks for any help that you can offer this rank newbie.
|