Merge changes from T.Sax DC_plugin 18.5.23
This commit is contained in:
@@ -308,6 +308,8 @@ class T_datif : public QMainWindow
|
||||
QTimer *datif_trigger;
|
||||
uint8_t selectedSlaveAddr;
|
||||
|
||||
int datif_noResponseCtr;
|
||||
|
||||
private slots:
|
||||
char datif_cycleSend();
|
||||
void StoredRecData();
|
||||
|
||||
@@ -1,8 +1,30 @@
|
||||
/*
|
||||
matching interfaces.h:
|
||||
|
||||
// History
|
||||
// 11.10.2021: V1.0 222 functions
|
||||
// 23.12.2021: V1.1 added block-parameter to function "read mifare data"
|
||||
// 30.12.2021: V1.2 added function: mif_clearDataBuffer(), mif_isBlockAvailable(uint8_t blkNr) and mif_getAvailableDataBlocks()
|
||||
// 1.1.2022: V1.3 Mifare extended. ( background: read 16 x 48byte from card to DC, read 12 x 64byte from DC to CA)
|
||||
// new: read full card with 768bytes from HWapi without block borders
|
||||
// added: mif_getNrOfAvailableDataBytes mif_getCardData768byteDec(uint8_t *buf, uint16_t bufferSize)
|
||||
// mif_getCardDataDec(uint16_t fromAddr, uint16_t toAddr, uint8_t *buf, uint16_t bufferSize)
|
||||
// mif_getCardDataStr(bool useHexFormat, char seperator)
|
||||
// 29.03.2023: V3.1 some extensions for PSA1256_ptu5,
|
||||
// V3.2 Bootloader improvement
|
||||
// 12.04.2023: V3.3 new features extended: loading and using Json-files, cash-collection, cash-data-logging
|
||||
|
||||
//#define HWINF_iid "Atb.Psa2020.software.HWapi/3.1"
|
||||
//#define HWINF_iid "Atb.Psa1256ptu5.software.HWapi/3.1"
|
||||
#define HWINF_iid "Atb.Psa1256ptu5.software.HWapi/3.3"
|
||||
*/
|
||||
|
||||
|
||||
#ifndef hwapi_H
|
||||
#define hwapi_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <QTimer>
|
||||
#include <QObject>
|
||||
#include "interfaces.h"
|
||||
#include "datIf.h"
|
||||
@@ -15,6 +37,7 @@ class hwapi : public QObject,
|
||||
Q_INTERFACES(hwinf)
|
||||
private:
|
||||
void sub_storeSendingText(QByteArray *buf) const;
|
||||
QTimer *hwapi_TimerPayment;
|
||||
|
||||
DownloadResult sendNextAddress(int bNum) const;
|
||||
DownloadResult sendNextDataBlock(QByteArray const &b, int bNum) const;
|
||||
@@ -161,6 +184,13 @@ public:
|
||||
uint8_t bl_exitBL(uint8_t *sendData) const override;
|
||||
// minimum size of sendData-buffer: 5byte retval: length
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Level 2 DC2-onboard devices
|
||||
// WR: set time
|
||||
@@ -963,6 +993,17 @@ public:
|
||||
bool cash_startPayment(uint32_t amount) const override;
|
||||
// 17.4.23TS: extended to 32bit
|
||||
|
||||
uint8_t cash_paymentProcessing(void) const override;
|
||||
// run this function periodically while coin payment process to generate necessary signals
|
||||
// return value:
|
||||
// 0: stopped 1: starting up 2: coin collection
|
||||
// 3: finished by User (Push button) 4: finished, Max-Value collected
|
||||
// 5: finished by escrow
|
||||
// 10,11: error cannot start
|
||||
// 12: timeout while payment, coins returned
|
||||
// 13: stopped by unexpected error
|
||||
|
||||
|
||||
bool cash_cancelPayment(void) const override;
|
||||
// and return coins
|
||||
|
||||
@@ -1032,6 +1073,7 @@ public:
|
||||
|
||||
void sys_restoreDeviceParameter(struct T_devices *deviceSettings) const override;
|
||||
|
||||
bool sys_areDCdataValid(void) const override;
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------
|
||||
// ------------ supervise all hardware components
|
||||
@@ -1076,14 +1118,31 @@ public:
|
||||
signals:
|
||||
void hwapi_templatePrintFinished_OK(void) const override;
|
||||
void hwapi_templatePrintFinished_Err(void) const override;
|
||||
|
||||
void hwapi_coinCollectionJustStarted(void) const override;
|
||||
void hwapi_coinCollectionAborted(void) const override;
|
||||
|
||||
void hwapi_gotNewCoin(void) const override;
|
||||
void hwapi_vendStopByMax(void) const override;
|
||||
void hwapi_vendStopByPushbutton(void) const override;
|
||||
void hwapi_payStopByMax(void) const override;
|
||||
void hwapi_payStopByPushbutton(void) const override;
|
||||
|
||||
void hwapi_payStopByEscrow(void) const override;
|
||||
void hwapi_payStopByError(void) const override;
|
||||
void hwapi_payStopByTimeout(void) const override;
|
||||
void hwapi_payCancelled(void) const override;
|
||||
|
||||
void hwapi_coinProcessJustStopped(void) const override;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private slots:
|
||||
void hwapi_slotPrintFinished_OK(void);
|
||||
void hwapi_slotPrintFinished_Err(void);
|
||||
void hwapi_slotGotCoin(void);
|
||||
void hwapi_slotPayProc(void);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -1452,6 +1452,8 @@ public:
|
||||
virtual bool cash_startPayment(uint32_t amount) const=0;
|
||||
// 17.4.23TS: extended to 32bit
|
||||
|
||||
virtual uint8_t cash_paymentProcessing(void) const=0;
|
||||
|
||||
virtual uint32_t getInsertedAmount(void) const=0;
|
||||
|
||||
virtual uint16_t getLastInsertedCoin(void) const=0;
|
||||
@@ -1616,6 +1618,8 @@ public:
|
||||
|
||||
virtual void sys_restoreDeviceParameter(struct T_devices *deviceSettings) const=0;
|
||||
|
||||
virtual bool sys_areDCdataValid(void) const=0;
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------
|
||||
// ------------ supervise all hardware components
|
||||
// ------------ assess the machine state
|
||||
@@ -1669,9 +1673,20 @@ public:
|
||||
signals:
|
||||
virtual void hwapi_templatePrintFinished_OK(void) const=0;
|
||||
virtual void hwapi_templatePrintFinished_Err(void) const=0;
|
||||
|
||||
virtual void hwapi_coinCollectionJustStarted(void) const=0;
|
||||
virtual void hwapi_coinCollectionAborted(void) const=0;
|
||||
|
||||
virtual void hwapi_gotNewCoin(void) const=0;
|
||||
virtual void hwapi_vendStopByMax(void) const=0;
|
||||
virtual void hwapi_vendStopByPushbutton(void) const=0;
|
||||
virtual void hwapi_payStopByMax(void) const=0;
|
||||
virtual void hwapi_payStopByPushbutton(void) const=0;
|
||||
|
||||
virtual void hwapi_payStopByEscrow(void) const=0;
|
||||
virtual void hwapi_payStopByError(void) const=0;
|
||||
virtual void hwapi_payStopByTimeout(void) const=0;
|
||||
virtual void hwapi_payCancelled(void) const=0;
|
||||
|
||||
virtual void hwapi_coinProcessJustStopped(void) const=0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ struct SharedMemBuffer {
|
||||
uint16_t nrOfCoins;
|
||||
bool dcDataValid;
|
||||
uint8_t wakeReason;
|
||||
|
||||
char curPayNewCoin;
|
||||
} store;
|
||||
|
||||
struct T_globTime {
|
||||
|
||||
Reference in New Issue
Block a user