wvdial from c++

Your modem is a special file (a character device) which by most means is treated just like any file. This character device is an abstraction of the serial interface.

So open, read and write do work.

Just open the char device (something like open("/dev/ttyUSB0", O_RDWR) ) and then write the AT commands to the file descriptor returned from open.

A starting point:


BTW you can use C++ streams I/O also; any Unix file descriptor can be treated like a C++ stream.

Finally when you start the PPP session you can fork and execute (“man 2 exec” and “man fork”) ppp and pass the file descriptor, just as wvdial, chat, comgt and others do.