Commit 99172852 authored by Robert Loehning's avatar Robert Loehning
Browse files

Trk: Changed Launcher::handleResult so it can be used for running various processes on device.

Reviewed-by: Friedemann Kleint
parent b7a0dbfa
......@@ -254,9 +254,10 @@ void Launcher::handleResult(const TrkResult &result)
logMessage(prefix + "NAME: " + name);
*/
if (result.data.size() < 10)
break;
QByteArray ba;
appendInt(&ba, d->m_session.pid);
appendInt(&ba, d->m_session.tid);
ba.append(result.data.mid(2, 8));
d->m_device.sendTrkMessage(TrkContinue, TrkCallback(), ba, "CONTINUE");
//d->m_device.sendTrkAck(result.token)
break;
......@@ -269,7 +270,9 @@ void Launcher::handleResult(const TrkResult &result)
arg(QString::fromAscii(prefix)).arg(itemType ? QLatin1String("LIB") : QLatin1String("PROCESS")).
arg(name));
d->m_device.sendTrkAck(result.token);
if (itemType == 0) { // process
if (itemType == 0 // process
&& result.data.size() >= 10
&& d->m_session.pid == extractInt(result.data.data() + 6)) {
d->m_device.sendTrkMessage(TrkDisconnect, TrkCallback(this, &Launcher::waitForTrkFinished));
}
break;
......@@ -554,7 +557,7 @@ void Launcher::startInferiorIfNeeded()
// It's not started yet
QByteArray ba;
appendByte(&ba, 0); // ?
appendByte(&ba, 0); // ?
appendByte(&ba, 0); // create new process
appendByte(&ba, 0); // ?
appendString(&ba, d->m_fileName.toLocal8Bit(), TargetByteOrder);
d->m_device.sendTrkMessage(TrkCreateItem, TrkCallback(this, &Launcher::handleCreateProcess), ba); // Create Item
......
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