Commit 3e75e77f authored by Pawel Polanski's avatar Pawel Polanski
Browse files

CODA: Fixed problem with CODA not responding at first communication attempt

parent 8a1fc042
......@@ -186,6 +186,7 @@ void CodaRunControl::slotSerialPong(const QString &message)
{
if (debug > 1)
qDebug() << "CODA serial pong:" << message;
handleConnected();
}
void CodaRunControl::slotCodaEvent(const CodaEvent &event)
......@@ -194,13 +195,9 @@ void CodaRunControl::slotCodaEvent(const CodaEvent &event)
qDebug() << "CODA event:" << "Type:" << event.type() << "Message:" << event.toString();
switch (event.type()) {
case CodaEvent::LocatorHello: { // Commands accepted now
m_state = StateConnected;
appendMessage(tr("Connected."), NormalMessageFormat);
setProgress(maxProgress()*0.80);
initCommunication();
}
break;
case CodaEvent::LocatorHello:
handleConnected();
break;
case CodaEvent::RunControlContextRemoved:
handleContextRemoved(event);
break;
......@@ -230,6 +227,16 @@ void CodaRunControl::initCommunication()
m_codaDevice->sendLoggingAddListenerCommand(CodaCallback(this, &CodaRunControl::handleAddListener));
}
void CodaRunControl::handleConnected()
{
if (m_state >= StateConnected)
return;
m_state = StateConnected;
appendMessage(tr("Connected."), NormalMessageFormat);
setProgress(maxProgress()*0.80);
initCommunication();
}
void CodaRunControl::handleContextRemoved(const CodaEvent &event)
{
const QVector<QByteArray> removedItems
......
......@@ -86,6 +86,7 @@ private slots:
private:
void initCommunication();
void handleConnected();
void handleModuleLoadSuspended(const Coda::CodaEvent &event);
void handleContextSuspended(const Coda::CodaEvent &event);
void handleContextAdded(const Coda::CodaEvent &event);
......
......@@ -200,9 +200,6 @@ bool S60DeployStep::init()
return true;
}
if (debug)
m_launcher->setVerbose(debug);
// Prompt the user to start up the Bluetooth connection
const trk::PromptStartCommunicationResult src =
S60RunConfigBluetoothStarter::startCommunication(m_launcher->trkDevice(),
......@@ -466,6 +463,7 @@ void S60DeployStep::slotSerialPong(const QString &message)
{
if (debug)
qDebug() << "CODA serial pong:" << message;
handleConnected();
}
void S60DeployStep::slotCodaEvent(const Coda::CodaEvent &event)
......@@ -474,12 +472,9 @@ void S60DeployStep::slotCodaEvent(const Coda::CodaEvent &event)
qDebug() << "CODA event:" << "Type:" << event.type() << "Message:" << event.toString();
switch (event.type()) {
case Coda::CodaEvent::LocatorHello: {// Commands accepted now
m_state = StateConnected;
emit codaConnected();
startTransferring();
case Coda::CodaEvent::LocatorHello:
handleConnected();
break;
}
default:
if (debug)
qDebug() << "Unhandled event:" << "Type:" << event.type() << "Message:" << event.toString();
......@@ -487,6 +482,15 @@ void S60DeployStep::slotCodaEvent(const Coda::CodaEvent &event)
}
}
void S60DeployStep::handleConnected()
{
if (m_state >= StateConnected)
return;
m_state = StateConnected;
emit codaConnected();
startTransferring();
}
void S60DeployStep::initFileSending()
{
QTC_ASSERT(m_currentFileIndex < m_signedPackages.count(), return);
......@@ -639,7 +643,6 @@ void S60DeployStep::checkForTimeout()
{
if (m_state != StateConnecting)
return;
QMessageBox *mb = CodaRunControl::createCodaWaitingMessageBox(Core::ICore::instance()->mainWindow());
connect(this, SIGNAL(codaConnected()), mb, SLOT(close()));
connect(this, SIGNAL(finished()), mb, SLOT(close()));
......
......@@ -167,6 +167,7 @@ private:
void appendMessage(const QString &error, bool isError);
void reportError(const QString &error);
void handleConnected();
void handleSymbianInstall(const Coda::CodaCommandResult &result);
void handleFileSystemOpen(const Coda::CodaCommandResult &result);
void handleFileSystemWrite(const Coda::CodaCommandResult &result);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment