author | tille <tille> | 2003-05-24 16:12:02 (UTC) |
---|---|---|
committer | tille <tille> | 2003-05-24 16:12:02 (UTC) |
commit | cc1aa3e178dff65854913bd5667579fc33ce707d (patch) (unidiff) | |
tree | d37d7fd8fb3b9832c0825b015af862f2cc62f473 /noncore/settings/networksettings/ppp/modem.cpp | |
parent | 5667ded1d4583cfb79b2ddfd7aaae0e58ed6d552 (diff) | |
download | opie-cc1aa3e178dff65854913bd5667579fc33ce707d.zip opie-cc1aa3e178dff65854913bd5667579fc33ce707d.tar.gz opie-cc1aa3e178dff65854913bd5667579fc33ce707d.tar.bz2 |
saves config (still in the kppp way)
Diffstat (limited to 'noncore/settings/networksettings/ppp/modem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/modem.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/noncore/settings/networksettings/ppp/modem.cpp b/noncore/settings/networksettings/ppp/modem.cpp index a2f77c5..cd5d21c 100644 --- a/noncore/settings/networksettings/ppp/modem.cpp +++ b/noncore/settings/networksettings/ppp/modem.cpp | |||
@@ -102,5 +102,5 @@ speed_t Modem::modemspeed() { | |||
102 | // to set the modem. The constants here should all be ifdef'd because | 102 | // to set the modem. The constants here should all be ifdef'd because |
103 | // other systems may not have them | 103 | // other systems may not have them |
104 | int i = gpppdata.speed().toInt()/100; | 104 | int i = PPPData::data()->speed().toInt()/100; |
105 | 105 | ||
106 | switch(i) { | 106 | switch(i) { |
@@ -152,5 +152,5 @@ bool Modem::opentty() { | |||
152 | //begin if((modemfd = Requester::rq->openModem(gpppdata.modemDevice()))<0) { | 152 | //begin if((modemfd = Requester::rq->openModem(gpppdata.modemDevice()))<0) { |
153 | close(modemfd); | 153 | close(modemfd); |
154 | // device = "/dev/modem";//deviceByIndex(request.modem.deviceNum); | 154 | device = PPPData::data()->modemDevice(); |
155 | if ((modemfd = open(device, O_RDWR|O_NDELAY|O_NOCTTY)) == -1) { | 155 | if ((modemfd = open(device, O_RDWR|O_NDELAY|O_NOCTTY)) == -1) { |
156 | qDebug("error opening modem device !"); | 156 | qDebug("error opening modem device !"); |
@@ -162,5 +162,5 @@ bool Modem::opentty() { | |||
162 | 162 | ||
163 | #if 0 | 163 | #if 0 |
164 | if(gpppdata.UseCDLine()) { | 164 | if(PPPData::data()->UseCDLine()) { |
165 | if(ioctl(modemfd, TIOCMGET, &flags) == -1) { | 165 | if(ioctl(modemfd, TIOCMGET, &flags) == -1) { |
166 | errmsg = i18n("Unable to detect state of CD line."); | 166 | errmsg = i18n("Unable to detect state of CD line."); |
@@ -210,6 +210,6 @@ bool Modem::opentty() { | |||
210 | 210 | ||
211 | 211 | ||
212 | if(gpppdata.flowcontrol() != "None") { | 212 | if(PPPData::data()->flowcontrol() != "None") { |
213 | if(gpppdata.flowcontrol() == "CRTSCTS") { | 213 | if(PPPData::data()->flowcontrol() == "CRTSCTS") { |
214 | tty.c_cflag |= CRTSCTS; | 214 | tty.c_cflag |= CRTSCTS; |
215 | } | 215 | } |
@@ -340,5 +340,5 @@ bool Modem::writeLine(const char *buf) { | |||
340 | memcpy(b, buf, len); | 340 | memcpy(b, buf, len); |
341 | // different modems seem to need different line terminations | 341 | // different modems seem to need different line terminations |
342 | QString term = gpppdata.enter(); | 342 | QString term = PPPData::data()->enter(); |
343 | if(term == "LF") | 343 | if(term == "LF") |
344 | b[len++]='\n'; | 344 | b[len++]='\n'; |
@@ -380,7 +380,7 @@ bool Modem::hangup() { | |||
380 | 380 | ||
381 | // Then hangup command | 381 | // Then hangup command |
382 | writeLine(gpppdata.modemHangupStr().local8Bit()); | 382 | writeLine(PPPData::data()->modemHangupStr().local8Bit()); |
383 | 383 | ||
384 | usleep(gpppdata.modemInitDelay() * 10000); // 0.01 - 3.0 sec | 384 | usleep(PPPData::data()->modemInitDelay() * 10000); // 0.01 - 3.0 sec |
385 | 385 | ||
386 | #ifndef DEBUG_WO_DIALING | 386 | #ifndef DEBUG_WO_DIALING |
@@ -418,5 +418,5 @@ bool Modem::hangup() { | |||
418 | #endif | 418 | #endif |
419 | 419 | ||
420 | usleep(gpppdata.modemInitDelay() * 10000); // 0.01 - 3.0 secs | 420 | usleep(PPPData::data()->modemInitDelay() * 10000); // 0.01 - 3.0 secs |
421 | 421 | ||
422 | cfsetospeed(&temptty, modemspeed()); | 422 | cfsetospeed(&temptty, modemspeed()); |
@@ -441,9 +441,9 @@ void Modem::escape_to_command_mode() { | |||
441 | 441 | ||
442 | // +3 because quiet time must be greater than guard time. | 442 | // +3 because quiet time must be greater than guard time. |
443 | usleep((gpppdata.modemEscapeGuardTime()+3)*20000); | 443 | usleep((PPPData::data()->modemEscapeGuardTime()+3)*20000); |
444 | QCString tmp = gpppdata.modemEscapeStr().local8Bit(); | 444 | QCString tmp = PPPData::data()->modemEscapeStr().local8Bit(); |
445 | write(modemfd, tmp.data(), tmp.length()); | 445 | write(modemfd, tmp.data(), tmp.length()); |
446 | tcflush(modemfd, TCIOFLUSH); | 446 | tcflush(modemfd, TCIOFLUSH); |
447 | usleep((gpppdata.modemEscapeGuardTime()+3)*20000); | 447 | usleep((PPPData::data()->modemEscapeGuardTime()+3)*20000); |
448 | 448 | ||
449 | data_mode = false; | 449 | data_mode = false; |
@@ -561,5 +561,5 @@ int Modem::lockdevice() { | |||
561 | char newlock[80]=""; // safe | 561 | char newlock[80]=""; // safe |
562 | 562 | ||
563 | if(!gpppdata.modemLockFile()) { | 563 | if(!PPPData::data()->modemLockFile()) { |
564 | qDebug("The user doesn't want a lockfile."); | 564 | qDebug("The user doesn't want a lockfile."); |
565 | return 0; | 565 | return 0; |
@@ -570,5 +570,5 @@ int Modem::lockdevice() { | |||
570 | 570 | ||
571 | QString lockfile = LOCK_DIR"/LCK.."; | 571 | QString lockfile = LOCK_DIR"/LCK.."; |
572 | lockfile += gpppdata.modemDevice().mid(5); // append everything after /dev/ | 572 | lockfile += PPPData::data()->modemDevice().mid(5); // append everything after /dev/ |
573 | 573 | ||
574 | if(access(QFile::encodeName(lockfile), F_OK) == 0) { | 574 | if(access(QFile::encodeName(lockfile), F_OK) == 0) { |
@@ -601,5 +601,5 @@ if ((fd = openLockfile(QFile::encodeName(lockfile), O_RDONLY)) >= 0) { | |||
601 | } | 601 | } |
602 | 602 | ||
603 | fd = openLockfile(gpppdata.modemDevice(),O_WRONLY|O_TRUNC|O_CREAT); | 603 | fd = openLockfile(PPPData::data()->modemDevice(),O_WRONLY|O_TRUNC|O_CREAT); |
604 | if(fd >= 0) { | 604 | if(fd >= 0) { |
605 | sprintf(newlock,"%010d\n", getpid()); | 605 | sprintf(newlock,"%010d\n", getpid()); |