author | zecke <zecke> | 2002-10-24 20:43:25 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-24 20:43:25 (UTC) |
commit | 81a2bb8073b95d438911a62a7f4d8244ef58e20a (patch) (unidiff) | |
tree | 2521c88de626caf818b715776934da204d6b0f8f /noncore/apps/opie-console/dialer.cpp | |
parent | 0fc598a0ee9151f82f5a78383645a758d5f6cad9 (diff) | |
download | opie-81a2bb8073b95d438911a62a7f4d8244ef58e20a.zip opie-81a2bb8073b95d438911a62a7f4d8244ef58e20a.tar.gz opie-81a2bb8073b95d438911a62a7f4d8244ef58e20a.tar.bz2 |
Modem is now working
Kindly called from Germany to Switzerland
via rfcomm( affix) + Nokia6210 + Vodafone...
But now it's working
might be a hangup problem somewhere
Diffstat (limited to 'noncore/apps/opie-console/dialer.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/dialer.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/noncore/apps/opie-console/dialer.cpp b/noncore/apps/opie-console/dialer.cpp index ce2b688..8524422 100644 --- a/noncore/apps/opie-console/dialer.cpp +++ b/noncore/apps/opie-console/dialer.cpp | |||
@@ -89,6 +89,7 @@ void Dialer::setHangupOnly() | |||
89 | { | 89 | { |
90 | state = state_cancel; | 90 | state = state_cancel; |
91 | usercancel = 1; | 91 | usercancel = 1; |
92 | send("+++ATH\r"); | ||
92 | } | 93 | } |
93 | 94 | ||
94 | void Dialer::slotCancel() | 95 | void Dialer::slotCancel() |
@@ -98,7 +99,9 @@ void Dialer::slotCancel() | |||
98 | usercancel = 1; | 99 | usercancel = 1; |
99 | reset(); | 100 | reset(); |
100 | } | 101 | } |
101 | else accept(); | 102 | else { |
103 | accept(); | ||
104 | } | ||
102 | } | 105 | } |
103 | 106 | ||
104 | void Dialer::reset() | 107 | void Dialer::reset() |
@@ -140,9 +143,9 @@ void Dialer::trydial(const QString& number) | |||
140 | if(cleanshutdown) | 143 | if(cleanshutdown) |
141 | { | 144 | { |
142 | qWarning("HangupString " + m_profile.readEntry("HangupString")); | 145 | qWarning("HangupString " + m_profile.readEntry("HangupString")); |
143 | send(m_profile.readEntry("HangupString")); | 146 | //send(m_profile.readEntry("HangupString")); |
144 | //send("+++ATH"); | 147 | send("+++ATH\r"); |
145 | send(""); | 148 | //send(""); |
146 | } | 149 | } |
147 | 150 | ||
148 | if(state != state_cancel) | 151 | if(state != state_cancel) |
@@ -187,7 +190,7 @@ void Dialer::trydial(const QString& number) | |||
187 | send(QString("ATDT %1\r").arg(number)); | 190 | send(QString("ATDT %1\r").arg(number)); |
188 | // send(QString("%1 %2").arg(m_profile.readEntry("DialPrefix1")).arg(number)); | 191 | // send(QString("%1 %2").arg(m_profile.readEntry("DialPrefix1")).arg(number)); |
189 | QString response5 = receive(); | 192 | QString response5 = receive(); |
190 | if(!response5.contains("\n" + m_profile.readEntry("DefaultConnect"))) | 193 | if(!response5.contains("CONNECT") ) |
191 | { | 194 | { |
192 | if(response5.contains("BUSY")) | 195 | if(response5.contains("BUSY")) |
193 | switchState(state_dialing); | 196 | switchState(state_dialing); |
@@ -201,9 +204,11 @@ void Dialer::trydial(const QString& number) | |||
201 | } | 204 | } |
202 | } | 205 | } |
203 | 206 | ||
207 | |||
204 | if(state != state_cancel) | 208 | if(state != state_cancel) |
205 | { | 209 | { |
206 | switchState(state_online); | 210 | state = state_online; |
211 | slotCancel(); | ||
207 | } | 212 | } |
208 | } | 213 | } |
209 | 214 | ||
@@ -246,13 +251,16 @@ QString Dialer::receive() | |||
246 | for(int i = 0; i < ret; i++) | 251 | for(int i = 0; i < ret; i++) |
247 | buffer[i] = buffer[i] & 0x7F; | 252 | buffer[i] = buffer[i] & 0x7F; |
248 | buffer[ret] = 0; | 253 | buffer[ret] = 0; |
249 | //qWarning("Got: '%s'", buffer); | 254 | qWarning("Got: %s", buffer); |
250 | buf.append(QString(buffer)); | 255 | buf.append(QString(buffer)); |
251 | if(buf.contains("OK") || buf.contains("ERROR") || buf.contains("CONNECT") || (buf.contains("BUSY"))) | 256 | if(buf.contains("OK") || buf.contains("ERROR") || buf.contains("CONNECT") || (buf.contains("BUSY"))) |
252 | { | 257 | { |
253 | //qWarning("Receiving: '%s'", buf.latin1()); | 258 | //qWarning("Receiving: '%s'", buf.latin1()); |
254 | cleanshutdown = 1; | 259 | cleanshutdown = 1; |
255 | return buf; | 260 | return buf; |
261 | }else if (buf.contains("NO CARRIER") || buf.contains("NO DIALTONE") ) { | ||
262 | cleanshutdown = 1; | ||
263 | return QString::null; | ||
256 | } | 264 | } |
257 | } | 265 | } |
258 | else if(ret < 0) | 266 | else if(ret < 0) |