Update interface hwapi 3.6
This commit is contained in:
parent
de1dc88e51
commit
2717c614e3
513
include/interfaces.h
Normal file → Executable file
513
include/interfaces.h
Normal file → Executable file
@ -2,9 +2,12 @@
|
||||
#define INTERFACE_H
|
||||
|
||||
#include <QtPlugin>
|
||||
#include <QStringList>
|
||||
|
||||
struct T_emp {
|
||||
|
||||
|
||||
struct T_emp
|
||||
{
|
||||
|
||||
// Fixdata from EMP:
|
||||
uint8_t shaft; // = changer level
|
||||
uint16_t countryCode;
|
||||
@ -21,19 +24,29 @@ struct T_emp {
|
||||
|
||||
// dynamic:
|
||||
uint8_t state; // step counter of EMP (electronic coin checker) FSM (finite state machine):
|
||||
// 0=Emp & Bus power off, 1=powered, poll off 2=polling on
|
||||
// 3=device responded, requesting status
|
||||
// 4=waiting for status 5=have status,
|
||||
// 6: IDLE, have paramters from master, polling running, ready for payment
|
||||
// Master can stop/start polling and acceptance
|
||||
// 7: end of transaction, polling on, accept off, reporting coins, (wait for last coin)
|
||||
// 8: transaction running, polling on, acceptance on, reporting coins,
|
||||
// 0=start command
|
||||
// 1=powered, do emp ini, send reset
|
||||
// 2=delay
|
||||
// 3=wait for response, requesting status after response
|
||||
// 4,5 through, startup
|
||||
// 6: wait for status
|
||||
// 7: through, startup
|
||||
// 8: IDLE state. EMP is up and ready, polling is running
|
||||
// 9: polling on, payment not yet on
|
||||
// 10: payment, check coins
|
||||
// 11: through
|
||||
// 12: wait 1s for last coin
|
||||
// 90: stop all, 1s delay
|
||||
// 99: off, all stopped
|
||||
|
||||
|
||||
uint8_t pollingRunning;
|
||||
uint8_t paymentRunning;
|
||||
|
||||
};
|
||||
|
||||
struct Trtc_DateTime {
|
||||
struct Trtc_DateTime
|
||||
{
|
||||
uint8_t rtc_hour;
|
||||
uint8_t rtc_min;
|
||||
uint8_t rtc_sec;
|
||||
@ -43,7 +56,8 @@ struct Trtc_DateTime {
|
||||
uint8_t rtc_dayOfWeek;
|
||||
};
|
||||
|
||||
struct Tprn_hw_state {
|
||||
struct Tprn_hw_state
|
||||
{
|
||||
// hardware (IO's)
|
||||
bool powerRdBk; // prn pwr is on
|
||||
bool rsSwOk; // serial switch (printer or modem) is set to printer
|
||||
@ -60,7 +74,8 @@ struct Tprn_hw_state {
|
||||
bool badResponse;
|
||||
};
|
||||
|
||||
struct Tprn_currentSettings {
|
||||
struct Tprn_currentSettings
|
||||
{
|
||||
uint8_t currFont;
|
||||
uint8_t currSize;
|
||||
uint8_t currHeigth;
|
||||
@ -73,166 +88,196 @@ struct Tprn_currentSettings {
|
||||
bool nowAligned;
|
||||
};
|
||||
|
||||
struct T_dynDat {
|
||||
// obsolete
|
||||
struct T_dynDat
|
||||
{
|
||||
uint8_t licensePlate[8];
|
||||
uint8_t vendingPrice[8];
|
||||
uint8_t parkingEndTime[8];
|
||||
uint8_t parkingEndDate[8];
|
||||
uint8_t parkingEnd[8];
|
||||
uint8_t currentTime[8];
|
||||
uint8_t currentDate[8];
|
||||
uint8_t dynDat5[8];
|
||||
uint8_t dynDat6[8];
|
||||
uint8_t dynDat7[8];
|
||||
};
|
||||
|
||||
struct T_vaultRecord {
|
||||
|
||||
struct T_vaultRecord
|
||||
{
|
||||
|
||||
// Kassenbeleg (Abrechnungsdatensatz = Kassenwechsel-Datensatz)
|
||||
char startbuffer[4]; // Psa> // never move or change this 1st entry
|
||||
uint16_t AccountingNumber;
|
||||
uint16_t CUNU;
|
||||
uint16_t MANU;
|
||||
uint16_t resint1;
|
||||
//uint16_t resint2;
|
||||
char startbuffer[4]; // Psa> // never move or change this 1st entry
|
||||
uint16_t AccountingNumber;
|
||||
uint16_t CUNU;
|
||||
uint16_t MANU;
|
||||
uint16_t resint1;
|
||||
//uint16_t resint2;
|
||||
|
||||
char label1buffer[4]; // tim>
|
||||
uint8_t year;
|
||||
uint8_t month;
|
||||
uint8_t dom;
|
||||
uint8_t hour;
|
||||
uint8_t min;
|
||||
uint8_t sec;
|
||||
uint8_t DoW;
|
||||
uint8_t reschar3;
|
||||
char label1buffer[4]; // tim>
|
||||
uint8_t year;
|
||||
uint8_t month;
|
||||
uint8_t dom;
|
||||
uint8_t hour;
|
||||
uint8_t min;
|
||||
uint8_t sec;
|
||||
uint8_t DoW;
|
||||
uint8_t reschar3;
|
||||
|
||||
char label2buffer[4]; // abs>
|
||||
uint32_t AbsIncome1;
|
||||
uint32_t AbsReserve;
|
||||
uint32_t AbsNrOfCuts;
|
||||
char label2buffer[4]; // abs>
|
||||
uint32_t AbsIncome1;
|
||||
uint32_t AbsReserve;
|
||||
uint32_t AbsNrOfCuts;
|
||||
|
||||
//16
|
||||
char label3buffer[4]; // mw >
|
||||
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, 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
|
||||
//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
|
||||
uint16_t resint3;
|
||||
uint16_t resint4;
|
||||
uint16_t currentTubeContent[6]; // nur für Wechsler, aktueller Füllstand
|
||||
uint16_t resint5;
|
||||
uint16_t resint6;
|
||||
|
||||
// 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
|
||||
uint16_t resint3;
|
||||
uint16_t resint4;
|
||||
uint16_t currentTubeContent[6]; // nur für Wechsler, aktueller Füllstand
|
||||
uint16_t resint5;
|
||||
uint16_t resint6;
|
||||
// 56
|
||||
char label4buffer[4]; // box>
|
||||
uint16_t coinsInVault[16];
|
||||
uint16_t billsInStacker[8];
|
||||
|
||||
char label4buffer[4]; // box>
|
||||
uint16_t coinsInVault[16];
|
||||
uint16_t billsInStacker[8];
|
||||
// 48
|
||||
char label5buffer[4]; // val>
|
||||
// actually constant unless exchange rate is changed
|
||||
uint16_t coinDenomination[16]; // 5..50000 (z.B. 2? sind in Ungarn 760Ft)
|
||||
uint16_t billDenom[8];
|
||||
uint16_t tubeDenom[6];
|
||||
uint16_t exchangeRate;
|
||||
uint16_t resint9;
|
||||
|
||||
char label5buffer[4]; // val>
|
||||
// actually constant unless exchange rate is changed
|
||||
uint16_t coinDenomination[16]; // 5..50000 (z.B. 2? sind in Ungarn 760Ft)
|
||||
uint16_t billDenom[8];
|
||||
uint16_t tubeDenom[6];
|
||||
uint16_t exchangeRate;
|
||||
uint16_t resint9;
|
||||
|
||||
// 64
|
||||
char endofblock[4]; // end>
|
||||
|
||||
char endofblock[4]; // end>
|
||||
|
||||
// 316 byte Block im Speicher
|
||||
};
|
||||
|
||||
struct T_moduleCondition {
|
||||
// store conditon of all system components, hold in RAM
|
||||
// 0 means unknown, not yet tested/used
|
||||
// 1 means OK
|
||||
// 50..99 = HINT / Notification
|
||||
// 100..150 = WARNING
|
||||
// 200..250 = ERROR
|
||||
|
||||
uint8_t ram;
|
||||
uint8_t intEe;
|
||||
uint8_t extEe;
|
||||
|
||||
uint8_t rtc; // 1: time/date OK 100: time not plausible 200: hardware error
|
||||
uint8_t boardHw;
|
||||
uint8_t printer;
|
||||
uint8_t modem;
|
||||
|
||||
uint8_t signal; // 1...99
|
||||
uint8_t regist; // 100:not 1:reg 2:ping OK 3:gotTime
|
||||
uint8_t mdbBus;
|
||||
uint8_t coinChecker; // EMP, OMP or mei-cashflow
|
||||
|
||||
uint8_t coinEscrow;
|
||||
uint8_t mifareReader;
|
||||
uint8_t creditTerm;
|
||||
uint8_t coinReject;
|
||||
|
||||
uint8_t coinSafe;
|
||||
uint8_t billSafe;
|
||||
uint8_t voltage; // 1:11..14V
|
||||
uint8_t temper;
|
||||
|
||||
uint8_t poweronTest;
|
||||
uint8_t doorState; // 1: alles zu 200: t?r 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
|
||||
|
||||
uint8_t coinBlocker; // can only be tested by usage
|
||||
uint8_t billReader; // can only be tested by usage
|
||||
uint8_t ResetReason;
|
||||
uint8_t allModulesChecked;
|
||||
|
||||
};
|
||||
|
||||
struct T_dynamicCondition {
|
||||
char allDoorsDebounced; // 99: undefined, 0=all closed, bit1=upper door open 2=midlle door open 3=lower door open
|
||||
char openedAuthorized;
|
||||
uint8_t CBinDebounced;
|
||||
char upperDoor; // 99: undefined 0:closed 1:open
|
||||
char middleDoor; // 99: undefined 0:closed 1:open
|
||||
char lowerDoor; // 99: undefined 0:closed 1:open
|
||||
char reserve; // not used, always 0
|
||||
char billBox;
|
||||
char modeAbrech;
|
||||
char onAlarm; // 0:alarm aus 1:alarm 2:alarm mit Sirene 3: Sirenentest
|
||||
char nowCardTest;
|
||||
char nowPayment;
|
||||
char lastMifCardType;
|
||||
uint8_t lastSDoorState;
|
||||
uint8_t lastVDoorState;
|
||||
uint8_t lastCBstate; // 99: undefined 0:not there 1:insered
|
||||
char paymentInProgress;
|
||||
char res1;
|
||||
uint16_t U_Batt;
|
||||
uint16_t Temperatur;
|
||||
uint16_t nrCoinsInBox;
|
||||
uint32_t amountInBox;
|
||||
uint32_t totalTransVolume;
|
||||
uint32_t totalNrOfVends;
|
||||
char jsonValid_config;
|
||||
char jsonValid_device;
|
||||
char jsonValid_cash;
|
||||
char jsonValid_print;
|
||||
char jsonValid_serial;
|
||||
char jsonValid_time;
|
||||
char lastFileType;
|
||||
struct T_moduleCondition
|
||||
{
|
||||
// store conditon of all system components, hold in RAM
|
||||
// 0 means unknown, not yet tested/used
|
||||
// 1 means OK
|
||||
// 50..99 = HINT / Notification
|
||||
// 100..150 = WARNING
|
||||
// 200..250 = ERROR
|
||||
|
||||
uint8_t ram;
|
||||
uint8_t intEe;
|
||||
uint8_t extEe;
|
||||
|
||||
uint8_t rtc; // 1: time/date OK 100: time not plausible 200: hardware error
|
||||
uint8_t boardHw;
|
||||
uint8_t printer;
|
||||
uint8_t modem;
|
||||
|
||||
uint8_t signal; // 1...99
|
||||
uint8_t regist; // 100:not 1:reg 2:ping OK 3:gotTime
|
||||
uint8_t mdbBus;
|
||||
uint8_t coinChecker; // EMP, OMP or mei-cashflow
|
||||
|
||||
uint8_t coinEscrow;
|
||||
uint8_t mifareReader;
|
||||
uint8_t creditTerm;
|
||||
uint8_t coinReject;
|
||||
|
||||
uint8_t coinSafe;
|
||||
uint8_t billSafe;
|
||||
uint8_t voltage; // 1:11..14V
|
||||
uint8_t temper;
|
||||
|
||||
uint8_t poweronTest;
|
||||
uint8_t doorState; // 1: alles zu 200: t?r 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
|
||||
|
||||
uint8_t coinBlocker; // can only be tested by usage
|
||||
uint8_t billReader; // can only be tested by usage
|
||||
uint8_t ResetReason;
|
||||
uint8_t allModulesChecked;
|
||||
|
||||
uint8_t alarmState;
|
||||
uint8_t res11;
|
||||
uint8_t res12;
|
||||
uint8_t res13;
|
||||
|
||||
};
|
||||
|
||||
struct T_dynamicCondition
|
||||
{
|
||||
char allDoorsDebounced;
|
||||
char openedAuthorized;
|
||||
uint8_t CBinDebounced; // 0:fehlt 1:drin
|
||||
char upperDoor; // 99: undefined 0:closed 1:open
|
||||
char middleDoor; // 99: undefined 0:closed 1:open
|
||||
char lowerDoor; // 99: undefined 0:closed 1:open
|
||||
char reserve;
|
||||
char billBox;
|
||||
char modeAbrech;
|
||||
char onAlarm; // 0:alarm aus 1:alarm 2:alarm mit Sirene 3: Sirenentest
|
||||
char nowCardTest;
|
||||
char nowPayment; // not used, always 0
|
||||
char lastMifCardType;
|
||||
uint8_t lastSDoorState;
|
||||
uint8_t lastVDoorState;
|
||||
uint8_t lastCBstate;
|
||||
char paymentInProgress;
|
||||
// 0: stopped by timeout
|
||||
// 1: running 2: wait4lastCoin
|
||||
// 3: payment stopped manually, coins in Escrow
|
||||
// 4: payment stopped autom, amount collected, coins in Escrow
|
||||
// 5: payment stopped, escrow full, coins in Escrow
|
||||
// 6: coins encashed 7:coins returned
|
||||
// 8: CoinChecker or MDB on Error
|
||||
|
||||
|
||||
char res1;
|
||||
uint16_t U_Batt;
|
||||
uint16_t Temperatur;
|
||||
uint16_t nrCoinsInBox;
|
||||
uint32_t amountInBox;
|
||||
uint32_t totalTransVolume;
|
||||
uint32_t totalNrOfVends;
|
||||
char jsonValid_config;
|
||||
char jsonValid_device;
|
||||
char jsonValid_cash;
|
||||
char jsonValid_print;
|
||||
char jsonValid_serial;
|
||||
char jsonValid_time;
|
||||
char lastFileType;
|
||||
// 44
|
||||
uint8_t MifCardHolder[8];
|
||||
uint8_t resultOfLastTemplPrint;
|
||||
// 0: unknown or printing in progress
|
||||
// 1: OK, doc was printed 2: error, doc was not printed
|
||||
uint8_t lastPrinterStatus;
|
||||
// 0: printer OK
|
||||
// bit0: near paper end bit1: no paper
|
||||
// bit2: temperature error bit3: error head open
|
||||
// bit4: paper jam in cutter
|
||||
// bit6: no response bit7: serial rec. error
|
||||
// bit5: printer not ready
|
||||
uint8_t startupTestIsRunning;
|
||||
//54
|
||||
uint8_t MifCardHolder[8];
|
||||
uint8_t resultOfLastTemplPrint;
|
||||
// 0: unknown or printing in progress
|
||||
// 1: OK, doc was printed 2: error, doc was not printed
|
||||
uint8_t lastPrinterStatus;
|
||||
// 0: printer OK
|
||||
// bit0: near paper end bit1: no paper
|
||||
// bit2: temperature error bit3: error head open
|
||||
// bit4: paper jam in cutter
|
||||
// bit6: no response bit7: serial rec. error
|
||||
// bit5: printer not ready
|
||||
uint8_t startupTestIsRunning;
|
||||
|
||||
//54
|
||||
};
|
||||
|
||||
struct T_extTime {
|
||||
struct T_extTime
|
||||
{
|
||||
uint8_t Hours;
|
||||
uint8_t Min;
|
||||
uint8_t Sec;
|
||||
@ -258,8 +303,10 @@ struct T_extTime {
|
||||
uint8_t res4;
|
||||
uint16_t res5;
|
||||
uint32_t MinutesOfMillenium;
|
||||
|
||||
};
|
||||
|
||||
|
||||
typedef uint8_t UCHAR;
|
||||
typedef uint16_t UINT;
|
||||
|
||||
@ -268,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 c² (MW)
|
||||
UCHAR kindOfCoinChecker; // 0: without 1=EMP820 2=EMP900 3=currenza c² (MW)
|
||||
UCHAR kindOfMifareReader; // by now only stronglink SL025 =1
|
||||
UCHAR suppressSleepMode; // 0:sleep allowed 1: no sleep
|
||||
|
||||
@ -293,14 +340,14 @@ struct T_devices
|
||||
};
|
||||
|
||||
|
||||
class hwinf {
|
||||
public:
|
||||
enum class DownloadResult {OK, ERROR, TIMEOUT, NOP};
|
||||
enum class FileTypeJson {CONFIG=1, DEVICE, CASH, SERIAL, TIME, PRINTER};
|
||||
|
||||
class hwinf
|
||||
{
|
||||
|
||||
public:
|
||||
virtual ~hwinf() {}
|
||||
|
||||
virtual QStringList dc_getStatus() const = 0;
|
||||
|
||||
|
||||
// $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
||||
// Use serial interface and protocol stack in Cashagent-Library
|
||||
@ -310,18 +357,18 @@ public:
|
||||
// Furthermore the Cashagent-Library answers with status strings about sending and reading result
|
||||
// $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
|
||||
|
||||
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
|
||||
// BaudNr: 0:1200 1:9600 2:19200 3:38400 4:57600 5:115200
|
||||
// BaudStr: for exapmle "19200"
|
||||
// ComName: for example "COM48"
|
||||
// connect: 0, 1
|
||||
|
||||
virtual bool dc_closeSerial(void) const = 0;
|
||||
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
|
||||
|
||||
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)
|
||||
|
||||
|
||||
@ -332,21 +379,7 @@ public:
|
||||
|
||||
virtual bool test_serialIsOn(void) const =0;
|
||||
|
||||
virtual bool dc_updateDC(QString binFileName,
|
||||
QString baudrate,
|
||||
QString comPort) const = 0;
|
||||
// download binary file down into device controller
|
||||
|
||||
virtual bool dc_updatePrinterTemplate(enum FileTypeJson type,
|
||||
QVector<int> templateIdx,
|
||||
QVector<QString> fnames,
|
||||
QString br,
|
||||
QString serial = QString()) const = 0;
|
||||
|
||||
virtual bool dc_printTemplate(enum FileTypeJson type,
|
||||
QVector<int> templateIdx,
|
||||
QString br,
|
||||
QString serial = QString()) const = 0;
|
||||
|
||||
virtual void dc_autoRequest(bool on) const =0;
|
||||
// on = true: select that all READ-Requests are sent automatically
|
||||
@ -363,7 +396,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"
|
||||
// plBufSizz=size of host buffer
|
||||
// plBufSizz=size of host buffer
|
||||
|
||||
virtual void dc_requTestResponse() const =0;
|
||||
// tell DC2 to send a test-string, useful to see if cable and baudrate is OK
|
||||
@ -484,10 +517,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,0°C 100=0,0°C 141=20,5°C 400=150,0°C)
|
||||
|
||||
virtual QString dc_getTemperaturStr(void) const =0;
|
||||
// as string like "-12,5°C"
|
||||
// as string like "-12,5°C"
|
||||
|
||||
virtual uint32_t dc_getVoltage(void) const =0;
|
||||
// as value in mV, 0...65,535V
|
||||
@ -642,7 +675,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: 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)
|
||||
@ -748,7 +781,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 = 0°, 90°, 180° 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;
|
||||
@ -806,29 +839,36 @@ public:
|
||||
// up to 8 dynamic values can be defined in the template ("print val3 here") and will be sent with printing command
|
||||
// example: print current time at this point (the time of printing not the storage time!!)
|
||||
|
||||
virtual void pri_startTicketDesign(void) const =0;
|
||||
// obsolete
|
||||
//virtual void pri_startTicketDesign(void) const =0;
|
||||
// start for every new printer document, reseting collecting buffer
|
||||
|
||||
// all further functions write/append text, numbers and command to the ticket-buffer, up to 1278 bytes allowed
|
||||
// return val of the appending functions: true=ok false=too long, buffer full
|
||||
|
||||
virtual int pri_TD_getCurrentSize(void) const =0;
|
||||
// obsolete
|
||||
//virtual int pri_TD_getCurrentSize(void) const =0;
|
||||
// retval: 0...1278
|
||||
|
||||
virtual bool pri_TD_addText(QByteArray text) const =0;
|
||||
// obsolete
|
||||
//virtual bool pri_TD_addText(QByteArray text) const =0;
|
||||
// example: pri_TD_addText("Hello") const =0;
|
||||
// example: pri_TD_addText(tempStr) const =0;
|
||||
// retval: true=ok false=too long, buffer full
|
||||
|
||||
virtual bool pri_TD_addValue(int val) const =0;
|
||||
// obsolete
|
||||
//virtual bool pri_TD_addValue(int val) const =0;
|
||||
// +/- 0...2^(31)
|
||||
|
||||
virtual bool pri_TD_addNewLine(void) const =0;
|
||||
// obsolete
|
||||
//virtual bool pri_TD_addNewLine(void) const =0;
|
||||
|
||||
virtual bool pri_TD_addSign(char sign) const =0;
|
||||
// obsolete
|
||||
//virtual bool pri_TD_addSign(char sign) const =0;
|
||||
// example: '.' ' ' 0x20 'W' '$'
|
||||
|
||||
virtual bool pri_TD_addCommand(char group, char attribute, char p1, char p2, char p3, char p4, char p5) const =0;
|
||||
// obsolete
|
||||
//virtual bool pri_TD_addCommand(char group, char attribute, char p1, char p2, char p3, char p4, char p5) const =0;
|
||||
// always add 8 byte to the ticket layout: ESC & group & attribute & parameter1...5
|
||||
/* complete list of possible commands:
|
||||
group 50 : paper
|
||||
@ -869,11 +909,13 @@ public:
|
||||
|
||||
*/
|
||||
|
||||
virtual char prn_clearDocument(uint8_t documentNumber) const =0;
|
||||
// obsolete
|
||||
//virtual char prn_clearDocument(uint8_t documentNumber) const =0;
|
||||
// clear memory buffer for ONE document
|
||||
// function takes a second! don't send right before "store doc"
|
||||
|
||||
virtual bool prn_store_Document(uint8_t documentNumber ) const =0;
|
||||
// obsolete
|
||||
//virtual bool prn_store_Document(uint8_t documentNumber ) const =0;
|
||||
// send the predefined Layout (generated with above TD functions) to DeviceController to save
|
||||
// documentNumber=0...15
|
||||
// maximal 1280 bytes each
|
||||
@ -884,7 +926,8 @@ public:
|
||||
// the place in the ticket layout is predefined (already in DC memory)
|
||||
// the dynamics are first calculated at printing time
|
||||
|
||||
virtual bool prn_printDocument(uint8_t documentNumber, struct T_dynDat *dynTicketData) const =0;
|
||||
// obsolete
|
||||
//virtual bool prn_printDocument(uint8_t documentNumber, struct T_dynDat *dynTicketData) const =0;
|
||||
|
||||
|
||||
// 36
|
||||
@ -1276,10 +1319,10 @@ public:
|
||||
|
||||
virtual void bl_rebootDC(void) const =0;
|
||||
|
||||
virtual void bl_startBL(void) const = 0;
|
||||
virtual void bl_startBL(void) const =0;
|
||||
// send command within 4s after DC power-on, otherwise bl is left
|
||||
|
||||
virtual bool bl_checkBL(void) const = 0;
|
||||
virtual void bl_checkBL(void) const =0;
|
||||
// send command to verify if bl is up
|
||||
|
||||
virtual bool bl_isUp(void) const =0;
|
||||
@ -1316,7 +1359,7 @@ public:
|
||||
|
||||
|
||||
// Komplett-schreib Funktion, noch nicht getestet
|
||||
// Nachteil: keine Rückmeldung wie lang's noch dauert
|
||||
// Nachteil: keine Rückmeldung wie lang's noch dauert
|
||||
//virtual void bl_startSending(void) const=0;
|
||||
// call once after BL is working and file is loaded
|
||||
//virtual void bl_sendFile(void) const=0;
|
||||
@ -1342,7 +1385,7 @@ public:
|
||||
buf[4]=GlobTime.Month;
|
||||
buf[5]=GlobTime.Day;
|
||||
buf[6]=GlobTime.DOW;
|
||||
buf[7]=' '; // immer auf 32bit auffüllen sonst Speicherproblem beim Master!
|
||||
buf[7]=' '; // immer auf 32bit auffüllen sonst Speicherproblem beim Master!
|
||||
uitmp=GlobTime.MinOfDay;
|
||||
buf[8]=swl_getOneByteFromUint(uitmp, 0);
|
||||
buf[9]=swl_getOneByteFromUint(uitmp, 1);
|
||||
@ -1453,6 +1496,15 @@ public:
|
||||
// 17.4.23TS: extended to 32bit
|
||||
|
||||
virtual uint8_t cash_paymentProcessing(void) const=0;
|
||||
// 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
|
||||
|
||||
|
||||
virtual uint32_t getInsertedAmount(void) const=0;
|
||||
|
||||
@ -1484,14 +1536,14 @@ public:
|
||||
// retval: 6 bytes, bit coded, 1=event keeps DC awake
|
||||
|
||||
virtual uint8_t sys_getWakeReason(void) const=0;
|
||||
// Master was woken by following reason:
|
||||
// 1: MDB Event
|
||||
// 2: Coin Event
|
||||
// ( 3: Master Event) - will not set the wake line
|
||||
// ( 4: 32s pulse) - will not set the wake line
|
||||
// 5: Door Event
|
||||
// ( 6: Diag Event) - will not set the wake line
|
||||
// 7: 30min-Pulse for HB
|
||||
// Master was woken by following reason:
|
||||
// 1: MDB Event
|
||||
// 2: Coin Event
|
||||
// ( 3: Master Event) - will not set the wake line
|
||||
// ( 4: 32s pulse) - will not set the wake line
|
||||
// 5: Door Event
|
||||
// ( 6: Diag Event) - will not set the wake line
|
||||
// 7: 30min-Pulse for HB
|
||||
|
||||
virtual void sys_getDeviceConditions(uint8_t *leng, uint8_t *data) const=0;
|
||||
/*
|
||||
@ -1530,6 +1582,8 @@ public:
|
||||
*/
|
||||
|
||||
virtual void sys_getDeviceConditions(struct T_moduleCondition *devCond) const=0;
|
||||
|
||||
|
||||
virtual void sys_getDynMachineConditions(uint8_t *leng, uint8_t *data) const=0;
|
||||
/*
|
||||
|
||||
@ -1602,8 +1656,10 @@ public:
|
||||
|
||||
virtual uint16_t cash_getNrCoinsInVault(void) const=0;
|
||||
|
||||
|
||||
virtual uint8_t prn_getPrintResult() const=0;
|
||||
// return: 0: unknown
|
||||
// 1: OK - last template was printed succesful
|
||||
// 2: error - last template was not printed
|
||||
|
||||
// in case of print-error get detailed error:
|
||||
virtual uint8_t prn_getCurrentPrinterState() const=0;
|
||||
@ -1614,61 +1670,27 @@ public:
|
||||
// bit6: no response bit7: serial rec. error
|
||||
// bit5: printer not ready
|
||||
|
||||
|
||||
virtual void sys_sendDeviceParameter(struct T_devices *deviceSettings) const=0;
|
||||
|
||||
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
|
||||
virtual bool sys_sendingTest(void) const =0;
|
||||
|
||||
1. check if DC startup test is through, retrigger if not
|
||||
2. get results and find errors
|
||||
3. in case of error check if component is used (e.g. billreader is seldom used)
|
||||
4: check doors
|
||||
5. return value: 0: no response from DC
|
||||
1: no Test results and Test not running. need retrigger!
|
||||
2: state not clear by now, test ongoing, wait
|
||||
3: Service or battery door is open, goto INTRUSION MODE
|
||||
from here: after valid ID-card goto SERVICE MODE
|
||||
4: vault door is open, goto INTRUSION MODE
|
||||
from here: after valid ID-card and vault door closed goto TEST MODE
|
||||
in TEST MODE: complete system check decides if vending mode allowed
|
||||
5: All doors are closed but errors found,
|
||||
goto OOO MODE (out-of-order)
|
||||
from here: run system test until problem is fixed
|
||||
6: All doors are closed, no error, maybe warnings,
|
||||
goto VENDING MODE (normal operation)
|
||||
(priority sinks from 0 to 6)
|
||||
virtual void prn_requestCurrentDynData(void) const =0;
|
||||
|
||||
--------------------------------------------------------------------------------------------- */
|
||||
virtual bool prn_getCurrentDynamicPrnValuesFromDC(uint8_t *dynPrnVal ) const =0;
|
||||
// which was sent with: bool prn_sendDynamicPrnValues(uint8_t *dynPrnVal ) const override;
|
||||
|
||||
virtual uint8_t sys_componentAssessment(void) const=0;
|
||||
// this function decides if vending mode is possible, independant from door
|
||||
// return >0 in case of error
|
||||
// is inncluded in sys_superviseSystem
|
||||
virtual bool prn_dynDataAreEqual(uint8_t *buf) const =0;
|
||||
|
||||
virtual uint8_t sys_superviseSystem(void) const=0;
|
||||
// this function proofs if vending is possible depending of doors state
|
||||
|
||||
virtual uint8_t sys_getSystemErrors(void) const=0;
|
||||
virtual bool prn_printKombiticket(uint8_t nrOfKombi) const=0;
|
||||
// print four of the templates loaded by Json prior
|
||||
// nr = 1..8
|
||||
|
||||
|
||||
// retrigger System-Check with:
|
||||
// bool hwapi::sys_runCompleteTest(void) const
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
signals:
|
||||
virtual void hwapi_templatePrintFinished_OK(void) const=0;
|
||||
@ -1707,12 +1729,19 @@ signals:
|
||||
// 14.04.2023: V3.4 new features extended: sys_getDynMachineConditions, sys_getDeviceConditions and
|
||||
// rtc_getExtendedTime return struct in addition. New function to select and get VaultRecord
|
||||
//
|
||||
// 19.04.2023: V3.5 new function: sys_getWakeReason();
|
||||
// 17.05.2023: V3.6 new function: cash_isCollectionActive(), cash_isPayProcessActive()
|
||||
// new signals: hwapi_coinCollectionJustStopped, hwapi_coinCollectionJustStarted
|
||||
// getAllInsertedCoins() fixed, also in datif and storeINdata
|
||||
|
||||
|
||||
|
||||
//#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"
|
||||
//#define HWINF_iid "Atb.Psa1256ptu5.software.HWapi/3.4"
|
||||
#define HWINF_iid "Atb.Psa1256ptu5.software.HWapi/3.5"
|
||||
//#define HWINF_iid "Atb.Psa1256ptu5.software.HWapi/3.5"
|
||||
#define HWINF_iid "Atb.Psa1256ptu5.software.HWapi/3.6"
|
||||
|
||||
|
||||
|
||||
|
@ -122,10 +122,11 @@ void ATBDeviceControllerPlugin::requestPrintTicket(const QHash<QString, QVariant
|
||||
memcpy((char*)dynTicketData->vendingPrice, ba_amount.data(), std::min(ba_amount.size(),8));
|
||||
|
||||
QByteArray ba_parkingEndTime = codec->fromUnicode(parkingEndDateTime.toString("hh:mm"));
|
||||
memcpy((char*)dynTicketData->parkingEndTime, ba_parkingEndTime.data(), std::min(ba_parkingEndTime.size(),8));
|
||||
memcpy((char*)dynTicketData->parkingEnd, ba_parkingEndTime.data(), std::min(ba_parkingEndTime.size(),8));
|
||||
|
||||
QByteArray ba_parkingEndDate = codec->fromUnicode(parkingEndDateTime.toString("dd.MM.yy"));
|
||||
memcpy((char*)dynTicketData->parkingEndDate, ba_parkingEndDate.data(), std::min(ba_parkingEndDate.size(),8));
|
||||
memcpy((char*)dynTicketData->currentTime, ba_parkingEndDate.data(), std::min(ba_parkingEndDate.size(),8));
|
||||
// ! and yes... 'ParkingEndDate' is 'currentTime'
|
||||
|
||||
QByteArray ba_currentDate = codec->fromUnicode(currentDateTime.toString("dd.MM.yy"));
|
||||
memcpy((char*)dynTicketData->currentDate, ba_currentDate.data(), std::min(ba_currentDate.size(),8));
|
||||
|
Loading…
Reference in New Issue
Block a user