summaryrefslogtreecommitdiffstats
path: root/src/common/port/serial.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-15 15:33:27 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-15 15:33:27 -0600
commit9d6927a7d6a543332f828bffedf65eecf6774c6d (patch)
tree9f8210096908fddb7d266b477152021c45fa1a00 /src/common/port/serial.cpp
parent3534213800bd8d151759df307755f2bbd592dfa1 (diff)
downloadpiklab-9d6927a7d6a543332f828bffedf65eecf6774c6d.tar.gz
piklab-9d6927a7d6a543332f828bffedf65eecf6774c6d.zip
Rename a number of old tq methods that are no longer tq specific
Diffstat (limited to 'src/common/port/serial.cpp')
-rw-r--r--src/common/port/serial.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/common/port/serial.cpp b/src/common/port/serial.cpp
index 2db84b9..977f31c 100644
--- a/src/common/port/serial.cpp
+++ b/src/common/port/serial.cpp
@@ -73,21 +73,21 @@ TQStringList Port::Serial::deviceList()
TQStringList list;
#if defined(Q_OS_UNIX)
// standard serport in user space
- for (uint i=0; i<8; i++) list.append(TQString("/dev/ttyS%1").tqarg(i));
+ for (uint i=0; i<8; i++) list.append(TQString("/dev/ttyS%1").arg(i));
// new devfs serport flavour
- for (uint i=0; i<8; i++) list.append(TQString("/dev/tts/%1").tqarg(i));
+ for (uint i=0; i<8; i++) list.append(TQString("/dev/tts/%1").arg(i));
// standard USB serport in user space
- for (uint i=0; i<8; i++) list.append(TQString("/dev/ttyUSB%1").tqarg(i));
+ for (uint i=0; i<8; i++) list.append(TQString("/dev/ttyUSB%1").arg(i));
// new devfs USB serport flavour
- for (uint i=0; i<8; i++) list.append(TQString("/dev/usb/tts/%1").tqarg(i));
+ for (uint i=0; i<8; i++) list.append(TQString("/dev/usb/tts/%1").arg(i));
// FreeBSD
- for (uint i=0; i<8; i++) list.append(TQString("/dev/ttyd%1").tqarg(i));
+ for (uint i=0; i<8; i++) list.append(TQString("/dev/ttyd%1").arg(i));
// Slackware 11 devfs USB Serial port support.
- for (uint i=0; i<8; i++) list.append(TQString("/dev/tts/USB%1").tqarg(i));
+ for (uint i=0; i<8; i++) list.append(TQString("/dev/tts/USB%1").arg(i));
// MacOSX devfs USB Serial port support.
list.append("/dev/tty.usbserial");
#elif defined(Q_OS_WIN)
- for (uint i=1; i<10; i++) list.append(TQString("COM%1").tqarg(i));
+ for (uint i=1; i<10; i++) list.append(TQString("COM%1").arg(i));
#endif
return list;
}
@@ -187,7 +187,7 @@ bool Port::Serial::internalOpen()
{
_fd = openHandle(_device, In | Out);
if ( _fd==INVALID_HANDLE ) {
- setSystemError(i18n("Could not open device \"%1\" read-write").tqarg(_device));
+ setSystemError(i18n("Could not open device \"%1\" read-write").arg(_device));
return false;
}
if ( !getParameters(_oldParameters) ) return false; // save configuration
@@ -232,7 +232,7 @@ bool Port::Serial::internalSend(const char *data, uint size, uint timeout)
if ( res>0 ) todo -= res;
else {
if ( uint(time.elapsed())>timeout ) {
- log(Log::LineType::Error, i18n("Timeout sending data (%1/%2 bytes sent).").tqarg(size-todo).tqarg(size));
+ log(Log::LineType::Error, i18n("Timeout sending data (%1/%2 bytes sent).").arg(size-todo).arg(size));
return false;
}
msleep(1);
@@ -277,7 +277,7 @@ bool Port::Serial::internalReceive(uint size, char *data, uint timeout)
if ( res>0 ) todo -= res;
else {
if ( uint(time.elapsed())>timeout ) {
- log(Log::LineType::Error, i18n("Timeout receiving data (%1/%2 bytes received).").tqarg(size-todo).tqarg(size));
+ log(Log::LineType::Error, i18n("Timeout receiving data (%1/%2 bytes received).").arg(size-todo).arg(size));
return false;
}
msleep(1);
@@ -303,7 +303,7 @@ bool Port::Serial::drain(uint timeout)
if ( nb==0 ) break;
if ( uint(time.elapsed())>timeout ) {
_fd = INVALID_HANDLE; // otherwise close blocks...
- log(Log::LineType::Error, i18n("Timeout sending data (%1 bytes left).").tqarg(nb));
+ log(Log::LineType::Error, i18n("Timeout sending data (%1 bytes left).").arg(nb));
return false;
}
}
@@ -364,7 +364,7 @@ bool Port::Serial::setPinOn(uint pin, bool on, LogicType type)
Q_ASSERT( pin<Nb_Pins );
Q_ASSERT( PIN_DATA[pin].dir==Out );
if ( !internalSetPinOn(Pin(pin), on) ) {
- setSystemError(i18n("Error setting bit %1 of serial port to %2").tqarg(PIN_DATA[pin].label).tqarg(on));
+ setSystemError(i18n("Error setting bit %1 of serial port to %2").arg(PIN_DATA[pin].label).arg(on));
return false;
}
return true;
@@ -387,7 +387,7 @@ bool Port::Serial::internalReadPin(Pin pin, LogicType type, bool &value)
return true;
#elif defined(Q_OS_WIN)
DWORD status;
- if ( GetCommModemtqStatus(_fd, &status)==0 ) return false;
+ if ( GetCommModemStatus(_fd, &status)==0 ) return false;
switch (pin) {
case DCD: value = (status & MS_RLSD_ON); break;
case DSR: value = (status & MS_DSR_ON); break;
@@ -406,7 +406,7 @@ bool Port::Serial::internalReadPin(Pin pin, LogicType type, bool &value)
Q_ASSERT( pin<Nb_Pins );
Q_ASSERT( PIN_DATA[pin].dir==In );
if ( !internalReadPin(Pin(pin), type, value) ) {
- setSystemError(i18n("Error reading serial pin %1").tqarg(PIN_DATA[pin].label));
+ setSystemError(i18n("Error reading serial pin %1").arg(PIN_DATA[pin].label));
return false;
}
return true;
@@ -513,11 +513,11 @@ bool Port::Serial::setHardwareFlowControl(bool on)
void Port::Serial::setSystemError(const TQString &message)
{
#if defined(Q_OS_UNIX)
- log(Log::LineType::Error, message + TQString(" (errno=%1)").tqarg(strerror(errno)));
+ log(Log::LineType::Error, message + TQString(" (errno=%1)").arg(strerror(errno)));
#elif defined(Q_OS_WIN)
LPVOID lpMsgBuf;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&lpMsgBuf, 0, NULL);
- log(Log::LineType::Error, message + TQString(" (last error=%1 %2)").tqarg(GetLastError()).tqarg((const char *)(LPCTSTR)lpMsgBuf));
+ log(Log::LineType::Error, message + TQString(" (last error=%1 %2)").arg(GetLastError()).arg((const char *)(LPCTSTR)lpMsgBuf));
LocalFree(lpMsgBuf);
#endif
}