Diffstat (limited to 'noncore/apps/opie-console/dialer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/dialer.cpp | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/noncore/apps/opie-console/dialer.cpp b/noncore/apps/opie-console/dialer.cpp index 67ad10e..7010594 100644 --- a/noncore/apps/opie-console/dialer.cpp +++ b/noncore/apps/opie-console/dialer.cpp | |||
@@ -1,4 +1,10 @@ | |||
1 | #include "dialer.h" | 1 | #include "dialer.h" |
2 | #include "io_modem.h" | ||
3 | |||
4 | /* OPIE */ | ||
5 | #include <opie2/odebug.h> | ||
6 | using namespace Opie::Core; | ||
2 | 7 | ||
8 | /* QT */ | ||
3 | #include <qlayout.h> | 9 | #include <qlayout.h> |
4 | #include <qprogressbar.h> | 10 | #include <qprogressbar.h> |
@@ -9,4 +15,5 @@ | |||
9 | #include <qmessagebox.h> | 15 | #include <qmessagebox.h> |
10 | 16 | ||
17 | /* STD */ | ||
11 | #include <unistd.h> | 18 | #include <unistd.h> |
12 | #include <string.h> | 19 | #include <string.h> |
@@ -14,6 +21,4 @@ | |||
14 | #include <errno.h> | 21 | #include <errno.h> |
15 | 22 | ||
16 | #include "io_modem.h" | ||
17 | |||
18 | // State machine: | When an error occurs, we don't have to | 23 | // State machine: | When an error occurs, we don't have to |
19 | // | reset everything. | 24 | // | reset everything. |
@@ -105,5 +110,5 @@ void Dialer::slotCancel() | |||
105 | void Dialer::reset() | 110 | void Dialer::reset() |
106 | { | 111 | { |
107 | qWarning("reset"); | 112 | owarn << "reset" << oendl; |
108 | switchState(state_cancel); | 113 | switchState(state_cancel); |
109 | } | 114 | } |
@@ -137,9 +142,9 @@ void Dialer::dial(const QString& number) | |||
137 | void Dialer::trydial(const QString& number) | 142 | void Dialer::trydial(const QString& number) |
138 | { | 143 | { |
139 | qWarning("TryDial:%s", number.latin1() ); | 144 | owarn << "TryDial:" << number.latin1() << "" << oendl; |
140 | if(state != state_cancel) switchState(state_preinit); | 145 | if(state != state_cancel) switchState(state_preinit); |
141 | if(cleanshutdown) | 146 | if(cleanshutdown) |
142 | { | 147 | { |
143 | qWarning("HangupString " + m_profile.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING)); | 148 | owarn << "HangupString " << m_profile.readEntry("HangupString") << oendl; |
144 | send(m_profile.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ) + "\r"); | 149 | send(m_profile.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ) + "\r"); |
145 | } | 150 | } |
@@ -148,5 +153,5 @@ void Dialer::trydial(const QString& number) | |||
148 | { | 153 | { |
149 | switchState(state_init); | 154 | switchState(state_init); |
150 | // qWarning("Init String " + m_profile.readEntry("InitString") ); | 155 | // owarn << "Init String " + m_profile.readEntry("InitString") << oendl; |
151 | send(m_profile.readEntry("InitString",MODEM_DEFAULT_INIT_STRING ) + "\r"); | 156 | send(m_profile.readEntry("InitString",MODEM_DEFAULT_INIT_STRING ) + "\r"); |
152 | QString response2 = receive(); | 157 | QString response2 = receive(); |
@@ -159,5 +164,5 @@ void Dialer::trydial(const QString& number) | |||
159 | switchState(state_options); | 164 | switchState(state_options); |
160 | 165 | ||
161 | qWarning("ATM3l3"); | 166 | owarn << "ATM3l3" << oendl; |
162 | send("ATM3L3\r"); | 167 | send("ATM3L3\r"); |
163 | QString response3 = receive(); | 168 | QString response3 = receive(); |
@@ -179,5 +184,5 @@ void Dialer::trydial(const QString& number) | |||
179 | if(state != state_cancel) | 184 | if(state != state_cancel) |
180 | { | 185 | { |
181 | qWarning("progress"); | 186 | owarn << "progress" << oendl; |
182 | switchState(state_dialing); | 187 | switchState(state_dialing); |
183 | 188 | ||
@@ -215,5 +220,5 @@ void Dialer::send(const QString& msg) | |||
215 | QString termination; | 220 | QString termination; |
216 | 221 | ||
217 | qWarning("Sending: %s", m.latin1()); | 222 | owarn << "Sending: " << m.latin1() << "" << oendl; |
218 | 223 | ||
219 | /*termination = "\r"; | 224 | /*termination = "\r"; |
@@ -248,9 +253,9 @@ QString Dialer::receive() | |||
248 | buffer[i] = buffer[i] & 0x7F; | 253 | buffer[i] = buffer[i] & 0x7F; |
249 | buffer[ret] = 0; | 254 | buffer[ret] = 0; |
250 | qWarning("Got: %s", buffer); | 255 | owarn << "Got: " << buffer << "" << oendl; |
251 | buf.append(QString(buffer)); | 256 | buf.append(QString(buffer)); |
252 | if(buf.contains("OK") || buf.contains("ERROR") || buf.contains("CONNECT") || (buf.contains("BUSY"))) | 257 | if(buf.contains("OK") || buf.contains("ERROR") || buf.contains("CONNECT") || (buf.contains("BUSY"))) |
253 | { | 258 | { |
254 | //qWarning("Receiving: '%s'", buf.latin1()); | 259 | //owarn << "Receiving: '" << buf.latin1() << "'" << oendl; |
255 | cleanshutdown = 1; | 260 | cleanshutdown = 1; |
256 | return buf; | 261 | return buf; |