diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro index 42030a914af99416cd88eaa85fe1c1f5124cec75..66e4ceccd52ef1bba3cce3dac468827fc5df10c0 100644 --- a/qgroundcontrol.pro +++ b/qgroundcontrol.pro @@ -212,7 +212,7 @@ RESOURCES = mavground.qrc # Include RT-LAB Library win32 { - LIBS += C:\OPAL-RT\RT-LAB7.2.4\Common\lib\OpalApi.lib + LIBS += -LC:\OPAL-RT\RT-LAB7.2.4\Common\bin -lOpalApi INCLUDEPATH += src/lib/opalrt SOURCES += src/comm/OpalLink.cc HEADERS += src/comm/OpalLink.h diff --git a/src/comm/OpalLink.cc b/src/comm/OpalLink.cc index f4a05456a561b049048d5b2eaf7bee8f1be91454..39eff001ea66539836358ed621f6f12229944f81 100644 --- a/src/comm/OpalLink.cc +++ b/src/comm/OpalLink.cc @@ -80,7 +80,8 @@ bool OpalLink::isFullDuplex() bool OpalLink::connect() { - return false; + short modelState; + OpalConnect(101, true, &modelState); } bool OpalLink::disconnect() @@ -92,3 +93,14 @@ qint64 OpalLink::bytesAvailable() { return 0; } + +void OpalLink::writeBytes(const char *bytes, qint64 length) +{ + +} + + +void OpalLink::readBytes(char *bytes, qint64 maxLength) +{ + +} diff --git a/src/comm/OpalLink.h b/src/comm/OpalLink.h index 188f06ae54dd6fba29ddebbcf2f71cf33d197967..560d5c14974dc44e9b2054d7a83d2a290db08918 100644 --- a/src/comm/OpalLink.h +++ b/src/comm/OpalLink.h @@ -13,6 +13,9 @@ #include "LinkManager.h" #include "MG.h" +#include "errno.h" +#include "OpalApi.h" + class OpalLink : public LinkInterface { Q_OBJECT @@ -47,29 +50,11 @@ class OpalLink : public LinkInterface public slots: - virtual void writeBytes(const char *bytes, qint64 length) = 0; - - - virtual void readBytes(char *bytes, qint64 maxLength) = 0; - -signals: - - void bytesReady(LinkInterface* link); - - - void bytesReceived(LinkInterface* link, QByteArray data); - - - void connected(); - - - void disconnected(); - + void writeBytes(const char *bytes, qint64 length); - void connected(bool connected); + void readBytes(char *bytes, qint64 maxLength); - void nameChanged(QString name); public: OpalLink();