diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-30 00:15:53 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-30 00:15:53 +0000 |
commit | 0aaa8e3fc8f8a1481333b564f0922277c8d8ad59 (patch) | |
tree | b95c0ca86c4876dd139af376b9f4afd8917cf0cd /src/progs/psp/base/psp_serial.cpp | |
parent | b79a2c28534cf09987eeeba3077fff9236df182a (diff) | |
download | piklab-0aaa8e3fc8f8a1481333b564f0922277c8d8ad59.tar.gz piklab-0aaa8e3fc8f8a1481333b564f0922277c8d8ad59.zip |
TQt4 port piklab
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1238822 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/progs/psp/base/psp_serial.cpp')
-rw-r--r-- | src/progs/psp/base/psp_serial.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/progs/psp/base/psp_serial.cpp b/src/progs/psp/base/psp_serial.cpp index 964d604..7da4c00 100644 --- a/src/progs/psp/base/psp_serial.cpp +++ b/src/progs/psp/base/psp_serial.cpp @@ -14,7 +14,7 @@ #include "common/common/number.h" //----------------------------------------------------------------------------- -Psp::SerialPort::SerialPort(const QString &device, Log::Base &log) +Psp::SerialPort::SerialPort(const TQString &device, Log::Base &log) : Port::Serial(device, NeedFlush, log) {} @@ -46,9 +46,9 @@ bool Psp::SerialPort::reset() return flush(0); } -bool Psp::SerialPort::command(uchar c, uint nbBytes, QMemArray<uchar> &a) +bool Psp::SerialPort::command(uchar c, uint nbBytes, TQMemArray<uchar> &a) { - log(Log::DebugLevel::Extra, QString("Command %1").arg(toHexLabel(c, 2))); + log(Log::DebugLevel::Extra, TQString("Command %1").tqarg(toHexLabel(c, 2))); if ( !sendChar(c) ) return false; return receive(nbBytes, a); } @@ -57,7 +57,7 @@ bool Psp::SerialPort::checkAck(uchar ec, uchar rc) { if ( ec==rc ) return true; log(Log::LineType::Error, i18n("Incorrect ack: expecting %1, received %2") - .arg(QString(toHex(ec, 2))).arg(QString(toHex(rc, 2)))); + .tqarg(TQString(toHex(ec, 2))).tqarg(TQString(toHex(rc, 2)))); return false; } @@ -65,14 +65,14 @@ bool Psp::SerialPort::checkEnd(uchar c) { if ( c==0 ) return true; log(Log::LineType::Error, i18n("Incorrect received data end: expecting 00, received %1") - .arg(QString(toHex(c, 2)))); + .tqarg(TQString(toHex(c, 2)))); return false; } -bool Psp::SerialPort::commandAck(uchar c, uint nbBytes, QMemArray<uchar> *a) +bool Psp::SerialPort::commandAck(uchar c, uint nbBytes, TQMemArray<uchar> *a) { Q_ASSERT( nbBytes>=1 ); - QMemArray<uchar> tmp; + TQMemArray<uchar> tmp; if ( !command(c, nbBytes, tmp) ) return false; if ( !checkAck(c, tmp[0]) ) return false; if (a) *a = tmp; @@ -81,13 +81,13 @@ bool Psp::SerialPort::commandAck(uchar c, uint nbBytes, QMemArray<uchar> *a) bool Psp::SerialPort::receiveEnd() { - QMemArray<uchar> a; + TQMemArray<uchar> a; if ( !receive(1, a) ) return false; if ( !checkEnd(a[0]) ) return false; return true; } -bool Psp::SerialPort::commandAckEnd(uchar c, uint nbBytes, QMemArray<uchar> &a) +bool Psp::SerialPort::commandAckEnd(uchar c, uint nbBytes, TQMemArray<uchar> &a) { Q_ASSERT( nbBytes>=2 ); if ( !command(c, nbBytes, a) ) return false; @@ -100,7 +100,7 @@ bool Psp::SerialPort::sendData(uint value, uint nbBytes) { Q_ASSERT( nbBytes==1 || nbBytes==2 ); Q_ASSERT( value<uint(1 << 8*nbBytes) ); - QMemArray<uchar> a(nbBytes); + TQMemArray<uchar> a(nbBytes); if ( nbBytes==2 ) { a[0] = value / 256; a[1] = value & 0xFF; |