Qtopia: GPRS (fwd)

lpotter lpotter at trolltech.com
Tue Jul 29 22:38:15 CEST 2008


Ole Kliemann writes:

> On Tue, Jul 29, 2008 at 12:24:50PM +1000, Lorn Potter wrote:
>> Ole Kliemann wrote:
>> > On Sun, Jul 27, 2008 at 12:13:05PM +0000, Ole Kliemann wrote:
>> >> I'm trying to send an MMS with Qtopia. I set up GPRS and WAP through the
>> >> GUI, but it did not work; the network interface failed to start when
>> >> sending. A look into the log shows this:
>> >>
>> >> Jul 27 09:57:37 om-gta02 user.notice Qtopia: Network :  Creating network session for "qtmail" on "/home/root/Applications/Network/config/dialupGPRS0.conf" 
>> >> Jul 27 09:57:37 om-gta02 user.notice Qtopia: Network :  starting pppd
>> (non-demand) : "/usr/sbin/pppd nodetach debug call dialup1217032395
>> password simyo logfile /tmp/qtopia-0/qpe-pppd-log-dialup1217032395
>> connect /opt/Qtopia/bin/qtopia-pppd-internal active /home/root/Appl
>> >> Jul 27 09:57:37 om-gta02 user.notice Qtopia: QServiceDeviceBase::run: could not find a pseudo-tty
>> >> Jul 27 09:57:37 om-gta02 user.notice Qtopia: Network : QModemDataCall::dial - could not start pppd
>> > 
>> > Qtopia launches pppd without a device parameter and redirects the modem
>> > device through a pseudo-tty to the stdin/out of the pppd process. Qtopia
>> > assumes BSD-style /dev/pty*, but on my FR I only got /dev/pts.
>> > 
>> > So I patched it for /dev/pts. Not sure how correct I have done this.
>> 
>> There is similar code in 4.4, I just added it to 4.3
>> Thanks
> 
> I missed something with this patch. The ttyname is used later and was
> not returned by createPseudoTty. That explains the garbage in the first
> arg when launching pppd.
> 
> Funny thing is, a connection worked, although the device was not passed
> to pppd. But I really don't understand yet how this whole thing works.

The patch I backported to 4.3 in Qtopia is this:

       // try opening Unix98 pseudo tty
    if ((masterFd = ::open("/dev/ptmx", O_RDWR | O_NONBLOCK, 0)) >= 0) {
        if (grantpt(masterFd) == 0) {
            if (unlockpt(masterFd) == 0) {
                ptsname_r(masterFd, ttyname, BUFSIZ);
                if ((slaveFd = ::open(ttyname, O_RDWR | O_NOCTTY, 0)) >= 0)
                    return true;
            }
        }
        ::close(masterFd);
    }





More information about the community mailing list