Qtopia: GPRS
Ole Kliemann
ole-om-community-2008 at mail.plastictree.net
Mon Jul 28 20:32:18 CEST 2008
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.
Anyway it's not working yet:
Jul 28 16:29:29 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 28 16:29:29 om-gta02 user.notice Qtopia: Network : Call state: 2
Jul 28 16:29:29 om-gta02 user.notice Qtopia: Network : Data state: "DataCall started dataInactive "
Jul 28 16:29:29 om-gta02 user.notice Qtopia: /usr/sbin/pppd: unrecognized option '
Jul 28 16:29:29 om-gta02 user.notice Qtopia: '
Jul 28 18:29:29 om-gta02 daemon.err pppd[2905]: unrecognized option ' '
we'll see ...
Ole
-------------- next part --------------
--- src/libraries/qtopiacomm/serial/qserialiodevice.cpp_orig 2008年07月28日 17:12:31.000000000 +0200
+++ src/libraries/qtopiacomm/serial/qserialiodevice.cpp 2008年07月28日 18:15:29.000000000 +0200
@@ -251,25 +251,20 @@
// We would like to use "openpty", but it isn't in libc on some systems.
static bool createPseudoTty(int& masterFd, int& slaveFd, char *ttyname)
{
- static char const firstChars[] = "pqrstuvwxyzabcde";
- static char const secondChars[] = "0123456789abcdef";
- const char *first;
- const char *second;
- char ptyname[16];
- for ( first = firstChars; *first != '0円'; ++first ) {
- for ( second = secondChars; *second != '0円'; ++second ) {
- sprintf( ptyname, "/dev/pty%c%c", *first, *second );
- sprintf( ttyname, "/dev/tty%c%c", *first, *second );
- if ( ( masterFd = ::open( ptyname, O_RDWR | O_NONBLOCK, 0 ) ) >= 0 ) {
- if ( ( slaveFd = ::open( ttyname, O_RDWR | O_NOCTTY, 0 ) )
- >= 0 ) {
- return true;
- }
- ::close( masterFd );
- }
- }
+ masterFd=::open("/dev/ptmx", O_RDWR | O_NONBLOCK);
+ if (masterFd<0)
+ return false;
+ if (::grantpt(masterFd)<0)
+ return false;
+ if (::unlockpt(masterFd)<0)
+ return false;
+ ttyname=::ptsname(masterFd);
+ slaveFd=::open(ttyname, O_RDWR | O_NOCTTY);
+ if (slaveFd<0) {
+ ::close(masterFd);
+ return false;
}
- return false;
+ return true;
}
#endif // USE_POSIX_SYSCALLS
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://lists.openmoko.org/pipermail/community/attachments/20080728/7a0d4979/attachment.pgp
More information about the community
mailing list