Commit 81ea5bb9 authored by Dennis Rassmann's avatar Dennis Rassmann

flasher: add waiting phase for flash bootimg

Signed-off-by: Dennis Rassmann's avatarshowp1984 <showp1984@gmail.com>
parent 1bc34a4b
......@@ -589,45 +589,75 @@ int flasher::reboot_fastboot(void)
int flasher::flash_boot(void)
{
ui->txt_out->append("Flashing boot.img...");
QDirIterator it(QString(abstemppath), QDirIterator::Subdirectories);
while (it.hasNext()) {
if (it.next().contains("boot.img") && !it.next().isEmpty()) {
p.terminate();
p_out = "";
#ifdef Q_WS_X11
p.start( "tools/fastboot -d " + device + " flash boot " + it.next());
#endif
#ifdef Q_WS_MAC
p.start( "tools/fastboot-mac -d " + device + " flash boot " + it.next());
#endif
#ifdef Q_WS_WIN
p.start( "tools\\fastboot.exe -d " + device + " flash boot " + it.next());
#endif
p.waitForFinished(-1);
p_out = p.readAllStandardOutput();
if (!p_out.isEmpty()) {
ui->txt_out->append(p_out);
}
}
}
ui->txt_out->append("boot.img flashed...");
ui->txt_out->append("Rebooting device...");
ui->txt_out->append("< Waiting for your device >");
flashtimer->setInterval(6000);
p.terminate();
p_out = "";
snr = "";
state = "";
#ifdef Q_WS_X11
p.start( "tools/fastboot -d " + device + " reboot");
p.start( "tools/fastboot devices" );
#endif
#ifdef Q_WS_MAC
p.start( "tools/fastboot-mac -d " + device + " reboot");
p.start( "tools/fastboot-mac devices" );
#endif
#ifdef Q_WS_WIN
p.start( "tools\\fastboot.exe -d " + device + " reboot");
p.start( "tools\\fastboot.exe devices" );
#endif
p.waitForFinished(-1);
p_out = p.readAllStandardOutput();
if (!p_out.isEmpty()) {
ui->txt_out->append(p_out);
list3 = p_out.split("\t");
if ((!list3.isEmpty()) && (list3.count() > 1)) {
snr = list3[0];
state = list3[1];
}
}
return RELEASE_CONTROLS;
if (!snr.isEmpty() && !state.isEmpty()) {
flashtimer->setInterval(1000);
ui->txt_out->append("Flashing boot.img...");
QDirIterator it(QString(abstemppath), QDirIterator::Subdirectories);
while (it.hasNext()) {
if (it.next().contains("boot.img") && !it.next().isEmpty()) {
p.terminate();
p_out = "";
#ifdef Q_WS_X11
p.start( "tools/fastboot -p " + device + " flash boot " + "'" + it.next() + "'");
#endif
#ifdef Q_WS_MAC
p.start( "tools/fastboot-mac -p " + device + " flash boot " + "'" + it.next() + "'");
#endif
#ifdef Q_WS_WIN
p.start( "tools\\fastboot.exe -p " + device + " flash boot " + "\"" + it.next() + "\"");
#endif
p.waitForFinished(-1);
p_out = p.readAllStandardOutput();
qDebug() << p_out;
if (!p_out.isEmpty()) {
ui->txt_out->append(p_out);
}
}
}
ui->txt_out->append("boot.img flashed...");
ui->txt_out->append("Rebooting device...");
p.terminate();
p_out = "";
#ifdef Q_WS_X11
p.start( "tools/fastboot -p " + device + " reboot");
#endif
#ifdef Q_WS_MAC
p.start( "tools/fastboot-mac -p " + device + " reboot");
#endif
#ifdef Q_WS_WIN
p.start( "tools\\fastboot.exe -p " + device + " reboot");
#endif
p.waitForFinished(-1);
p_out = p.readAllStandardOutput();
if (!p_out.isEmpty()) {
ui->txt_out->append(p_out);
}
return RELEASE_CONTROLS;
}
flashtimer->setInterval(6000);
return FLASH_BOOTIMG;
}
/****************************************************************************
** Meta object code from reading C++ file 'detect.h'
**
** Created: Mon Jul 2 10:30:39 2012
** Created: Mon Jul 2 10:56:40 2012
** by: The Qt Meta Object Compiler version 62 (Qt 4.6.2)
**
** WARNING! All changes made in this file will be lost!
......
/****************************************************************************
** Meta object code from reading C++ file 'dragons.h'
**
** Created: Mon Jul 2 10:30:37 2012
** Created: Mon Jul 2 10:56:38 2012
** by: The Qt Meta Object Compiler version 62 (Qt 4.6.2)
**
** WARNING! All changes made in this file will be lost!
......
/****************************************************************************
** Meta object code from reading C++ file 'flasher.h'
**
** Created: Mon Jul 2 10:30:40 2012
** Created: Mon Jul 2 10:56:42 2012
** by: The Qt Meta Object Compiler version 62 (Qt 4.6.2)
**
** WARNING! All changes made in this file will be lost!
......
/****************************************************************************
** Meta object code from reading C++ file 'info.h'
**
** Created: Mon Jul 2 01:03:25 2012
** Created: Mon Jul 2 10:56:40 2012
** by: The Qt Meta Object Compiler version 62 (Qt 4.6.2)
**
** WARNING! All changes made in this file will be lost!
......
/****************************************************************************
** Meta object code from reading C++ file 'mainwindow.h'
**
** Created: Mon Jul 2 10:30:35 2012
** Created: Mon Jul 2 10:56:37 2012
** by: The Qt Meta Object Compiler version 62 (Qt 4.6.2)
**
** WARNING! All changes made in this file will be lost!
......
/****************************************************************************
** Meta object code from reading C++ file 'openfile.h'
**
** Created: Mon Jul 2 10:30:42 2012
** Created: Mon Jul 2 10:56:43 2012
** by: The Qt Meta Object Compiler version 62 (Qt 4.6.2)
**
** WARNING! All changes made in this file will be lost!
......
/****************************************************************************
** Meta object code from reading C++ file 'quazipfile.h'
**
** Created: Mon Jul 2 05:23:23 2012
** Created: Mon Jul 2 10:56:36 2012
** by: The Qt Meta Object Compiler version 62 (Qt 4.6.2)
**
** WARNING! All changes made in this file will be lost!
......
/****************************************************************************
** Resource object code
**
** Created: Mon Jul 2 05:23:31 2012
** Created: Mon Jul 2 10:56:45 2012
** by: The Resource Compiler for Qt version 4.6.2
**
** WARNING! All changes made in this file will be lost!
......
/********************************************************************************
** Form generated from reading UI file 'detect.ui'
**
** Created: Mon Jul 2 01:03:12 2012
** Created: Mon Jul 2 10:56:24 2012
** by: Qt User Interface Compiler version 4.6.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
......
/********************************************************************************
** Form generated from reading UI file 'dragons.ui'
**
** Created: Mon Jul 2 01:03:12 2012
** Created: Mon Jul 2 10:56:24 2012
** by: Qt User Interface Compiler version 4.6.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
......
/********************************************************************************
** Form generated from reading UI file 'flasher.ui'
**
** Created: Mon Jul 2 04:54:39 2012
** Created: Mon Jul 2 10:56:24 2012
** by: Qt User Interface Compiler version 4.6.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
......
/********************************************************************************
** Form generated from reading UI file 'info.ui'
**
** Created: Mon Jul 2 01:03:12 2012
** Created: Mon Jul 2 10:56:24 2012
** by: Qt User Interface Compiler version 4.6.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
......
/********************************************************************************
** Form generated from reading UI file 'mainwindow.ui'
**
** Created: Mon Jul 2 01:03:12 2012
** Created: Mon Jul 2 10:56:24 2012
** by: Qt User Interface Compiler version 4.6.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
......
/********************************************************************************
** Form generated from reading UI file 'openfile.ui'
**
** Created: Mon Jul 2 01:03:12 2012
** Created: Mon Jul 2 10:56:24 2012
** by: Qt User Interface Compiler version 4.6.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
......
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