Debugger: Remove symbian specific plugin
authorKai Koehne <kai.koehne@digia.com>
Mon, 28 Jan 2013 11:11:38 +0000 (12:11 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 30 Jan 2013 08:45:45 +0000 (09:45 +0100)
Symbian isn't supported any more. We only support debugging via TCP.

Change-Id: Ie7be06eeacd4206c4c14178e24c1b33d35fc8a0c
Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
src/plugins/qmltooling/qmldbg_ost/qmldbg_ost.pro [deleted file]
src/plugins/qmltooling/qmldbg_ost/qmlostplugin.cpp [deleted file]
src/plugins/qmltooling/qmldbg_ost/qmlostplugin.h [deleted file]
src/plugins/qmltooling/qmldbg_ost/qostdevice.cpp [deleted file]
src/plugins/qmltooling/qmldbg_ost/qostdevice.h [deleted file]
src/plugins/qmltooling/qmldbg_ost/usbostcomm.h [deleted file]

diff --git a/src/plugins/qmltooling/qmldbg_ost/qmldbg_ost.pro b/src/plugins/qmltooling/qmldbg_ost/qmldbg_ost.pro
deleted file mode 100644 (file)
index 6172ee9..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-TARGET = qmldbg_ost
-QT       += qml network
-
-PLUGIN_TYPE = qmltooling
-PLUGIN_CLASS_NAME = QmlOstPlugin
-load(qt_plugin)
-
-SOURCES += \
-    qmlostplugin.cpp \
-    qostdevice.cpp
-
-HEADERS += \
-    qmlostplugin.h \
-    qostdevice.h \
-    usbostcomm.h
diff --git a/src/plugins/qmltooling/qmldbg_ost/qmlostplugin.cpp b/src/plugins/qmltooling/qmldbg_ost/qmlostplugin.cpp
deleted file mode 100644 (file)
index bab33f7..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia.  For licensing terms and
-** conditions see http://qt.digia.com/licensing.  For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file.  Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights.  These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.  Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qmlostplugin.h"
-#include "qostdevice.h"
-
-#include <private/qqmldebugserver_p.h>
-#include <private/qpacketprotocol_p.h>
-
-QT_BEGIN_NAMESPACE
-
-static const TInt KQmlOstProtocolId = 0x94;
-
-class QmlOstPluginPrivate {
-public:
-    QmlOstPluginPrivate();
-
-    QOstDevice *ost;
-    QPacketProtocol *protocol;
-    QQmlDebugServer *debugServer;
-};
-
-QmlOstPluginPrivate::QmlOstPluginPrivate() :
-    ost(0),
-    protocol(0),
-    debugServer(0)
-{
-}
-
-QmlOstPlugin::QmlOstPlugin() :
-    d_ptr(new QmlOstPluginPrivate)
-{
-}
-
-QmlOstPlugin::~QmlOstPlugin()
-{
-    delete d_ptr;
-}
-
-void QmlOstPlugin::setServer(QQmlDebugServer *server)
-{
-    Q_D(QmlOstPlugin);
-    d->debugServer = server;
-}
-
-bool QmlOstPlugin::isConnected() const
-{
-    Q_D(const QmlOstPlugin);
-    return d->ost && d->ost->isOpen();
-}
-
-void QmlOstPlugin::send(const QByteArray &message)
-{
-    Q_D(QmlOstPlugin);
-
-    if (!isConnected())
-        return;
-
-    QPacket pack;
-    pack.writeRawData(message.data(), message.length());
-
-    d->protocol->send(pack);
-    //d->socket->flush();
-}
-
-void QmlOstPlugin::disconnect()
-{
-    Q_D(QmlOstPlugin);
-
-    delete d->protocol;
-    d->protocol = 0;
-}
-
-bool QmlOstPlugin::waitForMessage()
-{
-    Q_D(QmlOstPlugin);
-    return d->protocol->waitForReadyRead(-1);
-}
-
-void QmlOstPlugin::setPort(int port, bool block, const QString &hostaddress)
-{
-    Q_UNUSED(port);
-    Q_UNUSED(block);
-    Q_UNUSED(hostaddress);
-
-    Q_D(QmlOstPlugin);
-
-    d->ost = new QOstDevice(this);
-    bool ok = d->ost->open(KQmlOstProtocolId);
-    if (!ok) {
-        if (d->ost->errorString().length())
-            qDebug("Error from QOstDevice: %s", qPrintable(d->ost->errorString()));
-        qWarning("QML Debugger: Unable to listen to OST."); // This message is part of the signalling - do not change the format!
-        return;
-    }
-    d->protocol = new QPacketProtocol(d->ost, this);
-    QObject::connect(d->protocol, SIGNAL(readyRead()), this, SLOT(readyRead()));
-    qDebug("QML Debugger: Waiting for connection via OST."); // This message is part of the signalling - do not change the format!
-}
-
-void QmlOstPlugin::readyRead()
-{
-    Q_D(QmlOstPlugin);
-    QPacket packet = d->protocol->read();
-
-    QByteArray content = packet.data();
-    d->debugServer->receiveMessage(content);
-}
-
-Q_EXPORT_PLUGIN2(qmlostplugin, QmlOstPlugin)
-
-QT_END_NAMESPACE
diff --git a/src/plugins/qmltooling/qmldbg_ost/qmlostplugin.h b/src/plugins/qmltooling/qmldbg_ost/qmlostplugin.h
deleted file mode 100644 (file)
index a31cdb6..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia.  For licensing terms and
-** conditions see http://qt.digia.com/licensing.  For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file.  Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights.  These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.  Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QMLOSTPLUGIN_H
-#define QMLOSTPLUGIN_H
-
-#include <QtWidgets/QStylePlugin>
-#include <QtQml/private/qqmldebugserverconnection_p.h>
-
-QT_BEGIN_NAMESPACE
-
-class QQmlDebugServer;
-class QmlOstPluginPrivate;
-
-class QmlOstPlugin : public QObject, public QQmlDebugServerConnection
-{
-    Q_OBJECT
-    Q_DECLARE_PRIVATE(QmlOstPlugin)
-    Q_DISABLE_COPY(QmlOstPlugin)
-    Q_INTERFACES(QQmlDebugServerConnection)
-
-
-public:
-    QmlOstPlugin();
-    ~QmlOstPlugin();
-
-    void setServer(QQmlDebugServer *server);
-    void setPort(int port, bool bock, const QString &hostaddress);
-
-    bool isConnected() const;
-    void send(const QByteArray &message);
-    void disconnect();
-    bool waitForMessage();
-
-private Q_SLOTS:
-    void readyRead();
-
-private:
-    QmlOstPluginPrivate *d_ptr;
-};
-
-QT_END_NAMESPACE
-
-#endif // QMLOSTPLUGIN_H
diff --git a/src/plugins/qmltooling/qmldbg_ost/qostdevice.cpp b/src/plugins/qmltooling/qmldbg_ost/qostdevice.cpp
deleted file mode 100644 (file)
index e01041b..0000000
+++ /dev/null
@@ -1,220 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia.  For licensing terms and
-** conditions see http://qt.digia.com/licensing.  For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file.  Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights.  These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.  Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qostdevice.h"
-#include <e32base.h>
-
-#include "usbostcomm.h"
-
-class QOstDevicePrivate : public CActive
-{
-    QOstDevice* q_ptr;
-    Q_DECLARE_PUBLIC(QOstDevice)
-
-public:
-    QOstDevicePrivate() : CActive(CActive::EPriorityStandard) {
-        CActiveScheduler::Add(this);
-    }
-    ~QOstDevicePrivate() {
-        Cancel();
-    }
-
-    TInt& AoFlags() { return ((TInt*)&iStatus)[1]; }
-
-private:
-    void RunL();
-    void DoCancel();
-
-private:
-    RUsbOstComm ost;
-    TBuf8<4096> readBuf;
-    QByteArray dataBuf;
-    TBool inReadyRead;
-};
-
-QOstDevice::QOstDevice(QObject *parent) :
-    QIODevice(parent), d_ptr(new QOstDevicePrivate)
-{
-    d_ptr->q_ptr = this;
-}
-
-QOstDevice::~QOstDevice()
-{
-    close();
-    delete d_ptr;
-}
-
-bool QOstDevice::open(int ostProtocolId)
-{
-    if (isOpen())
-        return false;
-
-    Q_D(QOstDevice);
-    TInt err = d->ost.Connect();
-    if (!err) err = d->ost.Open();
-    const TVersion KRequiredVersion(1,1,0);
-    TVersion version = d->ost.Version();
-    if (version.iMajor < KRequiredVersion.iMajor ||
-            (version.iMajor == KRequiredVersion.iMajor && version.iMinor < KRequiredVersion.iMinor)) {
-        setErrorString("CODA version too old. At least version 4.0.18 (without TRK) is required.");
-        return false;
-    }
-
-    if (!err) err = d->ost.RegisterProtocolID((TOstProtIds)ostProtocolId, EFalse);
-    if (!err) {
-        d->ost.ReadMessage(d->iStatus, d->readBuf);
-        d->SetActive();
-        return QIODevice::open(ReadWrite | Unbuffered);
-    }
-    return false;
-}
-
-void QOstDevicePrivate::RunL()
-{
-    Q_Q(QOstDevice);
-    //qDebug("QOstDevice received %d bytes q=%x", readBuf.Size(), q);
-    if (iStatus == KErrNone) {
-        QByteArray data = QByteArray::fromRawData((const char*)readBuf.Ptr(), readBuf.Size());
-        dataBuf.append(data);
-
-        readBuf.Zero();
-        ost.ReadMessage(iStatus, readBuf);
-        SetActive();
-
-        if (!inReadyRead) {
-            inReadyRead = true;
-            emit q->readyRead();
-            inReadyRead = false;
-        }
-    } else {
-        q->setErrorString(QString("Error %1 from RUsbOstComm::ReadMessage()").arg(iStatus.Int()));
-    }
-    //qDebug("-QOstDevicePrivate RunL");
-}
-
-void QOstDevicePrivate::DoCancel()
-{
-    ost.ReadCancel();
-}
-
-void QOstDevice::close()
-{
-    Q_D(QOstDevice);
-    QIODevice::close();
-    d->Cancel();
-    // RDbgTrcComm::Close isn't safe to call when not open, sigh
-    if (d->ost.Handle()) {
-        d->ost.Close();
-    }
-}
-
-qint64 QOstDevice::readData(char *data, qint64 maxSize)
-{
-    Q_D(QOstDevice);
-    if (d->dataBuf.length() == 0 && !d->IsActive())
-        return -1;
-    qint64 available = qMin(maxSize, (qint64)d->dataBuf.length());
-    memcpy(data, d->dataBuf.constData(), available);
-    d->dataBuf.remove(0, available);
-    return available;
-}
-
-static const TInt KMaxOstPacketLen = 4096;
-
-qint64 QOstDevice::writeData(const char *data, qint64 maxSize)
-{
-    Q_D(QOstDevice);
-    TPtrC8 ptr((const TUint8*)data, (TInt)maxSize);
-    while (ptr.Length()) {
-        TPtrC8 fragment = ptr.Left(qMin(ptr.Length(), KMaxOstPacketLen));
-        //qDebug("QOstDevice writing %d bytes", fragment.Length());
-        TRequestStatus stat;
-        d->ost.WriteMessage(stat, fragment);
-        User::WaitForRequest(stat);
-        if (stat.Int() != KErrNone) {
-            setErrorString(QString("Error %1 from RUsbOstComm::WriteMessage()").arg(stat.Int()));
-            return -1;
-        }
-        ptr.Set(ptr.Mid(fragment.Length()));
-    }
-    emit bytesWritten(maxSize); //TODO does it matter this is emitted synchronously?
-    //qDebug("QOstDevice wrote %d bytes", ptr.Size());
-    return maxSize;
-}
-
-qint64 QOstDevice::bytesAvailable() const
-{
-    Q_D(const QOstDevice);
-    return d->dataBuf.length();
-}
-
-bool QOstDevice::waitForReadyRead(int msecs)
-{
-    Q_D(QOstDevice);
-    if (msecs >= 0) {
-        RTimer timer;
-        TInt err = timer.CreateLocal();
-        if (err) return false;
-        TRequestStatus timeoutStat;
-        timer.After(timeoutStat, msecs*1000);
-        User::WaitForRequest(timeoutStat, d->iStatus);
-        if (timeoutStat != KRequestPending) {
-            // Timed out
-            timer.Close();
-            return false;
-        } else {
-            // We got data, so cancel timer
-            timer.Cancel();
-            User::WaitForRequest(timeoutStat);
-            timer.Close();
-            // And drop through
-        }
-    } else {
-        // Just wait forever for data
-        User::WaitForRequest(d->iStatus);
-    }
-
-    // If we get here we have data
-    TInt err = d->iStatus.Int();
-    d->AoFlags() &= ~3; // This is necessary to clean up the scheduler as you're not supposed to bypass it like this
-    TRAP_IGNORE(d->RunL());
-    return err == KErrNone;
-}
diff --git a/src/plugins/qmltooling/qmldbg_ost/qostdevice.h b/src/plugins/qmltooling/qmldbg_ost/qostdevice.h
deleted file mode 100644 (file)
index 0ddcdb0..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia.  For licensing terms and
-** conditions see http://qt.digia.com/licensing.  For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file.  Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights.  These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.  Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QOSTDEVICE_H
-#define QOSTDEVICE_H
-
-#include <QtCore/QIODevice>
-
-QT_BEGIN_NAMESPACE
-
-class QOstDevicePrivate;
-
-class QOstDevice : public QIODevice
-{
-    Q_OBJECT
-    Q_DECLARE_PRIVATE(QOstDevice)
-    Q_DISABLE_COPY(QOstDevice)
-
-public:
-    explicit QOstDevice(QObject *parent=0);
-    ~QOstDevice();
-
-    bool open(int ostProtocolId);
-    void close();
-
-    bool waitForReadyRead(int msecs);
-    qint64 bytesAvailable() const;
-
-protected:
-    qint64 readData(char *data, qint64 maxSize);
-    qint64 writeData(const char *data, qint64 maxSize);
-
-private:
-    QOstDevicePrivate* d_ptr;
-};
-
-QT_END_NAMESPACE
-
-#endif // QOSTDEVICE_H
diff --git a/src/plugins/qmltooling/qmldbg_ost/usbostcomm.h b/src/plugins/qmltooling/qmldbg_ost/usbostcomm.h
deleted file mode 100644 (file)
index 6fa47bf..0000000
+++ /dev/null
@@ -1,191 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia.  For licensing terms and
-** conditions see http://qt.digia.com/licensing.  For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file.  Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights.  These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.  Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef USBHOSTCOMM_H
-#define USBHOSTCOMM_H
-
-// Based on the official usbostrouter header, modified to remove dependancy on
-// the client DLL
-
-#include <e32base.h>
-
-typedef int TOstProtIds;
-
-class RUsbOstComm : public RSessionBase
-{
-public:
-    RUsbOstComm();
-    TInt Connect();
-    TInt Disconnect();
-    TInt Open();
-    TInt Close();
-    TInt RegisterProtocolID(TOstProtIds aId, TBool aNeedHeader);
-    void ReadMessage(TRequestStatus& aStatus, TDes8& aDes);
-    TInt ReadCancel();
-    void WriteMessage(TRequestStatus& aStatus, const TDesC8& aDes, TBool aHasHeader=EFalse);
-    TVersion Version() const;
-
-private:
-    enum TUsbOstCmdCode
-    {
-        EUsbOstCmdCodeFirst,
-        EUsbOstCmdConnect,
-        EUsbOstCmdDisconnect,
-        EUsbOstCmdCodeGetAcmConfig,
-        EUsbOstCmdCodeSetAcmConfig,
-        EUsbOstCmdCodeOpen,
-        EUsbOstCmdCodeClose,
-        EUsbOstCmdCodeRegisterId,
-        EUsbOstCmdCodeRegisterIds,
-        EUsbOstCmdCodeUnRegisterId,
-        EUsbOstCmdCodeUnRegisterIds,
-        EUsbOstCmdCodeReadMsg,
-        EUsbOstCmdCodeReadCancel,
-        EUsbOstCmdCodeWriteMsg,
-        EUsbOstCmdCodeWriteCancel,
-        EUsbOstCmdCodeLast
-    };
-};
-
-RUsbOstComm::RUsbOstComm()
-{
-}
-
-TInt RUsbOstComm::Connect()
-{
-    _LIT(KUsbOstServerName, "!UsbOstRouter");
-    _LIT(KUsbOstServerImageName, "usbostrouter");
-    const TUid KUsbOstServerUid = { 0x200170BE };
-    TInt startupAttempts = 2;
-    for(;;) {
-        TInt ret = CreateSession(KUsbOstServerName, TVersion(1,0,0));
-        if (ret != KErrNotFound && ret != KErrServerTerminated) {
-            return ret;
-        }
-
-        if (startupAttempts-- == 0) {
-            return ret;
-        }
-
-        RProcess server;
-        ret = server.Create(KUsbOstServerImageName, KNullDesC, KUsbOstServerUid);
-        if (ret != KErrNone)
-            return ret;
-
-        TRequestStatus serverDiedRequestStatus;
-        server.Rendezvous(serverDiedRequestStatus);
-
-        if (serverDiedRequestStatus != KRequestPending) {
-            // Abort startup
-            server.Kill(KErrNone);
-        } else {
-            // Logon OK - start the server
-            server.Resume();
-        }
-        User::WaitForRequest(serverDiedRequestStatus);
-        ret = (server.ExitType() == EExitPanic) ? KErrGeneral : serverDiedRequestStatus.Int();
-        server.Close();
-
-        if (ret != KErrNone && ret != KErrAlreadyExists) {
-            return ret;
-        }
-    }
-}
-
-TInt RUsbOstComm::Disconnect()
-{
-    return SendReceive(EUsbOstCmdDisconnect);
-}
-
-TInt RUsbOstComm::Open()
-{
-    return SendReceive(EUsbOstCmdCodeOpen);
-}
-
-TInt RUsbOstComm::Close()
-{
-    TInt err = SendReceive(EUsbOstCmdCodeClose);
-    RHandleBase::Close();
-    return err;
-}
-
-TInt RUsbOstComm::RegisterProtocolID(const TOstProtIds aId, TBool aNeedHeader)
-{
-    TIpcArgs args(aId, aNeedHeader);
-    return SendReceive(EUsbOstCmdCodeRegisterId, args);
-}
-
-void RUsbOstComm::ReadMessage(TRequestStatus& aStatus, TDes8& aDes)
-{
-    TIpcArgs args(aDes.MaxLength(), &aDes);
-    SendReceive(EUsbOstCmdCodeReadMsg, args, aStatus);
-}
-
-TInt RUsbOstComm::ReadCancel()
-{
-    return SendReceive(EUsbOstCmdCodeReadCancel);
-}
-
-void RUsbOstComm::WriteMessage(TRequestStatus& aStatus, const TDesC8& aDes, TBool aHasHeader)
-{
-    TIpcArgs args(aHasHeader, aDes.Length(), &aDes);
-    SendReceive(EUsbOstCmdCodeWriteMsg, args, aStatus);
-}
-
-typedef TVersion (*TVersionFunction)(const RUsbOstComm*);
-const TInt KVersionOrdinal = 17;
-
-TVersion RUsbOstComm::Version() const
-{
-    // This function has to go to the DLL, unfortunately
-    TVersion result; // Return 0.0.0 on any error
-    RLibrary lib;
-    TInt err = lib.Load(_L("usbostcomm"));
-    if (err) return result;
-
-    TLibraryFunction fn = lib.Lookup(KVersionOrdinal);
-    if (fn)
-        result = ((TVersionFunction)fn)(this);
-    lib.Close();
-    return result;
-}
-
-#endif //USBHOSTCOMM_H