|
|
|
@ -6,10 +6,12 @@ History:
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
#include "datIf.h"
|
|
|
|
|
#include "hwapi.h"
|
|
|
|
|
#include "sendWRcmd.h"
|
|
|
|
|
#include "controlBus.h"
|
|
|
|
|
#include "storeINdata.h"
|
|
|
|
|
#include <QDebug>
|
|
|
|
|
#include <QDateTime>
|
|
|
|
|
#include <datei.h>
|
|
|
|
|
#include <QDir>
|
|
|
|
|
|
|
|
|
@ -91,6 +93,8 @@ T_datif::T_datif(QObject *parent) : QObject(parent)
|
|
|
|
|
epi_resetDcDataValid(1); // data are not yet valid, no response from DC by now
|
|
|
|
|
|
|
|
|
|
datif_noResponseCtr=0;
|
|
|
|
|
datif_nowNewDyns=0;
|
|
|
|
|
datif_nowNewStats=0;
|
|
|
|
|
|
|
|
|
|
datif_repeatCtr=0;
|
|
|
|
|
datif_cmdWasPerformed=0; // 0: no response by now
|
|
|
|
@ -122,6 +126,7 @@ T_datif::T_datif(QObject *parent) : QObject(parent)
|
|
|
|
|
datif_pNextCmd=0;
|
|
|
|
|
datif_sendSlowCmd=0;
|
|
|
|
|
|
|
|
|
|
readCount = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void T_datif::resetChain(void)
|
|
|
|
@ -151,13 +156,24 @@ char T_datif::datif_cycleSend()
|
|
|
|
|
{
|
|
|
|
|
//qDebug() << "com port not available"; // wird ununterbrochen ausgegeben
|
|
|
|
|
epi_resetDcDataValid(2); // DC data not valid
|
|
|
|
|
datif_nowNewDyns=0;
|
|
|
|
|
datif_nowNewStats=0;
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// supervise if DC data are valid
|
|
|
|
|
datif_noResponseCtr++; // inc every 20ms
|
|
|
|
|
if (datif_noResponseCtr>250) // no life sign from device controller (DC) for about 3s
|
|
|
|
|
if (datif_noResponseCtr>50) // no life sign from device controller (DC) for about a sec
|
|
|
|
|
{
|
|
|
|
|
epi_resetDcDataValid(3); // DC data has not updated for >=5s -> no longer valid!
|
|
|
|
|
datif_nowNewDyns=0;
|
|
|
|
|
datif_nowNewStats=0;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// 24.7.24 new, data are valid if dynamic machine conditions AND dyn machine states came in
|
|
|
|
|
if (datif_nowNewDyns && datif_nowNewStats && !epi_areDcDataValid() )
|
|
|
|
|
epi_setDcDataValid();
|
|
|
|
|
|
|
|
|
|
// Ueberwachung ob ein oder mehrere Commands am Stueck erfolgreich waren
|
|
|
|
|
if (gpi_wantToResetSupervision())
|
|
|
|
@ -360,6 +376,9 @@ char T_datif::datif_cycleSend()
|
|
|
|
|
{
|
|
|
|
|
dif_scanStep=0; // always start from beginning
|
|
|
|
|
epi_resetDcDataValid(4);
|
|
|
|
|
datif_nowNewDyns=0;
|
|
|
|
|
datif_nowNewStats=0;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
datif_cmdWasPerformed=0; // 0: no response by now
|
|
|
|
@ -384,7 +403,7 @@ char T_datif::sendINrequestsAutomatic(void)
|
|
|
|
|
uint8_t datif_maxNrCommands=35, datif_sendNow;
|
|
|
|
|
|
|
|
|
|
// send quicker while transaction is ongoing:
|
|
|
|
|
uint8_t datif_vendRequCommandList[15]={102,107,108,110,112,115,116,31,32,40,41,42,23,0,0};
|
|
|
|
|
uint8_t datif_vendRequCommandList[15]={102,107,108,110,112,115,116,30,31,32,40,41,42,23,0};
|
|
|
|
|
uint8_t datif_maxVendingCmds=13;
|
|
|
|
|
|
|
|
|
|
// special commands:
|
|
|
|
@ -464,6 +483,76 @@ void T_datif::StoredRecData()
|
|
|
|
|
gpi_storeLastResult(res);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void dump(T_moduleCondition const *modCond) {
|
|
|
|
|
qCritical() << QString("modCond->ram %1 (%2)").arg(modCond->ram).arg(modCond->ram, 0, 16);
|
|
|
|
|
qCritical() << QString("modCond->intEe %1 (%2)").arg(modCond->intEe).arg(modCond->intEe, 0, 16);
|
|
|
|
|
qCritical() << QString("modCond->extEe %1 (%2)").arg(modCond->extEe).arg(modCond->extEe, 0, 16);
|
|
|
|
|
qCritical() << QString("modCond->rtc %1 (%2)").arg(modCond->rtc).arg(modCond->rtc, 0, 16);
|
|
|
|
|
qCritical() << QString("modCond->boardHw %1 (%2)").arg(modCond->boardHw).arg(modCond->boardHw, 0, 16);
|
|
|
|
|
qCritical() << QString("modCond->printer %1 (%2)").arg(modCond->printer).arg(modCond->printer, 0, 16);
|
|
|
|
|
qCritical() << QString("modCond->modem %1 (%2)").arg(modCond->modem).arg(modCond->modem, 0, 16);
|
|
|
|
|
qCritical() << QString("modCond->signal %1 (%2)").arg(modCond->signal).arg(modCond->signal, 0, 16);
|
|
|
|
|
|
|
|
|
|
qCritical() << QString("modCond->regist %1 (%2)").arg(modCond->regist).arg(modCond->regist, 0, 16);
|
|
|
|
|
qCritical() << QString("modCond->mdbBus %1 (%2)").arg(modCond->mdbBus).arg(modCond->mdbBus, 0, 16);
|
|
|
|
|
qCritical() << QString("modCond->coinChecker %1 (%2)").arg(modCond->coinChecker).arg(modCond->coinChecker, 0, 16);
|
|
|
|
|
qCritical() << QString("modCond->coinEscrow %1 (%2)").arg(modCond->coinEscrow).arg(modCond->coinEscrow, 0, 16);
|
|
|
|
|
|
|
|
|
|
qCritical() << QString("modCond->mifareReader %1 (%2)").arg(modCond->mifareReader).arg(modCond->mifareReader, 0, 16);
|
|
|
|
|
qCritical() << QString("modCond->creditTerm %1 (%2)").arg(modCond->creditTerm).arg(modCond->creditTerm, 0, 16);
|
|
|
|
|
qCritical() << QString("modCond->coinReject %1 (%2)").arg(modCond->coinReject).arg(modCond->coinReject, 0, 16);
|
|
|
|
|
qCritical() << QString("modCond->coinSafe %1 (%2)").arg(modCond->coinSafe).arg(modCond->coinSafe, 0, 16);
|
|
|
|
|
|
|
|
|
|
qCritical() << QString("modCond->billSafe %1 (%2)").arg(modCond->billSafe).arg(modCond->billSafe, 0, 16);
|
|
|
|
|
qCritical() << QString("modCond->voltage %1 (%2)").arg(modCond->voltage).arg(modCond->voltage, 0, 16);
|
|
|
|
|
qCritical() << QString("modCond->temper %1 (%2)").arg(modCond->temper).arg(modCond->temper, 0, 16);
|
|
|
|
|
qCritical() << QString("modCond->poweronTest %1 (%2)").arg(modCond->poweronTest).arg(modCond->poweronTest, 0, 16);
|
|
|
|
|
|
|
|
|
|
qCritical() << QString("modCond->doorState %1 (%2)").arg(modCond->doorState).arg(modCond->doorState, 0, 16);
|
|
|
|
|
qCritical() << QString("modCond->doorWasOpened %1 (%2)").arg(modCond->doorWasOpened).arg(modCond->doorWasOpened, 0, 16);
|
|
|
|
|
qCritical() << QString("modCond->changer %1 (%2)").arg(modCond->changer).arg(modCond->changer, 0, 16);
|
|
|
|
|
qCritical() << QString("modCond->coinBlocker %1 (%2)").arg(modCond->coinBlocker).arg(modCond->coinBlocker, 0, 16);
|
|
|
|
|
|
|
|
|
|
qCritical() << QString("modCond->billReader %1 (%2)").arg(modCond->billReader).arg(modCond->billReader, 0, 16);
|
|
|
|
|
qCritical() << QString("modCond->ResetReason %1 (%2)").arg(modCond->ResetReason).arg(modCond->ResetReason, 0, 16);
|
|
|
|
|
qCritical() << QString("modCond->allModulesChecked %1 (%2)").arg(modCond->allModulesChecked).arg(modCond->allModulesChecked, 0, 16);
|
|
|
|
|
qCritical() << QString("modCond->alarmState %1 (%2)").arg(modCond->alarmState).arg(modCond->alarmState, 0, 16);
|
|
|
|
|
qCritical() << QString("modCond->fuses %1 (%2)").arg(modCond->fuses).arg(modCond->fuses, 0, 16);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void dump(T_dynamicCondition const *dynCond) {
|
|
|
|
|
qCritical() << QString("dynCond->allDoorsDebounced %1 (%2)").arg((unsigned char)dynCond->allDoorsDebounced).arg((unsigned char)dynCond->allDoorsDebounced, 0, 16);
|
|
|
|
|
qCritical() << QString("dynCond->openedAuthorized %1 (%2)").arg((unsigned char)dynCond->openedAuthorized).arg((unsigned char)dynCond->openedAuthorized, 0, 16);
|
|
|
|
|
qCritical() << QString("dynCond->CBinDebounced %1 (%2)").arg((unsigned char)dynCond->CBinDebounced).arg((unsigned char)dynCond->CBinDebounced, 0, 16);
|
|
|
|
|
qCritical() << QString("dynCond->upperDoor %1 (%2)").arg((unsigned char)dynCond->upperDoor).arg((unsigned char)dynCond->upperDoor, 0, 16);
|
|
|
|
|
qCritical() << QString("dynCond->middleDoor %1 (%2)").arg((unsigned char)dynCond->middleDoor).arg((unsigned char)dynCond->middleDoor, 0, 16);
|
|
|
|
|
qCritical() << QString("dynCond->lowerDoor %1 (%2)").arg((unsigned char)dynCond->lowerDoor).arg((unsigned char)dynCond->lowerDoor, 0, 16);
|
|
|
|
|
qCritical() << QString("dynCond->middleDoor %1 (%2)").arg((unsigned char)dynCond->middleDoor).arg((unsigned char)dynCond->middleDoor, 0, 16);
|
|
|
|
|
qCritical() << QString("dynCond->coinAttached %1 (%2)").arg((unsigned char)dynCond->coinAttached).arg((unsigned char)dynCond->coinAttached, 0, 16);
|
|
|
|
|
qCritical() << QString("dynCond->billBox %1 (%2)").arg((unsigned char)dynCond->billBox).arg((unsigned char)dynCond->billBox, 0, 16);
|
|
|
|
|
qCritical() << QString("dynCond->modeAbrech %1 (%2)").arg((unsigned char)dynCond->modeAbrech).arg((unsigned char)dynCond->modeAbrech, 0, 16);
|
|
|
|
|
qCritical() << QString("dynCond->onAlarm %1 (%2)").arg((unsigned char)dynCond->onAlarm).arg((unsigned char)dynCond->onAlarm, 0, 16);
|
|
|
|
|
qCritical() << QString("dynCond->nowCardTest %1 (%2)").arg((unsigned char)dynCond->nowCardTest).arg((unsigned char)dynCond->nowCardTest, 0, 16);
|
|
|
|
|
qCritical() << QString("dynCond->nowPayment %1 (%2)").arg((unsigned char)dynCond->nowPayment).arg((unsigned char)dynCond->nowPayment, 0, 16);
|
|
|
|
|
qCritical() << QString("dynCond->lastMifCardType %1 (%2)").arg((unsigned char)dynCond->lastMifCardType).arg((unsigned char)dynCond->lastMifCardType, 0, 16);
|
|
|
|
|
qCritical() << QString("dynCond->lastSDoorState %1 (%2)").arg(dynCond->lastSDoorState).arg(dynCond->lastSDoorState, 0, 16);
|
|
|
|
|
qCritical() << QString("dynCond->lastVDoorState %1 (%2)").arg(dynCond->lastVDoorState).arg(dynCond->lastVDoorState, 0, 16);
|
|
|
|
|
qCritical() << QString("dynCond->lastCBstate %1 (%2)").arg(dynCond->lastCBstate).arg(dynCond->lastCBstate, 0, 16);
|
|
|
|
|
qCritical() << QString("dynCond->paymentInProgress %1 (%2)").arg((unsigned char)dynCond->paymentInProgress).arg((unsigned char)dynCond->paymentInProgress, 0, 16);
|
|
|
|
|
qCritical() << QString("dynCond->U_Batt %1 (%2)").arg(dynCond->U_Batt).arg(dynCond->U_Batt, 0, 16);
|
|
|
|
|
qCritical() << QString("dynCond->nrCoinsInBox %1 (%2)").arg(dynCond->nrCoinsInBox).arg(dynCond->nrCoinsInBox, 0, 16);
|
|
|
|
|
qCritical() << QString("dynCond->amountInBox %1 (%2)").arg(dynCond->amountInBox).arg(dynCond->amountInBox, 0, 16);
|
|
|
|
|
qCritical() << QString("dynCond->totalTransVolume %1 (%2)").arg(dynCond->totalTransVolume).arg(dynCond->totalTransVolume, 0, 16);
|
|
|
|
|
qCritical() << QString("dynCond->totalNrOfVends %1 (%2)").arg(dynCond->totalNrOfVends).arg(dynCond->totalNrOfVends, 0, 16);
|
|
|
|
|
qCritical() << QString("dynCond->resultOfLastTemplPrint %1 (%2)").arg((unsigned char)dynCond->resultOfLastTemplPrint).arg((unsigned char)dynCond->resultOfLastTemplPrint, 0, 16);
|
|
|
|
|
qCritical() << QString("dynCond->lastPrinterStatus %1 (%2)").arg(dynCond->lastPrinterStatus).arg(dynCond->lastPrinterStatus, 0, 16);
|
|
|
|
|
qCritical() << QString("dynCond->startupTestIsRunning %1 (%2)").arg(dynCond->startupTestIsRunning).arg(dynCond->startupTestIsRunning, 0, 16);
|
|
|
|
|
qCritical() << QString("dynCond->totalNrOfCuts %1 (%2)").arg(dynCond->totalNrOfCuts).arg(dynCond->totalNrOfCuts, 0, 16);
|
|
|
|
|
qCritical() << QString("dynCond->nextAccountNumber %1 (%2)").arg(dynCond->nextAccountNumber).arg(dynCond->nextAccountNumber, 0, 16);
|
|
|
|
|
qCritical() << QString("dynCond->nrOfBillsInBox %1 (%2)").arg(dynCond->nrOfBillsInBox).arg(dynCond->nrOfBillsInBox, 0, 16);
|
|
|
|
|
qCritical() << QString("dynCond->UbatAtLastPrint %1 (%2)").arg(dynCond->UbatAtLastPrint).arg(dynCond->UbatAtLastPrint, 0, 16);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
char T_datif::loadRecDataFromFrame()
|
|
|
|
|
{
|
|
|
|
|
// is called even with wrong received data in order to speed up the process (stop waiting for response)
|
|
|
|
@ -497,6 +586,8 @@ char T_datif::loadRecDataFromFrame()
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
memset(receivedData, 0x00, sizeof(receivedData));
|
|
|
|
|
|
|
|
|
|
ret=myDCIF->getReceivedInData(&SlaveAdr, &readSource, &readAddress, &RdDleng, receivedData);
|
|
|
|
|
// nur true wenn CommandState OK und readState OK
|
|
|
|
|
|
|
|
|
@ -529,6 +620,117 @@ char T_datif::loadRecDataFromFrame()
|
|
|
|
|
|
|
|
|
|
gpi_storeRecPayLoad(RdDleng, receivedData); // save for host (user of hwapi)
|
|
|
|
|
|
|
|
|
|
if (myDCIF && myDCIF->getSerialPort()) {
|
|
|
|
|
uint32_t writeCount = myDCIF->getSerialPort()->getWriteCount();
|
|
|
|
|
if ((readCount + 1) == writeCount) { // there can be only one command sent to the DC
|
|
|
|
|
readCount = writeCount;
|
|
|
|
|
if (readSource != myDCIF->getReadSource()) {
|
|
|
|
|
qCritical() << __func__ << ":" << __LINE__ << ": ERROR length" << RdDleng << ", ignore data"
|
|
|
|
|
<< QByteArray(reinterpret_cast<char const *>(receivedData), RdDleng).toHex(':');
|
|
|
|
|
qCritical() << __func__ << ":" << __LINE__ << "would be interpretated as" << readSource << myDCIF->getReadSource();
|
|
|
|
|
return 0;
|
|
|
|
|
} else {
|
|
|
|
|
// only for debugging
|
|
|
|
|
// qCritical() << __func__ << ":" << __LINE__ << QDateTime::currentDateTime().time().toString(Qt::ISODateWithMs) << readSource << myDCIF->getReadSource();
|
|
|
|
|
if (readSource == 30) {
|
|
|
|
|
T_moduleCondition const *modCond = reinterpret_cast<T_moduleCondition const *>(receivedData);
|
|
|
|
|
|
|
|
|
|
if(modCond->rtc >= 200) {
|
|
|
|
|
dump(modCond);
|
|
|
|
|
qCritical() << __func__ << ":" << __LINE__ << ": ERROR E002 (modCond->rtc >= 200)"
|
|
|
|
|
<< QByteArray(reinterpret_cast<char const *>(receivedData), RdDleng).toHex(':');
|
|
|
|
|
}
|
|
|
|
|
if (modCond->printer == 200 || modCond->printer == 201) {
|
|
|
|
|
dump(modCond);
|
|
|
|
|
qCritical() << __func__ << ":" << __LINE__ << ": ERROR E020 (modCond->printer == 200 || modCond->printer == 201)"
|
|
|
|
|
<< QByteArray(reinterpret_cast<char const *>(receivedData), RdDleng).toHex(':');
|
|
|
|
|
}
|
|
|
|
|
if (modCond->printer == 202) {
|
|
|
|
|
dump(modCond);
|
|
|
|
|
qCritical() << __func__ << ":" << __LINE__ << ": ERROR E018 (modCond->printer == 202)"
|
|
|
|
|
<< QByteArray(reinterpret_cast<char const *>(receivedData), RdDleng).toHex(':');
|
|
|
|
|
}
|
|
|
|
|
if (modCond->coinBlocker >= 200) {
|
|
|
|
|
dump(modCond);
|
|
|
|
|
qCritical() << __func__ << ":" << __LINE__ << ": ERROR E025 (modCond->coinBlocker >= 200)"
|
|
|
|
|
<< QByteArray(reinterpret_cast<char const *>(receivedData), RdDleng).toHex(':');
|
|
|
|
|
}
|
|
|
|
|
if (modCond->mdbBus >= 200) {
|
|
|
|
|
dump(modCond);
|
|
|
|
|
qCritical() << __func__ << ":" << __LINE__ << ": ERROR E034 (modCond->mdbBus >= 200)"
|
|
|
|
|
<< QByteArray(reinterpret_cast<char const *>(receivedData), RdDleng).toHex(':');
|
|
|
|
|
}
|
|
|
|
|
if (modCond->intEe >= 200) {
|
|
|
|
|
dump(modCond);
|
|
|
|
|
qCritical() << __func__ << ":" << __LINE__ << ": ERROR E011 (modCond->intEe >= 200)"
|
|
|
|
|
<< QByteArray(reinterpret_cast<char const *>(receivedData), RdDleng).toHex(':');
|
|
|
|
|
}
|
|
|
|
|
if (modCond->voltage >= 200) {
|
|
|
|
|
dump(modCond);
|
|
|
|
|
qCritical() << __func__ << ":" << __LINE__ << ": ERROR E003 (modCond->voltage >= 200)"
|
|
|
|
|
<< QByteArray(reinterpret_cast<char const *>(receivedData), RdDleng).toHex(':');
|
|
|
|
|
}
|
|
|
|
|
if (modCond->changer >= 200) {
|
|
|
|
|
dump(modCond);
|
|
|
|
|
qCritical() << __func__ << ":" << __LINE__ << ": ERROR E026 (modCond->changer >= 200)"
|
|
|
|
|
<< QByteArray(reinterpret_cast<char const *>(receivedData), RdDleng).toHex(':');
|
|
|
|
|
}
|
|
|
|
|
if (modCond->coinSafe == 201) {
|
|
|
|
|
dump(modCond);
|
|
|
|
|
qCritical() << __func__ << ":" << __LINE__ << ": ERROR E007 (modCond->coinSafe == 201)"
|
|
|
|
|
<< QByteArray(reinterpret_cast<char const *>(receivedData), RdDleng).toHex(':');
|
|
|
|
|
}
|
|
|
|
|
if (modCond->coinSafe == 200) {
|
|
|
|
|
dump(modCond);
|
|
|
|
|
qCritical() << __func__ << ":" << __LINE__ << ": ERROR E009 (modCond->coinSafe == 200)"
|
|
|
|
|
<< QByteArray(reinterpret_cast<char const *>(receivedData), RdDleng).toHex(':');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (readSource == 31) {
|
|
|
|
|
T_dynamicCondition const *dynCond = reinterpret_cast<T_dynamicCondition const *>(receivedData);
|
|
|
|
|
|
|
|
|
|
if (dynCond->modeAbrech > 0) {
|
|
|
|
|
dump(dynCond);
|
|
|
|
|
qCritical() << __func__ << ":" << __LINE__ << ": ERROR E011 (dynCond->modeAbrech > 0)"
|
|
|
|
|
<< QByteArray(reinterpret_cast<char const *>(receivedData), RdDleng).toHex(':');
|
|
|
|
|
}
|
|
|
|
|
if (dynCond->nowCardTest > 0) {
|
|
|
|
|
dump(dynCond);
|
|
|
|
|
qCritical() << __func__ << ":" << __LINE__ << ": ERROR E072 (dynCond->nowCardTest > 0)"
|
|
|
|
|
<< QByteArray(reinterpret_cast<char const *>(receivedData), RdDleng).toHex(':');
|
|
|
|
|
}
|
|
|
|
|
if (dynCond->startupTestIsRunning > 0) {
|
|
|
|
|
dump(dynCond);
|
|
|
|
|
qCritical() << __func__ << ":" << __LINE__ << ": ERROR E073 (dynCond->startupTestIsRunning > 0)"
|
|
|
|
|
<< QByteArray(reinterpret_cast<char const *>(receivedData), RdDleng).toHex(':');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
qCritical() << __func__ << ":" << __LINE__ << QString(": ERROR readCount + 1 != writeCount: %1 != %2").arg(readCount + 1).arg(writeCount);
|
|
|
|
|
qCritical() << __func__ << ":" << __LINE__ << ": ERROR length" << RdDleng << ", ignore data"
|
|
|
|
|
<< QByteArray((char const *)receivedData, RdDleng).toHex(':');
|
|
|
|
|
qCritical() << __func__ << ":" << __LINE__ << "would be interpretated as" << readSource << myDCIF->getReadSource();
|
|
|
|
|
|
|
|
|
|
if (readSource == 30) {
|
|
|
|
|
T_moduleCondition const *modCond = reinterpret_cast<T_moduleCondition const *>(receivedData);
|
|
|
|
|
dump(modCond);
|
|
|
|
|
}
|
|
|
|
|
if (readSource == 31) {
|
|
|
|
|
T_dynamicCondition const *dynCond = reinterpret_cast<T_dynamicCondition const *>(receivedData);
|
|
|
|
|
dump(dynCond);
|
|
|
|
|
if (dynCond->coinAttached > 0) {
|
|
|
|
|
qCritical() << __func__ << ":" << __LINE__ << ": dynCond->coinAttached"
|
|
|
|
|
<< QByteArray(reinterpret_cast<char const *>(receivedData), RdDleng).toHex(':');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
readCount = writeCount;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// uint8_t nn;
|
|
|
|
|
//qDebug() << "\n datif: got valid data, rdsrc:" << readSource << " rdadd:" << readAddress
|
|
|
|
|
// << " rdlen:" << RdDleng;
|
|
|
|
@ -996,18 +1198,24 @@ char T_datif::loadRecDataFromFrame()
|
|
|
|
|
uit2=uchar2uint(receivedData[7],receivedData[6]); // value of last coin
|
|
|
|
|
//if (uitmp>0) // nur 1x bei neuer Münze 6.10.23 aendern:
|
|
|
|
|
// beim Wechsler hat die kleinste Muenze immer coin type 0!
|
|
|
|
|
|
|
|
|
|
if (uitmp>10000 || uit2>10000)
|
|
|
|
|
{
|
|
|
|
|
uitmp=0;
|
|
|
|
|
uit2=0;
|
|
|
|
|
}
|
|
|
|
|
if ((newInsertedAmount != lastInsertedAmount) || uit2>0 )
|
|
|
|
|
{
|
|
|
|
|
gpi_storeCurrentPayment(newInsertedAmount, uitmp, uit2);
|
|
|
|
|
emit datif_gotNewCoin(); // OR BILL if (uitmp & 0x8000)>0
|
|
|
|
|
//qDebug()<<"emit new coin";
|
|
|
|
|
lastInsertedAmount=newInsertedAmount;
|
|
|
|
|
//qCritical()<<"datif 112 store and emit new coin "<<newInsertedAmount<<" "<<uitmp<<" "<<uit2;
|
|
|
|
|
|
|
|
|
|
if (uit2==3 || uit2==5 || uit2==10 || uit2==20 || uit2==50 || uit2==100 || uit2==200 || uit2==500)
|
|
|
|
|
{
|
|
|
|
|
// valid coin
|
|
|
|
|
if ((newInsertedAmount != lastInsertedAmount) || uit2>0 )
|
|
|
|
|
{
|
|
|
|
|
gpi_storeCurrentPayment(newInsertedAmount, uitmp, uit2);
|
|
|
|
|
emit datif_gotNewCoin(); // OR BILL if (uitmp & 0x8000)>0
|
|
|
|
|
//qDebug()<<"emit new coin";
|
|
|
|
|
lastInsertedAmount=newInsertedAmount;
|
|
|
|
|
//qCritical()<<"datif 112 store and emit new coin "<<newInsertedAmount<<" "<<uitmp<<" "<<uit2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
@ -1035,6 +1243,7 @@ char T_datif::loadRecDataFromFrame()
|
|
|
|
|
if (RdDleng>28)
|
|
|
|
|
{
|
|
|
|
|
gpi_storeDeviceConditions(RdDleng, receivedData);
|
|
|
|
|
datif_nowNewStats=1; // 24.7.24 new
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
@ -1043,9 +1252,9 @@ char T_datif::loadRecDataFromFrame()
|
|
|
|
|
|
|
|
|
|
if (RdDleng>60)
|
|
|
|
|
{
|
|
|
|
|
epi_setDcDataValid(); // DC-Data are valid as DC responded.
|
|
|
|
|
// Could be set to every response but this (31)
|
|
|
|
|
// is a very common and very important request
|
|
|
|
|
//epi_setDcDataValid(); // 24.7.24 remove here
|
|
|
|
|
datif_nowNewDyns=1; // 24.7.24 new
|
|
|
|
|
|
|
|
|
|
gpi_storeDynMachineConditions(RdDleng, receivedData);
|
|
|
|
|
|
|
|
|
|
gpi_storeDI_CoinAttach(receivedData[6]); // new, 14.2.24 needed for direct coin insertion
|
|
|
|
|