summaryrefslogtreecommitdiff
authorjosef <josef>2002-10-21 20:22:57 (UTC)
committer josef <josef>2002-10-21 20:22:57 (UTC)
commitd7703116959fb71492f18a60eb41babd1183d7ec (patch) (unidiff)
treeb8c4d77c283ca06298525cd24cf0cf388b7443c8
parent95a908dba86f7588e3130094e7d292f3df6a3a42 (diff)
downloadopie-d7703116959fb71492f18a60eb41babd1183d7ec.zip
opie-d7703116959fb71492f18a60eb41babd1183d7ec.tar.gz
opie-d7703116959fb71492f18a60eb41babd1183d7ec.tar.bz2
WARNING, UNTESTED
- closeRawIO() when we're done with dialing
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/io_modem.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/io_modem.cpp b/noncore/apps/opie-console/io_modem.cpp
index 2f0c04e..e1f9ff1 100644
--- a/noncore/apps/opie-console/io_modem.cpp
+++ b/noncore/apps/opie-console/io_modem.cpp
@@ -1,85 +1,87 @@
1 1
2#include "io_modem.h" 2#include "io_modem.h"
3 3
4#include "dialer.h" 4#include "dialer.h"
5 5
6IOModem::IOModem( const Profile &profile ) 6IOModem::IOModem( const Profile &profile )
7 : IOSerial( profile ) { 7 : IOSerial( profile ) {
8 m_profile = profile; 8 m_profile = profile;
9} 9}
10 10
11 11
12IOModem::~IOModem() { 12IOModem::~IOModem() {
13 13
14} 14}
15 15
16 16
17void IOModem::close() { 17void IOModem::close() {
18 // Hangup, discarding result 18 // Hangup, discarding result
19 Dialer d(m_profile, rawIO()); 19 Dialer d(m_profile, rawIO());
20 d.setHangupOnly(); 20 d.setHangupOnly();
21 d.exec(); 21 d.exec();
22 closeRawIO();
22 23
23 IOSerial::close(); 24 IOSerial::close();
24} 25}
25 26
26bool IOModem::open() { 27bool IOModem::open() {
27 bool ret = IOSerial::open(); 28 bool ret = IOSerial::open();
28 if(!ret) return false; 29 if(!ret) return false;
29 30
30 Dialer d(m_profile, rawIO()); 31 Dialer d(m_profile, rawIO());
31 32
32 int result = d.exec(); 33 int result = d.exec();
34 closeRawIO();
33 if(result == QDialog::Accepted) 35 if(result == QDialog::Accepted)
34 { 36 {
35 return true; 37 return true;
36 } 38 }
37 else 39 else
38 { 40 {
39 close(); 41 close();
40 return false; 42 return false;
41 } 43 }
42} 44}
43 45
44void IOModem::reload( const Profile &config ) { 46void IOModem::reload( const Profile &config ) {
45 47
46 m_device = config.readEntry("Device", MODEM_DEFAULT_DEVICE); 48 m_device = config.readEntry("Device", MODEM_DEFAULT_DEVICE);
47 m_baud = config.readNumEntry("Baud", MODEM_DEFAULT_BAUD); 49 m_baud = config.readNumEntry("Baud", MODEM_DEFAULT_BAUD);
48 m_parity = config.readNumEntry("Parity", MODEM_DEFAULT_PARITY); 50 m_parity = config.readNumEntry("Parity", MODEM_DEFAULT_PARITY);
49 m_dbits = config.readNumEntry("DataBits", MODEM_DEFAULT_DBITS); 51 m_dbits = config.readNumEntry("DataBits", MODEM_DEFAULT_DBITS);
50 m_sbits = config.readNumEntry("StopBits", MODEM_DEFAULT_SBITS); 52 m_sbits = config.readNumEntry("StopBits", MODEM_DEFAULT_SBITS);
51 m_flow = config.readNumEntry("Flow", MODEM_DEFAULT_FLOW); 53 m_flow = config.readNumEntry("Flow", MODEM_DEFAULT_FLOW);
52 54
53 m_initString = config.readEntry("InitString", MODEM_DEFAULT_INIT_STRING ); 55 m_initString = config.readEntry("InitString", MODEM_DEFAULT_INIT_STRING );
54 m_resetString = config.readEntry("ResetString", MODEM_DEFAULT_RESET_STRING ); 56 m_resetString = config.readEntry("ResetString", MODEM_DEFAULT_RESET_STRING );
55 m_dialPref1 = config.readEntry("DialPrefix1", MODEM_DEFAULT_DIAL_PREFIX1 ); 57 m_dialPref1 = config.readEntry("DialPrefix1", MODEM_DEFAULT_DIAL_PREFIX1 );
56 m_dialSuf1 = config.readEntry("DialSuffix1", MODEM_DEFAULT_DIAL_SUFFIX1 ); 58 m_dialSuf1 = config.readEntry("DialSuffix1", MODEM_DEFAULT_DIAL_SUFFIX1 );
57 m_dialPref2 = config.readEntry("DialPrefix2", MODEM_DEFAULT_DIAL_PREFIX1 ); 59 m_dialPref2 = config.readEntry("DialPrefix2", MODEM_DEFAULT_DIAL_PREFIX1 );
58 m_dialSuf2 = config.readEntry("DialSuffix2", MODEM_DEFAULT_DIAL_SUFFIX1 ); 60 m_dialSuf2 = config.readEntry("DialSuffix2", MODEM_DEFAULT_DIAL_SUFFIX1 );
59 m_dialPref3 = config.readEntry("DialPrefix3", MODEM_DEFAULT_DIAL_PREFIX1 ); 61 m_dialPref3 = config.readEntry("DialPrefix3", MODEM_DEFAULT_DIAL_PREFIX1 );
60 m_dialSuf3 = config.readEntry("DialSuffix3", MODEM_DEFAULT_DIAL_SUFFIX1 ); 62 m_dialSuf3 = config.readEntry("DialSuffix3", MODEM_DEFAULT_DIAL_SUFFIX1 );
61 m_connect = config.readEntry("DefaultConnect" MODEM_DEFAULT_CONNECT_STRING ); 63 m_connect = config.readEntry("DefaultConnect" MODEM_DEFAULT_CONNECT_STRING );
62 m_hangup = config.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ); 64 m_hangup = config.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING );
63 m_cancel = config.readEntry("CancelString", MODEM_DEFAULT_CANCEL_STRING ); 65 m_cancel = config.readEntry("CancelString", MODEM_DEFAULT_CANCEL_STRING );
64 m_dialTime = config.readNumEntry("DialTime", MODEM_DEFAULT_DIAL_TIME ); 66 m_dialTime = config.readNumEntry("DialTime", MODEM_DEFAULT_DIAL_TIME );
65 m_delayRedial = config.readNumEntry("DelayRedial", MODEM_DEFAULT_DELAY_REDIAL ); 67 m_delayRedial = config.readNumEntry("DelayRedial", MODEM_DEFAULT_DELAY_REDIAL );
66 m_numberTries = config.readNumEntry("NumberTries", MODEM_DEFAULT_NUMBER_TRIES ); 68 m_numberTries = config.readNumEntry("NumberTries", MODEM_DEFAULT_NUMBER_TRIES );
67 m_dtrDropTime = config.readNumEntry("DTRDRopTime", MODEM_DEFAULT_DTR_DROP_TIME ); 69 m_dtrDropTime = config.readNumEntry("DTRDRopTime", MODEM_DEFAULT_DTR_DROP_TIME );
68 m_bpsDetect = config.readBoolEntry("BPSDetect", MODEM_DEFAULT_BPS_DETECT ); 70 m_bpsDetect = config.readBoolEntry("BPSDetect", MODEM_DEFAULT_BPS_DETECT );
69 m_dcdLines = config.readBoolEntry("DCDLines", MODEM_DEFAULT_DCD_LINES ); 71 m_dcdLines = config.readBoolEntry("DCDLines", MODEM_DEFAULT_DCD_LINES );
70 m_multiLineUntag = config.readBoolEntry("MultiLineUntag", MODEM_DEFAULT_MULTI_LINE_UNTAG ); 72 m_multiLineUntag = config.readBoolEntry("MultiLineUntag", MODEM_DEFAULT_MULTI_LINE_UNTAG );
71} 73}
72 74
73 75
74QString IOModem::identifier() const { 76QString IOModem::identifier() const {
75 return "modem"; 77 return "modem";
76} 78}
77 79
78QString IOModem::name() const { 80QString IOModem::name() const {
79 return "Modem IO Layer"; 81 return "Modem IO Layer";
80} 82}
81 83
82void IOModem::slotExited(OProcess* proc ){ 84void IOModem::slotExited(OProcess* proc ){
83 close(); 85 close();
84} 86}
85 87