author | tille <tille> | 2003-05-30 15:06:17 (UTC) |
---|---|---|
committer | tille <tille> | 2003-05-30 15:06:17 (UTC) |
commit | 8699d02f6c152afed9490e7e7a4315044261e6e8 (patch) (side-by-side diff) | |
tree | d2ee2ba401c7a9db0e33beaf0617a1456fe01d50 /noncore/settings/networksettings/ppp/modem.cpp | |
parent | d8cec07fe5e54a68afe4feca574f9f4d2433e0c1 (diff) | |
download | opie-8699d02f6c152afed9490e7e7a4315044261e6e8.zip opie-8699d02f6c152afed9490e7e7a4315044261e6e8.tar.gz opie-8699d02f6c152afed9490e7e7a4315044261e6e8.tar.bz2 |
modem and pppdata is now member of interfaceppp
Diffstat (limited to 'noncore/settings/networksettings/ppp/modem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/modem.cpp | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/noncore/settings/networksettings/ppp/modem.cpp b/noncore/settings/networksettings/ppp/modem.cpp index 5139482..002c8e7 100644 --- a/noncore/settings/networksettings/ppp/modem.cpp +++ b/noncore/settings/networksettings/ppp/modem.cpp @@ -64,3 +64,3 @@ static sigjmp_buf jmp_buffer; -Modem *Modem::modem = 0; +//Modem *Modem::modem = 0; @@ -93,5 +93,5 @@ const char* pppdPath() { -Modem::Modem() +Modem::Modem( PPPData* pd ) { - if (Modem::modem != 0) return; //CORRECT? + _pppdata = pd; modemfd = -1; @@ -104,3 +104,2 @@ Modem::Modem() device = "/dev/modem"; - modem = this; } @@ -108,4 +107,4 @@ Modem::Modem() -Modem::~Modem() { - modem = 0; +Modem::~Modem() +{ } @@ -117,3 +116,3 @@ speed_t Modem::modemspeed() { // other systems may not have them - int i = PPPData::data()->speed().toInt()/100; + int i = _pppdata->speed().toInt()/100; @@ -167,3 +166,3 @@ bool Modem::opentty() { close(modemfd); - device = PPPData::data()->modemDevice(); + device = _pppdata->modemDevice(); if ((modemfd = open(device, O_RDWR|O_NDELAY|O_NOCTTY)) == -1) { @@ -177,3 +176,3 @@ bool Modem::opentty() { #if 0 - if(PPPData::data()->UseCDLine()) { + if(_pppdata->UseCDLine()) { if(ioctl(modemfd, TIOCMGET, &flags) == -1) { @@ -225,4 +224,4 @@ bool Modem::opentty() { - if(PPPData::data()->flowcontrol() != "None") { - if(PPPData::data()->flowcontrol() == "CRTSCTS") { + if(_pppdata->flowcontrol() != "None") { + if(_pppdata->flowcontrol() == "CRTSCTS") { tty.c_cflag |= CRTSCTS; @@ -355,3 +354,3 @@ bool Modem::writeLine(const char *buf) { // different modems seem to need different line terminations - QString term = PPPData::data()->enter(); + QString term = _pppdata->enter(); if(term == "LF") @@ -395,5 +394,5 @@ bool Modem::hangup() { // Then hangup command - writeLine(PPPData::data()->modemHangupStr().local8Bit()); + writeLine(_pppdata->modemHangupStr().local8Bit()); - usleep(PPPData::data()->modemInitDelay() * 10000); // 0.01 - 3.0 sec + usleep(_pppdata->modemInitDelay() * 10000); // 0.01 - 3.0 sec @@ -433,3 +432,3 @@ bool Modem::hangup() { - usleep(PPPData::data()->modemInitDelay() * 10000); // 0.01 - 3.0 secs + usleep(_pppdata->modemInitDelay() * 10000); // 0.01 - 3.0 secs @@ -456,7 +455,7 @@ void Modem::escape_to_command_mode() { // +3 because quiet time must be greater than guard time. - usleep((PPPData::data()->modemEscapeGuardTime()+3)*20000); - QCString tmp = PPPData::data()->modemEscapeStr().local8Bit(); + usleep((_pppdata->modemEscapeGuardTime()+3)*20000); + QCString tmp = _pppdata->modemEscapeStr().local8Bit(); write(modemfd, tmp.data(), tmp.length()); tcflush(modemfd, TCIOFLUSH); - usleep((PPPData::data()->modemEscapeGuardTime()+3)*20000); + usleep((_pppdata->modemEscapeGuardTime()+3)*20000); @@ -576,3 +575,3 @@ int Modem::lockdevice() { - if(!PPPData::data()->modemLockFile()) { + if(!_pppdata->modemLockFile()) { qDebug("The user doesn't want a lockfile."); @@ -585,3 +584,3 @@ int Modem::lockdevice() { QString lockfile = LOCK_DIR"/LCK.."; - lockfile += PPPData::data()->modemDevice().mid(5); // append everything after /dev/ + lockfile += _pppdata->modemDevice().mid(5); // append everything after /dev/ @@ -616,3 +615,3 @@ if ((fd = openLockfile(QFile::encodeName(lockfile), O_RDONLY)) >= 0) { - fd = openLockfile(PPPData::data()->modemDevice(),O_WRONLY|O_TRUNC|O_CREAT); + fd = openLockfile(_pppdata->modemDevice(),O_WRONLY|O_TRUNC|O_CREAT); if(fd >= 0) { @@ -990,3 +989,3 @@ bool Modem::execPPPDaemon(const QString & arguments) if(execpppd(arguments)==0) { - PPPData::data()->setpppdRunning(true); + _pppdata->setpppdRunning(true); return true; @@ -998,3 +997,3 @@ void Modem::killPPPDaemon() { - PPPData::data()->setpppdRunning(false); + _pppdata->setpppdRunning(false); killpppd(); |