/** * Constructor */ UAVTalk::UAVTalk(QIODevice* iodev, UAVObjectManager* objMngr) { io = iodev; this->objMngr = objMngr; rxState = STATE_SYNC; rxPacketLength = 0; mutex = new QMutex(QMutex::Recursive); memset(&stats, 0, sizeof(ComStats)); connect(io, SIGNAL(readyRead()), this, SLOT(processInputStream())); ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); Core::Internal::GeneralSettings * settings=pm->getObject<Core::Internal::GeneralSettings>(); useUDPMirror=settings->useUDPMirror(); qDebug()<<"[uavtalk.cpp] Use UDP: "<<useUDPMirror; if(useUDPMirror) { udpSocketTx=new QUdpSocket(this); udpSocketRx=new QUdpSocket(this); udpSocketTx->bind(9000); udpSocketRx->connectToHost(QHostAddress::LocalHost,9000); connect(udpSocketTx,SIGNAL(readyRead()),this,SLOT(dummyUDPRead())); connect(udpSocketRx,SIGNAL(readyRead()),this,SLOT(dummyUDPRead())); } }
void CSharpInstanceManager::syncCSharpInstance(CSharpInstance *instance, const char *in, char **out) { engine::sys::waitAndTakeMutex(instanceProcessingMutex); processInputStream(instance, in); //Processing done, lets get the streams and build a message back! processOutputStream(instance, out); engine::sys::releaseMutex(instanceProcessingMutex); }
/** * Constructor */ UAVTalk::UAVTalk(QIODevice* iodev, UAVObjectManager* objMngr) { io = iodev; this->objMngr = objMngr; rxState = STATE_SYNC; rxPacketLength = 0; mutex = new QMutex(QMutex::Recursive); respObj = NULL; memset(&stats, 0, sizeof(ComStats)); connect(io, SIGNAL(readyRead()), this, SLOT(processInputStream())); }