From ca5e43e0d78453623a0f9063a51cfd277932d063 Mon Sep 17 00:00:00 2001 From: Siegfried Siegert Date: Fri, 19 May 2023 15:34:28 +0200 Subject: [PATCH] Add debug output --- src/com.cpp | 2 +- src/datIf.cpp | 10 ++++++++-- src/hwapi.cpp | 2 ++ src/prot.cpp | 6 +++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/com.cpp b/src/com.cpp index 01f9292..8c28383 100644 --- a/src/com.cpp +++ b/src/com.cpp @@ -19,7 +19,7 @@ void T_com::writeToSerial(const QByteArray &data, uint16_t sendLength) sendLen=sendLength; if (CatSerial->isOpen()) { - //qDebug() << "sending..." << sendBuffer; + qCritical() << "sending..." << sendBuffer; CatSerial->write(sendBuffer); } else qDebug() << "error sending, port is not open"; diff --git a/src/datIf.cpp b/src/datIf.cpp index 14709de..2e87c3d 100644 --- a/src/datIf.cpp +++ b/src/datIf.cpp @@ -887,14 +887,20 @@ char T_datif::loadRecDataFromFrame() ret=myDCIF->getReceivedInData(&SlaveAdr, &readSource, &readAddress, &RdDleng, receivedData); // retval: data valid, only one time true, true if CommandState OK and readState OK gpi_storeResultOfLastRequest(ret); + + + qCritical() << "loadRecDataFromFrame() readSource = " << readSource; + if (ret==false) { - // qDebug() << "datif: rec data not valid"; + qCritical() << "datif: rec data not valid"; return 0; } gpi_storeRecPayLoad(RdDleng, receivedData); // save for host (user of hwapi) + + qCritical() << "loadRecDataFromFrame() readSource = " << readSource; //qDebug() << "\n datif: got valid data, rdsrc:" << readSource << " rdadd:" << readAddress // << " rdlen:" << RdDleng; // qDebug("datif_recData: %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d ", @@ -1212,7 +1218,7 @@ char T_datif::loadRecDataFromFrame() break; case CMD2DC_EMP_GET_ALL: //23 - //qDebug() << "got emp parameters "<< receivedData[1]; + qCritical() << "got emp parameters "<< receivedData[1]; gpi_storeEmpSettings(64, receivedData); break; diff --git a/src/hwapi.cpp b/src/hwapi.cpp index d1d7da3..b41c27d 100644 --- a/src/hwapi.cpp +++ b/src/hwapi.cpp @@ -3703,6 +3703,8 @@ uint8_t hwapi::cash_paymentProcessing(void) const // 90: stop all, 1s delay // 99: off, all stopped + //qCritical() << "empState = " << empState; + sys_getDynMachineConditions(&myDynMachCond); payInProg= myDynMachCond.paymentInProgress; // 0: stopped by timeout diff --git a/src/prot.cpp b/src/prot.cpp index 95a40aa..a63c092 100644 --- a/src/prot.cpp +++ b/src/prot.cpp @@ -433,7 +433,8 @@ uint8_t recBuffer[FRAME_MAXLEN]; // read from "VCP": mySerialPort->readFromSerial(Indata, recLength); -//qDebug()<<"prot: got data " << recLength; + qCritical()<<"prot: got data " << recLength; + qCritical()<<" Indata: " << Indata; if (recLength>FRAME_MAXLEN) recLength=FRAME_MAXLEN; for (int nn=0; nn