author | josef <josef> | 2002-10-20 09:48:21 (UTC) |
---|---|---|
committer | josef <josef> | 2002-10-20 09:48:21 (UTC) |
commit | 940ba90ed4375f79b6a4934d290abf83980b77ad (patch) (unidiff) | |
tree | c455e88ce9fe99ef79048e3f228b7f4551652537 /noncore/apps/opie-console/dialer.cpp | |
parent | e2694c5aedb3697a373e363cebe72cddb3114a8f (diff) | |
download | opie-940ba90ed4375f79b6a4934d290abf83980b77ad.zip opie-940ba90ed4375f79b6a4934d290abf83980b77ad.tar.gz opie-940ba90ed4375f79b6a4934d290abf83980b77ad.tar.bz2 |
Please review!
- change modem default commands because we don't interpret ~ and friends
(minicom does AFAIK)
- disable unused AT settings for now
- when cancelling dialing, and we didn't yet get a single byte from the modem,
don't hangup
Diffstat (limited to 'noncore/apps/opie-console/dialer.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/dialer.cpp | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/noncore/apps/opie-console/dialer.cpp b/noncore/apps/opie-console/dialer.cpp index 51d4093..d37e406 100644 --- a/noncore/apps/opie-console/dialer.cpp +++ b/noncore/apps/opie-console/dialer.cpp | |||
@@ -60,2 +60,3 @@ Dialer::Dialer(const Profile& profile, int fd, QWidget *parent, const char *name | |||
60 | usercancel = 0; | 60 | usercancel = 0; |
61 | cleanshutdown = 0; | ||
61 | 62 | ||
@@ -135,9 +136,9 @@ void Dialer::trydial(const QString& number) | |||
135 | { | 136 | { |
136 | //if(state != state_cancel) | ||
137 | //{ | ||
138 | if(state != state_cancel) switchState(state_preinit); | 137 | if(state != state_cancel) switchState(state_preinit); |
139 | send("+++ATH"); | 138 | if(cleanshutdown) |
139 | { | ||
140 | send(m_profile.readEntry("HangupString")); | ||
141 | //send("+++ATH"); | ||
140 | send(""); | 142 | send(""); |
141 | //QString response = receive(); | 143 | } |
142 | //} | ||
143 | 144 | ||
@@ -146,4 +147,4 @@ void Dialer::trydial(const QString& number) | |||
146 | switchState(state_init); | 147 | switchState(state_init); |
147 | send("ATZ"); | 148 | //send("ATZ"); |
148 | //send(m_profile.readEntry("InitString")); | 149 | send(m_profile.readEntry("InitString")); |
149 | QString response2 = receive(); | 150 | QString response2 = receive(); |
@@ -177,6 +178,6 @@ void Dialer::trydial(const QString& number) | |||
177 | 178 | ||
178 | send(QString("ATDT %1").arg(number)); | 179 | //send(QString("ATDT %1").arg(number)); |
179 | //send(QString("%1 %2").arg(m_profile.readEntry("DialPrefix1")).arg(number)); | 180 | send(QString("%1 %2").arg(m_profile.readEntry("DialPrefix1")).arg(number)); |
180 | QString response5 = receive(); | 181 | QString response5 = receive(); |
181 | if(!response5.contains("\nCONNECT")) | 182 | if(!response5.contains("\n" + m_profile.readEntry("DefaultConnect"))) |
182 | { | 183 | { |
@@ -206,3 +207,3 @@ void Dialer::send(const QString& msg) | |||
206 | 207 | ||
207 | qWarning("Sending: '%s'", m.latin1()); | 208 | //qWarning("Sending: '%s'", m.latin1()); |
208 | 209 | ||
@@ -237,3 +238,3 @@ QString Dialer::receive() | |||
237 | buffer[ret] = 0; | 238 | buffer[ret] = 0; |
238 | qWarning("Got: '%s'", buffer); | 239 | //qWarning("Got: '%s'", buffer); |
239 | buf.append(QString(buffer)); | 240 | buf.append(QString(buffer)); |
@@ -241,3 +242,4 @@ qWarning("Got: '%s'", buffer); | |||
241 | { | 242 | { |
242 | qWarning("Receiving: '%s'", buf.latin1()); | 243 | //qWarning("Receiving: '%s'", buf.latin1()); |
244 | cleanshutdown = 1; | ||
243 | return buf; | 245 | return buf; |
@@ -251,4 +253,7 @@ qWarning("Receiving: '%s'", buf.latin1()); | |||
251 | else if(!(counter++ % 100)) qApp->processEvents(); | 253 | else if(!(counter++ % 100)) qApp->processEvents(); |
254 | |||
255 | if(usercancel) return QString::null; | ||
252 | } | 256 | } |
253 | 257 | ||
258 | cleanshutdown = 1; | ||
254 | return QString::null; | 259 | return QString::null; |