From 647dc9fe4b22db82cee8c211c4bed810cf6f8026 Mon Sep 17 00:00:00 2001 From: Siegfried Siegert Date: Thu, 26 Sep 2024 11:45:10 +0200 Subject: [PATCH 1/2] Handle: valid data problem while start with coin attached: Enable command 30 also during sell --- src/datIf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/datIf.cpp b/src/datIf.cpp index 9b30965..70a907e 100755 --- a/src/datIf.cpp +++ b/src/datIf.cpp @@ -400,7 +400,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: From 4e58fbe4e159585ee401c6768e662ccabe8a1267 Mon Sep 17 00:00:00 2001 From: Siegfried Siegert Date: Thu, 26 Sep 2024 11:48:39 +0200 Subject: [PATCH 2/2] Add plausibility check for inserted coins --- src/datIf.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/datIf.cpp b/src/datIf.cpp index 70a907e..25e4365 100755 --- a/src/datIf.cpp +++ b/src/datIf.cpp @@ -1012,18 +1012,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 "<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 "<