Update DC interface to 20230719_1303

This commit is contained in:
Siegfried Siegert 2023-07-19 20:16:39 +02:00
parent 25e343cb5b
commit da7058a9bd
Signed by: SiegfriedSiegert
GPG Key ID: 68371E015E8F0B03

View File

@ -3,7 +3,7 @@
#include <QtPlugin>
#define THIS_IS_CA_MASTER
struct T_emp
{
@ -131,17 +131,17 @@ struct T_vaultRecord
//16
char label3buffer[4]; // mw >
// Verkauf, Tür zu:
uint32_t VKcoinsInserted[16]; // nur für Wechsler, soviel wurde eingeworfen
uint32_t VKcoinsReturned[6]; // nur für Wechsler, Anzahl Münzen pro Typ, soviel wurde zurückgegeben
// Verkauf, Tuer zu:
uint32_t VKcoinsInserted[16]; // nur fuer Wechsler, soviel wurde eingeworfen
uint32_t VKcoinsReturned[6]; // nur fuer Wechsler, Anzahl Muenzen pro Typ, soviel wurde zurueckgegeben
//88
// Service, Tür offen:
uint16_t ServCoinsInserted[16]; // nur für Wechsler, soviel wurde eingeworfen
uint16_t ServCoinsReturned[6]; // nur für Wechsler, Anzahl Münzen pro Typ, soviel wurde zurückgegeben
// Service, Tuer offen:
uint16_t ServCoinsInserted[16]; // nur fuer Wechsler, soviel wurde eingeworfen
uint16_t ServCoinsReturned[6]; // nur fuer Wechsler, Anzahl Muenzen pro Typ, soviel wurde zurueckgegeben
uint16_t resint3;
uint16_t resint4;
uint16_t currentTubeContent[6]; // nur für Wechsler, aktueller Füllstand
uint16_t currentTubeContent[6]; // nur fuer Wechsler, aktueller Fuellstand
uint16_t resint5;
uint16_t resint6;
// 56
@ -201,7 +201,7 @@ struct T_moduleCondition
uint8_t temper;
uint8_t poweronTest;
uint8_t doorState; // 1: alles zu 200: t?r offen + bit1(S) +bit2(CB) + bit3(CB)
uint8_t doorState; // 1: alles zu 200: tuer offen + bit1(S) +bit2(CB) + bit3(CB)
uint8_t doorWasOpened; // 1: all doors are closed 200: any door was just opened
uint8_t changer; // can only be tested by usage
@ -315,7 +315,7 @@ struct T_devices
// set by master, used(1) or notused (0) or type 2....20
UCHAR kindOfPrinter; // 0:off 1:Gebe
UCHAR kindOfCoinChecker; // 0: without 1=EMP820 2=EMP900 3=currenza (MW)
UCHAR kindOfCoinChecker; // 0: without 1=EMP820 2=EMP900 3=currenza Csquare (MW)
UCHAR kindOfMifareReader; // by now only stronglink SL025 =1
UCHAR suppressSleepMode; // 0:sleep allowed 1: no sleep
@ -357,7 +357,7 @@ public:
// Furthermore the Cashagent-Library answers with status strings about sending and reading result
// $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#ifdef THIS_IS_CA_MASTER
virtual bool dc_openSerial(int BaudNr, QString BaudStr, QString ComName, uint8_t connect) const =0;
// Command: open serial interface
// BaudNr: 0:1200 1:9600 2:19200 3:38400 4:57600 5:115200
@ -368,7 +368,7 @@ public:
virtual void dc_closeSerial(void) const =0;
// Command: close serial interface in order to save power while power down
// or if another port must be used
#endif
virtual bool dc_isPortOpen(void) const =0;
// returns true if port open (don't send unless open. Sending to closed port will crash program)
@ -394,7 +394,7 @@ public:
// get data back in "payLoad", max 64 byte, can be used for diagnosis
// retval = nr of bytes received. If host buffer too small then
// only plBufSiz bytes are copied to "payLoad"
// plBufSiz­z=size of host buffer
// plBufSiz = size of host buffer
virtual void dc_setWakeFrequency(uint8_t period) const =0;
// RTC wakes DC2 (and PTU) by hardware signal every 32seconds
@ -403,7 +403,7 @@ public:
virtual void dc_OrderToReset(void) const =0;
// want DC2 to reset (in order to start Bootloader)
#ifdef THIS_IS_CA_MASTER
virtual QString dc_getSerialState(void) const =0;
// get result of opening-command like "ttyS0 opened with 115200 8N1!
// or error messages like "comport not available..."
@ -411,7 +411,7 @@ public:
virtual void dc_clrSerialStateText(void) const =0;
// clear above text to avoid multiple repetive displaying
#endif
virtual void bl_sendDataDirectly(uint8_t length, uint8_t *buf) const =0;
// send without protocol frame, needed for the DC bootloader
@ -496,10 +496,10 @@ public:
// Analog values:
virtual uint32_t dc_getTemperature(void) const =0;
// in Sax-Format 0...400 (0=-50,0°C 100=0,0°C 141=20,5°C 400=150,0°C)
// in Sax-Format 0...400 (0=-50,0degC 100=0,0degC 141=20,5degC 400=150,0degC)
virtual QString dc_getTemperaturStr(void) const =0;
// as string like "-12,5°C"
// as string like "-12,5degC"
virtual uint32_t dc_getVoltage(void) const =0;
// as value in mV, 0...65,535V
@ -760,7 +760,7 @@ public:
uint8_t kindOfModem, uint8_t kindOfCredit ) const =0;
// enable hardware in device controller:
// kindOfPrinter: 0:off 1: GPT4672 (only this one implemented)
// kindOfCoinChecker: 0:off 1:EMP820 2:EMP900 3: C²_changer
// kindOfCoinChecker: 0:off 1:EMP820 2:EMP900 3: Csquare_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)
@ -886,7 +886,7 @@ public:
// send 5 byte: byte 0,1: speed 5...250 mm/s
// byte2: density 0....(25)....50
// byte3: alignment 'l', 'c', 'r' = left, center, right
// byte4: orientation 0, 90, 180 = 0°, 90°, 180° rotation (by now not supported!)
// byte4: orientation 0, 90, 180 = 0deg, 90deg, 180deg rotation (by now not supported!)
// not batched! don't use twice within 100ms
virtual void prn_movePaper(uint8_t wayInMm, uint8_t direction) const =0;
@ -1018,7 +1018,7 @@ public:
// use for changer
#ifdef THIS_IS_CA_MASTER
virtual QString dc_getTxt4RsDiagWin(void) const =0;
virtual void dc_clrTxt4RsDiagWin(void) const =0;
virtual QString dc_get2ndTxt4RsDiagWin(void) const =0;
@ -1033,7 +1033,6 @@ public:
virtual void dc_clrTxt4dataStateLine(void) const =0;
virtual QString dc_getdatifLine(void) const =0;
virtual void dc_clrTxt4datifLine(void) const =0;
#endif
@ -1178,7 +1177,7 @@ public:
virtual uint16_t getLastInsertedCoin(void) const =0;
virtual bool getAllInsertedCoins(uint16_t *types, uint16_t *values) const =0;
// alle bei diesem Verkauf eingeworfenen Münzen sind gespeichert, max 64
// alle bei diesem Verkauf eingeworfenen Muenzen sind gespeichert, max 64
virtual bool cash_cancelPayment(void) const =0;
@ -1232,6 +1231,8 @@ public:
virtual uint8_t prn_getPrintResult() const =0;
virtual uint8_t prn_getCurrentPrinterState() const =0;
// 0: printer OK
// bit0: near paper end bit1: no paper
@ -1244,6 +1245,8 @@ public:
virtual void sys_sendDeviceParameter(struct T_devices *deviceSettings) const =0;
virtual void sys_restoreDeviceParameter(struct T_devices *deviceSettings) const =0;
// attention: only applies if function "sys_sendDeviceParameter()" was used to send this settings before
// cannot be used to see settings programmed by JsonFile
virtual bool sys_areDCdataValid(void) const =0;
@ -1268,6 +1271,33 @@ public:
virtual bool dc_isAutoRequestOn(void) const =0;
virtual uint16_t log_getLatestAccountNumber(void) const=0;
// new function 27.6.2023
// latest = highest
virtual uint8_t log_getAvailableVaultBlocks(void) const=0;
// return 0x0011 1111 if all 6 blocks are loaded (one bit per block)
virtual uint8_t log_getAnswerToLastSlaveRequest(void) const =0;
// use only for ONE request/command
// return: 0xFF: result unknown by now as sending is ongoing
// 0=OK
// 1= wrong length 2=wrong start sign 5= wrong crc
// 6= slave: master cmd was wrong 7: slave: could not write/read data
// 8=timeout, got no response from slave
// use for important and extended commands (print several templates, print ticket...)
virtual void log_startSupervision(void) const =0;
virtual uint8_t log_getAnswerToLastCmdBatch(void) const =0;
// 0xFF: no command sent by now
// 0: started, in progress
// 1: done and OK
// 2: done and error
virtual bool log_getVaultData(uint8_t *data) const =0;
// get vault record in linear 8bit buffer with 320 byte