void S60DeviceRunConfigurationWidget::setSerialPort(int index) { const SymbianUtils::SymbianDevice d = device(index); m_runConfiguration->setSerialPortName(d.portName()); m_deviceInfoButton->setEnabled(index >= 0); clearDeviceInfo(); }
void SymbianIDeviceConfigurationWidget::updateDeviceInfo() { setDeviceInfoLabel(tr("Connecting")); if (symbianDevice()->communicationChannel() == SymbianIDevice::CommunicationCodaSerialConnection) { const SymbianUtils::SymbianDevice commDev = currentRawDevice(); m_codaInfoDevice = SymbianUtils::SymbianDeviceManager::instance()->getCodaDevice(commDev.portName()); if (m_codaInfoDevice.isNull()) { setDeviceInfoLabel(tr("Unable to create CODA connection. Please try again."), true); return; } if (!m_codaInfoDevice->device()->isOpen()) { setDeviceInfoLabel(m_codaInfoDevice->device()->errorString(), true); return; } //TODO error handling - for now just throw the command at coda m_codaInfoDevice->sendSymbianOsDataGetQtVersionCommand(Coda::CodaCallback(this, &SymbianIDeviceConfigurationWidget::getQtVersionCommandResult)); m_deviceInfoButton->setEnabled(false); m_codaTimeout->start(1000); } else if (symbianDevice()->communicationChannel() == SymbianIDevice::CommunicationCodaTcpConnection) { // collectingInfoFinished, which deletes m_codaDevice, can get called from within a coda callback, so need to use deleteLater m_codaInfoDevice = QSharedPointer<Coda::CodaDevice>(new Coda::CodaDevice, &QObject::deleteLater); connect(m_codaInfoDevice.data(), SIGNAL(codaEvent(Coda::CodaEvent)), this, SLOT(codaEvent(Coda::CodaEvent))); const QSharedPointer<QTcpSocket> codaSocket(new QTcpSocket); m_codaInfoDevice->setDevice(codaSocket); codaSocket->connectToHost(symbianDevice()->address(), symbianDevice()->port().toInt()); m_deviceInfoButton->setEnabled(false); m_codaTimeout->start(1500); } else setDeviceInfoLabel(tr("Currently there is no information about the device for this connection type."), true); }
void S60DeployConfigurationWidget::updateDeviceInfo() { //TODO: No CODA device info! Implement it when it is available if (m_deployConfiguration->communicationChannel() == S60DeployConfiguration::CommunicationTrkSerialConnection) { QTC_ASSERT(!m_infoLauncher, return) setDeviceInfoLabel(tr("Connecting...")); // Do a launcher run with the ping protocol. Prompt to connect and // go asynchronous afterwards to pop up launch trk box if a timeout occurs. QString message; const SymbianUtils::SymbianDevice commDev = currentDevice(); m_infoLauncher = trk::Launcher::acquireFromDeviceManager(commDev.portName(), this, &message); if (!m_infoLauncher) { setDeviceInfoLabel(message, true); return; } connect(m_infoLauncher, SIGNAL(stateChanged(int)), this, SLOT(slotLauncherStateChanged(int))); m_infoLauncher->setSerialFrame(commDev.type() == SymbianUtils::SerialPortCommunication); m_infoLauncher->setTrkServerName(commDev.portName()); // Prompt user const trk::PromptStartCommunicationResult src = S60RunConfigBluetoothStarter::startCommunication(m_infoLauncher->trkDevice(), this, &message); switch (src) { case trk::PromptStartCommunicationConnected: break; case trk::PromptStartCommunicationCanceled: clearDeviceInfo(); m_infoLauncher->deleteLater(); return; case trk::PromptStartCommunicationError: setDeviceInfoLabel(message, true); m_infoLauncher->deleteLater(); return; }; if (!m_infoLauncher->startServer(&message)) { setDeviceInfoLabel(message, true); m_infoLauncher->deleteLater(); return; } // Wait for either timeout or results m_deviceInfoButton->setEnabled(false); } else
{ if (m_infoLauncher && m_infoLauncher->state() == trk::Launcher::WaitingForTrk) { m_infoLauncher->deleteLater(); clearDeviceInfo(); m_deviceInfoButton->setEnabled(true); } } void S60DeviceRunConfigurationWidget::updateDeviceInfo() { QTC_ASSERT(!m_infoLauncher, return) setDeviceInfoLabel(tr("Connecting...")); // Do a launcher run with the ping protocol. Prompt to connect and // go asynchronous afterwards to pop up launch trk box if a timeout occurs. QString message; const SymbianUtils::SymbianDevice commDev = currentDevice(); m_infoLauncher = trk::Launcher::acquireFromDeviceManager(commDev.portName(), this, &message); if (!m_infoLauncher) { setDeviceInfoLabel(message, true); return; } connect(m_infoLauncher, SIGNAL(stateChanged(int)), this, SLOT(slotLauncherStateChanged(int))); m_infoLauncher->setSerialFrame(commDev.type() == SymbianUtils::SerialPortCommunication); m_infoLauncher->setTrkServerName(commDev.portName()); // Prompt user const trk::PromptStartCommunicationResult src = S60RunConfigBluetoothStarter::startCommunication(m_infoLauncher->trkDevice(), this, &message); switch (src) { case trk::PromptStartCommunicationConnected: