summaryrefslogtreecommitdiffstats
path: root/src/common/port/serial.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/port/serial.cpp')
-rw-r--r--src/common/port/serial.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/common/port/serial.cpp b/src/common/port/serial.cpp
index 2aaa7a8..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;
@@ -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
}