Updated for new device controller lib (CAmaster)
This commit is contained in:
		@@ -3,7 +3,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include <QtPlugin>
 | 
					#include <QtPlugin>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define THIS_IS_CA_MASTER
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct T_emp
 | 
					struct T_emp
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -131,17 +131,17 @@ struct T_vaultRecord
 | 
				
			|||||||
//16
 | 
					//16
 | 
				
			||||||
        char label3buffer[4];	// mw >
 | 
					        char label3buffer[4];	// mw >
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Verkauf, T<EFBFBD>r zu:
 | 
					        // Verkauf, Tuer zu:
 | 
				
			||||||
        uint32_t VKcoinsInserted[16];		// nur f<EFBFBD>r Wechsler, soviel wurde eingeworfen
 | 
					        uint32_t VKcoinsInserted[16];		// nur fuer Wechsler, soviel wurde eingeworfen
 | 
				
			||||||
        uint32_t VKcoinsReturned[6];		// nur f<EFBFBD>r Wechsler, Anzahl M<EFBFBD>nzen pro Typ, soviel wurde zur<EFBFBD>ckgegeben
 | 
					        uint32_t VKcoinsReturned[6];		// nur fuer Wechsler, Anzahl Muenzen pro Typ, soviel wurde zurueckgegeben
 | 
				
			||||||
//88
 | 
					//88
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Service, T<EFBFBD>r offen:
 | 
					        // Service, Tuer offen:
 | 
				
			||||||
        uint16_t ServCoinsInserted[16];		// nur f<EFBFBD>r Wechsler, soviel wurde eingeworfen
 | 
					        uint16_t ServCoinsInserted[16];		// nur fuer Wechsler, soviel wurde eingeworfen
 | 
				
			||||||
        uint16_t ServCoinsReturned[6];		// nur f<EFBFBD>r Wechsler, Anzahl M<EFBFBD>nzen pro Typ, soviel wurde zur<EFBFBD>ckgegeben
 | 
					        uint16_t ServCoinsReturned[6];		// nur fuer Wechsler, Anzahl Muenzen pro Typ, soviel wurde zurueckgegeben
 | 
				
			||||||
        uint16_t resint3;
 | 
					        uint16_t resint3;
 | 
				
			||||||
        uint16_t resint4;
 | 
					        uint16_t resint4;
 | 
				
			||||||
        uint16_t currentTubeContent[6];		//  nur f<EFBFBD>r Wechsler, aktueller F<EFBFBD>llstand
 | 
					        uint16_t currentTubeContent[6];		//  nur fuer Wechsler, aktueller Fuellstand
 | 
				
			||||||
        uint16_t resint5;
 | 
					        uint16_t resint5;
 | 
				
			||||||
        uint16_t resint6;
 | 
					        uint16_t resint6;
 | 
				
			||||||
// 56
 | 
					// 56
 | 
				
			||||||
@@ -201,7 +201,7 @@ struct T_moduleCondition
 | 
				
			|||||||
        uint8_t   temper;
 | 
					        uint8_t   temper;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        uint8_t	poweronTest;
 | 
					        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	doorWasOpened;		// 1: all doors are closed   200: any door was just opened
 | 
				
			||||||
        uint8_t	changer;			// can only be tested by usage
 | 
					        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
 | 
					    // set by master, used(1) or notused (0) or type 2....20
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    UCHAR   kindOfPrinter;			// 0:off   1:Gebe
 | 
					    UCHAR   kindOfPrinter;			// 0:off   1:Gebe
 | 
				
			||||||
    UCHAR	kindOfCoinChecker;		// 0: without  1=EMP820   2=EMP900    3=currenza c<EFBFBD>	(MW)
 | 
					    UCHAR	kindOfCoinChecker;		// 0: without  1=EMP820   2=EMP900    3=currenza Csquare  (MW)
 | 
				
			||||||
    UCHAR	kindOfMifareReader;		// by now only stronglink SL025 =1
 | 
					    UCHAR	kindOfMifareReader;		// by now only stronglink SL025 =1
 | 
				
			||||||
    UCHAR   suppressSleepMode;		// 0:sleep allowed   1: no sleep
 | 
					    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
 | 
					    //      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;
 | 
					    virtual bool dc_openSerial(int BaudNr, QString BaudStr, QString ComName, uint8_t connect)  const =0;
 | 
				
			||||||
        // Command: open serial interface
 | 
					        // Command: open serial interface
 | 
				
			||||||
        // BaudNr:  0:1200   1:9600   2:19200   3:38400   4:57600   5:115200
 | 
					        // 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;
 | 
					    virtual void dc_closeSerial(void)  const =0;
 | 
				
			||||||
        // Command: close serial interface in order to save power while power down
 | 
					        // Command: close serial interface in order to save power while power down
 | 
				
			||||||
        // or if another port must be used
 | 
					        // or if another port must be used
 | 
				
			||||||
#endif
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    virtual bool dc_isPortOpen(void)  const =0;
 | 
					    virtual bool dc_isPortOpen(void)  const =0;
 | 
				
			||||||
        // returns true if port open (don't send unless open. Sending to closed port will crash program)                         
 | 
					        // 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
 | 
					        // get data back in "payLoad", max 64 byte, can be used for diagnosis
 | 
				
			||||||
        // retval = nr of bytes received. If host buffer too small then
 | 
					        // retval = nr of bytes received. If host buffer too small then
 | 
				
			||||||
        // only plBufSiz bytes are copied to "payLoad"
 | 
					        // only plBufSiz bytes are copied to "payLoad"
 | 
				
			||||||
        // plBufSiz<EFBFBD>z=size of host buffer
 | 
					        // plBufSiz = size of host buffer
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    virtual void dc_setWakeFrequency(uint8_t period)  const =0;
 | 
					    virtual void dc_setWakeFrequency(uint8_t period)  const =0;
 | 
				
			||||||
        // RTC wakes DC2 (and PTU) by hardware signal every 32seconds
 | 
					        // RTC wakes DC2 (and PTU) by hardware signal every 32seconds
 | 
				
			||||||
@@ -403,7 +403,7 @@ public:
 | 
				
			|||||||
    virtual void dc_OrderToReset(void)  const =0;
 | 
					    virtual void dc_OrderToReset(void)  const =0;
 | 
				
			||||||
        // want DC2 to reset (in order to start Bootloader)
 | 
					        // want DC2 to reset (in order to start Bootloader)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef THIS_IS_CA_MASTER
 | 
					
 | 
				
			||||||
    virtual QString dc_getSerialState(void)  const =0;
 | 
					    virtual QString dc_getSerialState(void)  const =0;
 | 
				
			||||||
        // get result of opening-command like "ttyS0 opened with 115200 8N1!
 | 
					        // get result of opening-command like "ttyS0 opened with 115200 8N1!
 | 
				
			||||||
        // or error messages like "comport not available..."
 | 
					        // or error messages like "comport not available..."
 | 
				
			||||||
@@ -411,7 +411,7 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    virtual void dc_clrSerialStateText(void)  const =0;
 | 
					    virtual void dc_clrSerialStateText(void)  const =0;
 | 
				
			||||||
        // clear above text to avoid multiple repetive displaying
 | 
					        // clear above text to avoid multiple repetive displaying
 | 
				
			||||||
#endif
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    virtual void bl_sendDataDirectly(uint8_t length, uint8_t *buf)  const =0;
 | 
					    virtual void bl_sendDataDirectly(uint8_t length, uint8_t *buf)  const =0;
 | 
				
			||||||
        // send without protocol frame, needed for the DC bootloader
 | 
					        // send without protocol frame, needed for the DC bootloader
 | 
				
			||||||
@@ -496,10 +496,10 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    // Analog values:
 | 
					    // Analog values:
 | 
				
			||||||
    virtual uint32_t dc_getTemperature(void)  const =0;
 | 
					    virtual uint32_t dc_getTemperature(void)  const =0;
 | 
				
			||||||
        // in Sax-Format 0...400 (0=-50,0<EFBFBD>C    100=0,0<EFBFBD>C    141=20,5<EFBFBD>C    400=150,0<EFBFBD>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;
 | 
					    virtual QString  dc_getTemperaturStr(void)  const =0;
 | 
				
			||||||
        // as string like "-12,5<EFBFBD>C"
 | 
					        // as string like "-12,5degC"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    virtual uint32_t dc_getVoltage(void)  const =0;
 | 
					    virtual uint32_t dc_getVoltage(void)  const =0;
 | 
				
			||||||
        // as value in mV,  0...65,535V
 | 
					        // as value in mV,  0...65,535V
 | 
				
			||||||
@@ -760,7 +760,7 @@ public:
 | 
				
			|||||||
                            uint8_t kindOfModem,        uint8_t kindOfCredit        ) const =0;
 | 
					                            uint8_t kindOfModem,        uint8_t kindOfCredit        ) const =0;
 | 
				
			||||||
    // enable hardware in device controller:
 | 
					    // enable hardware in device controller:
 | 
				
			||||||
    // kindOfPrinter:       0:off 1: GPT4672 (only this one implemented)
 | 
					    // kindOfPrinter:       0:off 1: GPT4672 (only this one implemented)
 | 
				
			||||||
    // kindOfCoinChecker:   0:off 1:EMP820 2:EMP900 3: C<EFBFBD>_changer
 | 
					    // kindOfCoinChecker:   0:off 1:EMP820 2:EMP900 3: Csquare_changer
 | 
				
			||||||
    // kindOfMifareReader:  0:off 1: SL025   (only this one implemented)
 | 
					    // kindOfMifareReader:  0:off 1: SL025   (only this one implemented)
 | 
				
			||||||
    // suppressSleep:       0:sleep allowed 1: sleep surpressed for special reason
 | 
					    // suppressSleep:       0:sleep allowed 1: sleep surpressed for special reason
 | 
				
			||||||
    // kindOfModem:         0:off 1: ATB_Sunlink_LTE        (not yet implemented)
 | 
					    // 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
 | 
					        // send 5 byte: byte 0,1: speed  5...250 mm/s
 | 
				
			||||||
        //              byte2: density   0....(25)....50
 | 
					        //              byte2: density   0....(25)....50
 | 
				
			||||||
        //              byte3: alignment    'l', 'c', 'r' = left, center, right
 | 
					        //              byte3: alignment    'l', 'c', 'r' = left, center, right
 | 
				
			||||||
        //              byte4: orientation  0, 90, 180    = 0<EFBFBD>, 90<EFBFBD>, 180<EFBFBD> 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
 | 
					        // not batched! don't use twice within 100ms
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    virtual void prn_movePaper(uint8_t wayInMm, uint8_t direction) const =0;
 | 
					    virtual void prn_movePaper(uint8_t wayInMm, uint8_t direction) const =0;
 | 
				
			||||||
@@ -1018,7 +1018,7 @@ public:
 | 
				
			|||||||
        // use for changer
 | 
					        // use for changer
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef THIS_IS_CA_MASTER
 | 
					
 | 
				
			||||||
    virtual QString dc_getTxt4RsDiagWin(void) const =0;
 | 
					    virtual QString dc_getTxt4RsDiagWin(void) const =0;
 | 
				
			||||||
    virtual void dc_clrTxt4RsDiagWin(void) const =0;
 | 
					    virtual void dc_clrTxt4RsDiagWin(void) const =0;
 | 
				
			||||||
    virtual QString dc_get2ndTxt4RsDiagWin(void) const =0;
 | 
					    virtual QString dc_get2ndTxt4RsDiagWin(void) const =0;
 | 
				
			||||||
@@ -1033,7 +1033,6 @@ public:
 | 
				
			|||||||
    virtual void dc_clrTxt4dataStateLine(void) const =0;
 | 
					    virtual void dc_clrTxt4dataStateLine(void) const =0;
 | 
				
			||||||
    virtual QString dc_getdatifLine(void) const =0;
 | 
					    virtual QString dc_getdatifLine(void) const =0;
 | 
				
			||||||
    virtual void dc_clrTxt4datifLine(void) const =0;
 | 
					    virtual void dc_clrTxt4datifLine(void) const =0;
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1178,7 +1177,7 @@ public:
 | 
				
			|||||||
    virtual uint16_t getLastInsertedCoin(void) const =0;
 | 
					    virtual uint16_t getLastInsertedCoin(void) const =0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    virtual bool getAllInsertedCoins(uint16_t *types, uint16_t *values) const =0;
 | 
					    virtual bool getAllInsertedCoins(uint16_t *types, uint16_t *values) const =0;
 | 
				
			||||||
        // alle bei diesem Verkauf eingeworfenen M<EFBFBD>nzen sind gespeichert, max 64
 | 
					        // alle bei diesem Verkauf eingeworfenen Muenzen sind gespeichert, max 64
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    virtual bool cash_cancelPayment(void) const =0;
 | 
					    virtual bool cash_cancelPayment(void) const =0;
 | 
				
			||||||
@@ -1232,6 +1231,8 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    virtual uint8_t prn_getPrintResult() const =0;
 | 
					    virtual uint8_t prn_getPrintResult() const =0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    virtual uint8_t prn_getCurrentPrinterState() const =0;
 | 
					    virtual uint8_t prn_getCurrentPrinterState() const =0;
 | 
				
			||||||
        //        0: printer OK
 | 
					        //        0: printer OK
 | 
				
			||||||
        //          bit0: near paper end          bit1: no paper
 | 
					        //          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_sendDeviceParameter(struct T_devices *deviceSettings) const =0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    virtual void sys_restoreDeviceParameter(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;
 | 
					    virtual bool sys_areDCdataValid(void) const =0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1268,6 +1271,33 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    virtual bool dc_isAutoRequestOn(void) const =0;
 | 
					    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
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user