Add updated sources of thomas.

This commit is contained in:
2023-03-29 14:32:22 +02:00
parent 49396c22ee
commit 7f23e3ea46
15 changed files with 2036 additions and 756 deletions

View File

@@ -71,7 +71,7 @@ Level 3): send command: "start payment process"
#include <QTabWidget>
#include <QtPlugin>
#include <QObject>
#include "interfaces.h"
#include <plugins/interfaces.h>
#include "datIf.h"
@@ -162,8 +162,8 @@ class hwapi : public QObject,
public hwinf
{
Q_OBJECT
//Q_PLUGIN_METADATA(IID "Atb.Psa2020.software.HWapi/1.0" ) //FILE "HWapi.json")
//Q_INTERFACES(hwinf)
Q_PLUGIN_METADATA(IID "Atb.Psa2020.software.HWapi/1.0" ) //FILE "HWapi.json")
Q_INTERFACES(hwinf)
public:
explicit hwapi(QWidget *parent = nullptr);
@@ -371,7 +371,7 @@ public:
uint32_t dc_getVoltage(void) const override; // in mV, 0...65,535V
QString dc_getVoltagStr(void) const override;
bool dc_mainFuseIsOk(void) const ; // override
bool dc_mainFuseIsOk(void) const override;
// ------------------------------------------------------------------------------
// Level 3: digital outputs and simple switching of connected devices
@@ -385,11 +385,11 @@ public:
// dir 0=off 1=up 2=down
uint8_t lock_switchLowerLock(uint8_t dir) const override;
// dir 0=off 1=up 2=down
void lock_switchVaultDoor(void) const; // override;
void lock_switchVaultDoor(void) const override;
void coin_switchRejectMotor(uint8_t dir) const; // override;
void coin_switchRejectMotor(uint8_t dir) const override;
void coin_rejectCoins(void) const; // override;
void coin_rejectCoins(void) const override;
// LEDs
void led_switchLedIllumination(uint8_t on) const override;
@@ -400,14 +400,13 @@ public:
void led_switchLedCoinbassin(uint8_t on, uint8_t ton, uint8_t tof) const override;
void fan_switchFan(bool on) const override;
void laerm_switchSiren(bool on) const override;
void alarm_switchSiren(bool on) const override;
void bar_OpenBarrier(bool open) const override;
void ptu_switchWake(bool WAKEACTIVE) const override;
void prn_switchPower(bool on) const override;
void mif_readerOn(bool on) const override;
void shut_move(bool open) const override;
void esc_moveFlaps(uint8_t flap ) const override;
// 0: close both 1: open take-flap 2: open return
@@ -473,7 +472,7 @@ public:
bool ptu_WakeINisActive(void) const override;
bool prn_isPrinterPowerOn(void) const override;
uint8_t prn_PrnFuseIsOk(void) const; // override;
uint8_t prn_PrnFuseIsOk(void) const override;
//retval: 0: fuse blown 1: fuse OK 2:unknown as printer power is off
bool prn_readyINisActive(void) const override;
@@ -496,10 +495,10 @@ public:
bool cred_isCreditPowerOn(void) const override;
bool cash_getRejectMotorHomePos(void) const; // override;
bool cash_getLowPaperSensor(void) const; // override;
bool cash_getRejectMotorHomePos(void) const override;
uint8_t cash_getLowPaperSensor(void) const override;
// 0: Sensor sees paper 1: no paper 99: off
// ------------------------------------------------------------------------------
@@ -531,7 +530,9 @@ public:
void request_MifareReaderState() const override;
void request_MifareCardType() const override;
void request_MifareAtbType() const override;
void request_MifareData() const override;
void request_MifareID() const override;
void request_MifareData(uint8_t dataBlockNumber) const override;
// dataBlockNumber must be 0....11, returns 64byte of data
void request_MDB_Status() const override;
void request_MDB_lastResponse() const override;
@@ -597,6 +598,13 @@ public:
void sendDeviceSettings(uint8_t kindOfPrinter, uint8_t kindOfCoinChecker,
uint8_t kindOfMifareReader, uint8_t suppressSleep,
uint8_t kindOfModem, uint8_t kindOfCredit ) const override;
// enable hardware in device controller:
// kindOfPrinter: 0:off 1: GPT4672 (only this one implemented)
// kindOfCoinChecker: 0:off 1:EMP820 2:EMP900 3: C²_changer
// kindOfMifareReader: 0:off 1: SL025 (only this one implemented)
// suppressSleep: 0:sleep allowed 1: sleep surpressed for special reason
// kindOfModem: 0:off 1: ATB_Sunlink_LTE (not yet implemented)
// kindOfCredit: 0:off 1: cVendTopp 2:cVendPin (not yet implemented)
void request_ReadbackDeviceSettings() const override;
@@ -626,7 +634,7 @@ public:
uint8_t lock_closeUpperDoor(void) const override;
uint8_t lock_openLowerDoor(void) const override;
//uint8_t lock_closeLowerDoor(void) const override;
uint8_t lock_closeLowerDoor(void) const override;
void shut_openOnce(void) const override;
@@ -652,29 +660,23 @@ public:
// read response from DC2 (input data)
// ------------------------------------------------------------------------------
/* data description:
byte 0: current read state: 0=power off 1=reader-fault 2=ready
uint8_t mif_returnReaderStateAndCardType(uint8_t *buf, uint8_t maxBufferSize) const override;
// retval 0=OK 1=error host buffer too small
/* data description, new fast version:
byte 0= still the same: current read state:
0=power off 1=reader-fault 2=ready
3=just reading 4=read complete
5=read partial, removed too early
6=state unknown
byte 1,2: read data length from card
3: 1=reader is OK (reported serial nr is OK) 0=wrong or no reader
4...15: reader version, expected "ATB25-1.8"
byte16: 1=card is present 0:not
17: 0
18: card type reported from reader
19: 1=allowed card type 0=not
20: card size: 1 or 4 (dec) = card size
21: LengthOfUID: 4 or 7 (dec) (byte)
22: UID 8 byte in hex
byte 30: sector logged: 0
byte 31: current sector: 0
byte 32: result, always 0
byte 1: reader state 1=ok 0=nok
byte 2: card preent (0,1)
byte 3: card selected (0)
byte 4: card type: 0...5
byte 5: card allowed (0=no 1=MifareClassic 1k or 4k)
byte 6: CardSize: 1 or 4 (kB)
byte 7: length of UID 4 or 7 (byte)
*/
uint8_t mif_returnReaderStateAndCardType(uint8_t *buf, uint8_t maxBufferSize) const override;
// retval 0=OK 1=error host buffer too small
bool mif_readerIsOK(void) const override;
@@ -965,6 +967,53 @@ public:
// signal: channel nr reported from checker 0...15
// neu, 25.3.23
void bl_rebootDC(void) const override;
void bl_startBL(void) const override;
void bl_checkBL(void) const override;
bool bl_isUp(void) const override;
// return true is bl is up and running
// also initializes "sendFile"
void bl_sendAddress(u_int16_t blockNumber) const override;
// send start address, nr of 64byte-block, start with 0
// will be sent only for folling block-numbers:
// 0, 1024, 2048, 3072 and 4096, so basically every 64kByte
uint8_t bl_wasSendingAddOK(void) const override;
// return val: 0: no response by now 1:error 10: OK
void bl_sendDataBlock(uint8_t length, u_int8_t *buffer) const override;
// send 64 byte from bin file
void bl_sendLastBlock(void) const override;
uint8_t bl_wasSendingDataOK(void) const override;
// return val: 0: no response by now 1:error 10: OK
void bl_stopBL(void) const override;
bool bl_isDiagAvailable(void) const override;
QString dc_getDiagText(void) const override;
// Komplett-schreib Funktion, noch nicht getestet
// Nachteil: keine Rückmeldung wie lang's noch dauert
void bl_startSending(void) const override;
void bl_sendFile(void) const override;
/*
// neu, 25.8.21