summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/ppp/modem.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings/ppp/modem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/ppp/modem.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/noncore/settings/networksettings/ppp/modem.cpp b/noncore/settings/networksettings/ppp/modem.cpp
index 79f015b..7b2e2a3 100644
--- a/noncore/settings/networksettings/ppp/modem.cpp
+++ b/noncore/settings/networksettings/ppp/modem.cpp
@@ -225,8 +225,8 @@ bool Modem::opentty() {
225 tty.c_lflag &= ~(ECHO|ECHOE|ECHOK|ECHOKE); 225 tty.c_lflag &= ~(ECHO|ECHOE|ECHOK|ECHOKE);
226 226
227 227
228 if(_pppdata->flowcontrol() != "None") { 228 if(_pppdata->flowcontrol() != PPPData::FlowNone) {
229 if(_pppdata->flowcontrol() == "CRTSCTS") { 229 if(_pppdata->flowcontrol() == PPPData::FlowHardware) {
230 tty.c_cflag |= CRTSCTS; 230 tty.c_cflag |= CRTSCTS;
231 } 231 }
232 else { 232 else {
@@ -355,15 +355,19 @@ bool Modem::writeLine(const char *buf) {
355 char *b = new char[len+2]; 355 char *b = new char[len+2];
356 memcpy(b, buf, len); 356 memcpy(b, buf, len);
357 // different modems seem to need different line terminations 357 // different modems seem to need different line terminations
358 QString term = _pppdata->enter(); 358 switch( _pppdata->enter() ) {
359 if(term == "LF") 359 case PPPData::EndLF:
360 b[len++]='\n'; 360 b[len++]='\n';
361 else if(term == "CR") 361 break;
362 case PPPData::EndCR:
362 b[len++]='\r'; 363 b[len++]='\r';
363 else if(term == "CR/LF") { 364 break;
365 case PPPData::EndCRLF:
364 b[len++]='\r'; 366 b[len++]='\r';
365 b[len++]='\n'; 367 b[len++]='\n';
368 break;
366 } 369 }
370
367 int l = len; 371 int l = len;
368 while(l) { 372 while(l) {
369 int wr = write(modemfd, &b[len-l], l); 373 int wr = write(modemfd, &b[len-l], l);