Activated downloading of json to device

This commit is contained in:
Gerhard Hoffmann 2023-11-21 15:25:20 +01:00
parent 4372cb578b
commit f6a8059e2d

View File

@ -244,10 +244,10 @@ bool Update::isSerialOpen() const {
// bootloader is really not running anymore. // bootloader is really not running anymore.
*/ */
bool Update::updateBinary(QString const &fileToSendToDC) { bool Update::updateBinary(QString const &fileToSendToDC) {
qInfo() << "UPDATING DEVICE CONTROLLER FIRMWARE BINARY" << fileToSendToDC;
return false; return false;
qInfo() << "UPDATING DEVICE CONTROLLER FIRMWARE BINARY" << fileToSendToDC;
QFile fn(fileToSendToDC); QFile fn(fileToSendToDC);
if (!fn.exists()) { if (!fn.exists()) {
// output via CONSOLE() etc // output via CONSOLE() etc
@ -334,15 +334,6 @@ bool Update::downloadJson(enum FileTypeJson type,
int templateIdx, int templateIdx,
QString jsFileToSendToDC) const { QString jsFileToSendToDC) const {
// Utils::printInfoMsg(
// QString("UPDATING JSON-FILE=%1, TEMPLATE-INDEX=%2, JSON-TYPE=%3")
// .arg(jsFileToSendToDC)
// .arg(templateIdx)
// .arg(jsonType(type)));
//
// return true;
m_hw->dc_autoRequest(true); // downloading Json needs the AutoEmission flag m_hw->dc_autoRequest(true); // downloading Json needs the AutoEmission flag
qDebug() << "SET AUTO-REQUEST=TRUE"; qDebug() << "SET AUTO-REQUEST=TRUE";
QThread::sleep(1); // make sure the auto-request flag is acknowledged QThread::sleep(1); // make sure the auto-request flag is acknowledged
@ -371,7 +362,25 @@ bool Update::downloadJson(enum FileTypeJson type,
if (m_hw->sys_sendJsonFileToDc((uint8_t)(type), if (m_hw->sys_sendJsonFileToDc((uint8_t)(type),
templateIdx, templateIdx,
(uint8_t *)ba.data())) { (uint8_t *)ba.data())) {
QThread::sleep(1);
QThread::msleep(1000);
// testing
//m_hw->request_ReadbackMachineID();
//QThread::msleep(500);
//uint8_t data[64];
//memset(data, 0x00, sizeof(data));
//uint8_t length = 0;
//m_hw->readback_machineIDdata(&length, data);
//QThread::msleep(500);
//QByteArray ba((const char*)data, length);
//qCritical() << length << "MACHINE ID =" << ba.toHex(':');
ret = true; ret = true;
} }
} else { } else {