forked from GerhardHoffmann/DCLibraries
Add collected changes from T.Sax
This commit is contained in:
92
include/dump.txt
Executable file
92
include/dump.txt
Executable file
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
void incTextBuffer(void)
|
||||
{
|
||||
runProc_prnSeqNr++;
|
||||
runProc_pointPrnTxt=0;
|
||||
if (runProc_prnSeqNr>127)
|
||||
runProc_prnSeqNr=127;
|
||||
runProc_prnCmdSeq[runProc_pointPrnCmd]=1;
|
||||
runProc_prnCmdPara[runProc_pointPrnCmd++]=runProc_prnSeqNr;
|
||||
}*/
|
||||
/*
|
||||
void T_runProc::subAppendNxtTxt(char *textLine)
|
||||
{
|
||||
// append given text to current sequence, respect max. sequ.length
|
||||
|
||||
// also send a command "print text buffer nn" ==1 once for each buffer
|
||||
//static uint8_t runProc_prnCmdSeq[512];
|
||||
//static uint8_t runProc_prnCmdPara[512];
|
||||
//static uint16_t runProc_pointPrnCmd;
|
||||
|
||||
int sl=strlen(textLine);
|
||||
if (sl>1024) sl=1024;
|
||||
textLine[sl]=0;
|
||||
if (runProc_prnSeqNr==0 && runProc_pointPrnTxt<3)
|
||||
{
|
||||
// then this is the very first text entry
|
||||
// store command to print this buffer
|
||||
runProc_prnCmdSeq[runProc_pointPrnCmd]=1;
|
||||
runProc_prnCmdPara[runProc_pointPrnCmd++]=runProc_prnSeqNr;
|
||||
}
|
||||
if ( (runProc_pointPrnTxt + sl) > 1023)
|
||||
{
|
||||
incTextBuffer();
|
||||
|
||||
}
|
||||
runProc_prnTextSeq[runProc_prnSeqNr].append(textLine);
|
||||
|
||||
//for (nn=0; nn<sl; nn++)
|
||||
//{
|
||||
//runProc_prnTextSeq[runProc_prnSeqNr][runProc_pointPrnTxt+nn]=textLine[nn];
|
||||
//}
|
||||
}*/
|
||||
|
||||
// qCritical() << "emitting signal payCancelled";
|
||||
// emit runProc_payCancelled();
|
||||
/*
|
||||
// gabs bei Szeged, jetzt nicht mehr:
|
||||
if (payInProg==8)
|
||||
{
|
||||
// coin checker faulty, cannot start
|
||||
if (hwapi_paymentStarted==1)
|
||||
{
|
||||
hwapi_paymentStarted=90; // stop due to error
|
||||
qCritical() << "emitting signal coinCollectionAborted 1";
|
||||
emit runProc_coinCollectionAborted();
|
||||
//sendFDcmd_set(156, 0,0, 2,0,0,0); // cancel payment
|
||||
}
|
||||
return 10; // error cannot start
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
static uint8_t Sdata_DeviceParameter[64];
|
||||
static uint8_t Sdata_DevParaLen;
|
||||
|
||||
uint8_t T_runProc::epi_store64BdevParameter(uint8_t length, uint8_t *buf)
|
||||
{
|
||||
// HWapi writes data to be stored
|
||||
uint8_t nn;
|
||||
for (nn=0; nn<length; nn++)
|
||||
Sdata_DeviceParameter[nn]=buf[nn];
|
||||
for (nn=length; nn<64; nn++)
|
||||
Sdata_DeviceParameter[nn]=0;
|
||||
|
||||
Sdata_DevParaLen=length;
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8_t T_runProc::epi_restore64BdevParameter(uint8_t *length, uint8_t *buf)
|
||||
{
|
||||
|
||||
for (uint8_t nn=0; nn<Sdata_DevParaLen; nn++)
|
||||
buf[nn]=Sdata_DeviceParameter[nn];
|
||||
*length=Sdata_DevParaLen;
|
||||
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
@@ -2,6 +2,7 @@
|
||||
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()
|
||||
@@ -14,12 +15,32 @@ matching interfaces.h:
|
||||
// V3.2 Bootloader improvement
|
||||
// 12.04.2023: V3.3 new features extended: loading and using Json-files, cash-collection, cash-data-logging
|
||||
|
||||
|
||||
14.7.23TS: patch for correct printer state in line 3364 in sys_getDeviceConditions(struct T_moduleCondition *devCond) const
|
||||
|
||||
8.9.2023 two new functions (end of file) for mifare test. Interface version 4.4 DC4.40...4.43
|
||||
|
||||
14.09.2023: Verriegelung eingebaut, nur noch gültige Abr.Daten zurückgeben, Suchbegriff: <epi_restoreVaultRecord>
|
||||
alle Mifare-Funktionen ueberprueft und ggf verbessert
|
||||
18.09.2023: Signal "Kasse entnommen" und Signale "Tuer auf/zu" ueberprueft
|
||||
|
||||
20.9.2023: in datif die Abfrage der DynMachineData massiv beschleunigt
|
||||
und hier in hwapi die entprellten Werte fuer Tueren und Kasse verwenden.
|
||||
Problem war: Signal "Kasse entnommen" war zu langsam -> manchmal abr nicht gesendet
|
||||
|
||||
14.3.24 new function bool hwapi::cash_isCollectionStarted(void) const
|
||||
padding three struct to 64 byte to avoid stack overflow when using
|
||||
|
||||
//#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"
|
||||
|
||||
V4.0 6.9.2023: activating DC-Bootloader in slve-lib (SM)
|
||||
|
||||
23.5.2024: prn_getHwState() fixed and moved down to runProc with a wrapper in hwapi, current version: 5.5
|
||||
several new functions for "direct ticket print", without the dueway loading jsons to DC and cmd DC to print
|
||||
The same rules as before apply to the json, but it can have any arbitrary length
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@@ -569,12 +590,10 @@ public:
|
||||
// read printer condition and settings
|
||||
|
||||
uint8_t prn_getHwState(struct Tprn_hw_state *prn_hw_state) const override;
|
||||
// retval: status byte
|
||||
// byte 0 = 0: prnter OK, >0: error
|
||||
// bit0: paper low 1: no paper 2: temperature error
|
||||
// 3: head open 4: paper jam in cutter
|
||||
// 6: no response 7: bad response from printer
|
||||
// and return struct "Tprn_hw_state"
|
||||
// return value: =prn_hw_state[0]
|
||||
// 0:unknown 1: printer OK 100: printer OK but paper near end
|
||||
// 200: not connected 201: printer on error 202: no paper
|
||||
|
||||
|
||||
bool prn_isUpAndReady(void) const override;
|
||||
// true: printer is powered, serial is ok, no error, printer is connected and resonding
|
||||
@@ -603,7 +622,7 @@ public:
|
||||
|
||||
void prn_movePaper(uint8_t wayInMm, uint8_t direction) const override;
|
||||
//direction: 1=forward 2=backward
|
||||
//
|
||||
|
||||
void prn_setFonts(uint8_t font, uint8_t size, uint8_t width, uint8_t height) const override;
|
||||
// font = kind of font 5...11 (0..22)
|
||||
// size = 6...20, 9..9: too tiny 10: small ...12 = normal size ...20=huge
|
||||
@@ -1037,7 +1056,6 @@ public:
|
||||
|
||||
void sys_getDynMachineConditions(struct T_dynamicCondition *dynMachCond) const override;
|
||||
|
||||
|
||||
uint32_t cash_getAmountInVault(void) const override;
|
||||
|
||||
uint16_t cash_getNrCoinsInVault(void) const override;
|
||||
@@ -1358,6 +1376,30 @@ public:
|
||||
|
||||
virtual QObject const *getAPI() override;
|
||||
|
||||
void mod_switchResetline(void) override;
|
||||
|
||||
|
||||
|
||||
|
||||
// 22.5.2024 direct ticket printing
|
||||
|
||||
void prn_translateLocalPrinterJson(QByteArray jsonFile2print) const override;
|
||||
// load, parse, translate and save the file
|
||||
|
||||
void prnStoreDynamics(char *bufferDynPrintVars[], uint8_t nrOfDyns) const override;
|
||||
// store nrOfDyns (up to 16) dynamics before printing
|
||||
// max length = 16 byte per dynamic
|
||||
// 16 strings with up to 16bytes each
|
||||
|
||||
void prn_printTranslatedTicket(void) const override;
|
||||
|
||||
uint8_t prn_waitForDirectTicket(void) const override;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
signals:
|
||||
void hwapi_reportDCDownloadStatus(QString const&) const override;
|
||||
void hwapi_reportDCDownloadSuccess(QString const&) const override;
|
||||
@@ -1389,6 +1431,8 @@ signals:
|
||||
|
||||
void hwapi_coinAttached() const override;
|
||||
|
||||
|
||||
|
||||
private slots:
|
||||
//void hwapi_slotPrintFinished_OK(void);
|
||||
//void hwapi_slotPrintFinished_Err(void);
|
||||
|
@@ -179,57 +179,64 @@ struct T_moduleCondition
|
||||
// 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;
|
||||
// 10
|
||||
uint8_t coinChecker; // EMP, OMP or mei-cashflow
|
||||
uint8_t coinEscrow;
|
||||
|
||||
uint8_t mifareReader; // 0: unknown 1=OK 200=no response 201=wrong response 202: Reader reports HW-error
|
||||
uint8_t creditTerm;
|
||||
uint8_t coinReject;
|
||||
uint8_t coinSafe;
|
||||
|
||||
uint8_t billSafe;
|
||||
uint8_t voltage; // 1:11..14V
|
||||
uint8_t temper;
|
||||
uint8_t poweronTest;
|
||||
// 20
|
||||
|
||||
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
|
||||
uint8_t coinBlocker; // can only be tested by usage
|
||||
uint8_t billReader; // can only be tested by usage
|
||||
uint8_t doorWasOpened; // 1: all doors are closed 200: any door was just opened
|
||||
uint8_t changer;
|
||||
uint8_t coinBlocker;
|
||||
|
||||
uint8_t billReader;
|
||||
uint8_t ResetReason;
|
||||
uint8_t allModulesChecked;
|
||||
uint8_t alarmState;
|
||||
|
||||
uint8_t fuses;
|
||||
uint8_t res11;
|
||||
uint8_t res12;
|
||||
// 30
|
||||
uint8_t res13;
|
||||
// 32
|
||||
|
||||
uint8_t padd00;
|
||||
uint8_t padd01;
|
||||
uint8_t padd02;
|
||||
uint8_t padd03;
|
||||
//36
|
||||
uint32_t padd04;
|
||||
uint32_t padd05;
|
||||
uint32_t padd06;
|
||||
uint32_t padd07;
|
||||
// 50
|
||||
// 52
|
||||
uint32_t padd08;
|
||||
uint32_t padd09;
|
||||
uint32_t padd10;
|
||||
uint16_t padd11;
|
||||
// 64
|
||||
};
|
||||
|
||||
// ATTENTION: struct length must be 64 exactly!!!
|
||||
|
||||
struct T_dynamicCondition
|
||||
{
|
||||
char allDoorsDebounced;
|
||||
@@ -248,7 +255,7 @@ struct T_dynamicCondition
|
||||
char lastMifCardType;
|
||||
uint8_t lastSDoorState;
|
||||
uint8_t lastVDoorState;
|
||||
uint8_t lastCBstate;
|
||||
uint8_t lastCBstate; // =0, not used
|
||||
char paymentInProgress;
|
||||
// Version Szeged: aug2023
|
||||
// 0: stopped by timeout
|
||||
@@ -291,7 +298,10 @@ struct T_dynamicCondition
|
||||
char jsonValid_serial;
|
||||
char jsonValid_time;
|
||||
char lastFileType;
|
||||
|
||||
uint8_t MifCardHolder[8];
|
||||
// 51
|
||||
|
||||
uint8_t resultOfLastTemplPrint;
|
||||
// 0: unknown or printing in progress
|
||||
// 1: OK, doc was printed 2: error, doc was not printed
|
||||
@@ -302,17 +312,36 @@ struct T_dynamicCondition
|
||||
// bit4: paper jam in cutter
|
||||
// bit6: no response bit7: serial rec. error
|
||||
// bit5: printer not ready
|
||||
uint8_t startupTestIsRunning;
|
||||
uint8_t startupTestIsRunning; // =0, not used
|
||||
uint16_t empty; // neu 3.7.24, dieser Platz wird vom Compiler im Ram
|
||||
// freigehalten weil naechster Wert ein Long ist
|
||||
// 56
|
||||
// new since 7.5.24
|
||||
uint32_t totalNrOfCuts;
|
||||
uint16_t nextAccountNumber;
|
||||
uint16_t nrOfBillsInBox;
|
||||
//uint16_t padd07; // raus am 3.7.24
|
||||
// 64
|
||||
|
||||
// rest comes with new cmd:
|
||||
uint32_t amountInBillbox;
|
||||
uint16_t UbatAtLastPrint;
|
||||
uint16_t pad01;
|
||||
uint32_t reserve01;
|
||||
uint32_t reserve02;
|
||||
uint32_t reserve03;
|
||||
uint32_t reserve04;
|
||||
uint32_t reserve05;
|
||||
uint32_t reserve06;
|
||||
uint32_t reserve07;
|
||||
uint32_t reserve08;
|
||||
uint32_t reserve09;
|
||||
uint32_t reserve10;
|
||||
uint32_t reserve11;
|
||||
uint32_t reserve12;
|
||||
uint32_t reserve13;
|
||||
uint32_t reserve14;
|
||||
|
||||
uint8_t padd01;
|
||||
uint8_t padd02;
|
||||
uint8_t padd03;
|
||||
//50
|
||||
uint32_t padd04;
|
||||
uint32_t padd05;
|
||||
uint32_t padd06;
|
||||
uint16_t padd07;
|
||||
// 64
|
||||
};
|
||||
|
||||
struct T_extTime
|
||||
@@ -358,24 +387,37 @@ struct T_devices
|
||||
UCHAR kindOfCoinChecker; // 0: without 1=EMP820 2=EMP900 3=currenza Csquare (MW)
|
||||
UCHAR kindOfMifareReader; // by now only stronglink SL025 =1
|
||||
UCHAR solarPower; // 1:sleep allowed 0: no sleep
|
||||
|
||||
UCHAR kindOfModem; // 0:off 1:Sunlink
|
||||
UCHAR kindOfCreditcard; // 0:off 1:Feig NFC
|
||||
UCHAR CoinEscrow;
|
||||
UCHAR CoinRejectUnit;
|
||||
|
||||
UCHAR CoinShutter;
|
||||
UCHAR BillAcceptor;
|
||||
// 10
|
||||
UCHAR usevaultLock;
|
||||
UCHAR autoAlarm; // 1: switch on siren for 1min in doors opened unauthorized
|
||||
|
||||
UCHAR autoOpen; // 1: open door covers after valid ATBcard
|
||||
UCHAR printAccReceipt; // 0/1
|
||||
UCHAR printDoorReceipt;
|
||||
UCHAR printTokenTicket;
|
||||
|
||||
UINT VaultFullWarnLevel;
|
||||
UINT VaultFullErrorLevel;
|
||||
// 30
|
||||
// 20
|
||||
UINT BattEmptyWarnLevel;
|
||||
UINT BattEmptyErrorLevel;
|
||||
|
||||
UCHAR useForeignCharacters;
|
||||
UCHAR printRefundReceipt;
|
||||
UINT BillFullWarnLevel;
|
||||
UINT BillFullErrorLevel;
|
||||
|
||||
UCHAR housing;
|
||||
UCHAR resUc1;
|
||||
// 32
|
||||
uint32_t padd01;
|
||||
uint32_t padd02;
|
||||
uint32_t padd03;
|
||||
@@ -383,7 +425,7 @@ struct T_devices
|
||||
uint32_t padd05;
|
||||
uint32_t padd06;
|
||||
uint32_t padd07;
|
||||
uint16_t padd08;
|
||||
uint32_t padd08;
|
||||
// 64
|
||||
|
||||
};
|
||||
@@ -417,6 +459,8 @@ struct T_changer
|
||||
uint8_t paymentRunning; // 1: coins are accepted
|
||||
uint16_t denomination[16];
|
||||
uint16_t availableTubes; //bitwise 0,1 1=av. bit0 = lowest coin value
|
||||
uint16_t pad;
|
||||
// 64byte
|
||||
};
|
||||
|
||||
struct T_bna
|
||||
@@ -425,19 +469,29 @@ struct T_bna
|
||||
uint8_t setup; // 0: not 1: got valid parameters from device
|
||||
uint8_t FeatureLevel;
|
||||
uint16_t countryCode; // programmed in EMP
|
||||
|
||||
uint16_t scalingFactor; // z.B. 5
|
||||
uint8_t decimalPlace;
|
||||
uint8_t pad1;
|
||||
|
||||
uint16_t stackerCap;
|
||||
uint16_t billSecureLevel;
|
||||
// 12
|
||||
uint8_t hasEscrow;
|
||||
uint8_t accBillTypes[16]; // programmed in EMP z.B. (bit 0..7): 1 2 4 10 20 40 0 0
|
||||
uint16_t currentStackerLevel; // requested number of notes in billbox
|
||||
|
||||
// 31
|
||||
// settings from Master
|
||||
uint16_t intendedAccept; // bit 0 =5€
|
||||
uint16_t pad2;
|
||||
uint16_t billDenomination[16];
|
||||
// 35
|
||||
uint16_t billDenomination[8];
|
||||
// 51
|
||||
uint8_t pad3;
|
||||
uint32_t pad4;
|
||||
uint32_t pad5;
|
||||
uint32_t pad6;
|
||||
// 8.5.24 reduced, 3 bytes too much.
|
||||
|
||||
};
|
||||
|
||||
@@ -1279,16 +1333,17 @@ public:
|
||||
|
||||
// read printer condition and settings
|
||||
|
||||
virtual uint8_t prn_getHwState(struct Tprn_hw_state *prn_hw_state) const {
|
||||
virtual uint8_t prn_getHwState(struct Tprn_hw_state *prn_hw_state) const
|
||||
{
|
||||
Q_UNUSED(prn_hw_state);
|
||||
return 0;
|
||||
}
|
||||
// retval: status byte
|
||||
// byte 0 = 0: prnter OK, >0: error
|
||||
// bit0: paper low 1: no paper 2: temperature error
|
||||
// 3: head open 4: paper jam in cutter
|
||||
// 6: no response 7: bad response from printer
|
||||
// and return struct "Tprn_hw_state"
|
||||
// return value: =prn_hw_state[0]
|
||||
// 0:unknown 1: printer OK 100: printer OK but paper near end
|
||||
// 200: not connected 201: printer on error 202: no paper
|
||||
|
||||
|
||||
|
||||
|
||||
virtual bool prn_isUpAndReady(void) const {
|
||||
return false;
|
||||
@@ -2380,6 +2435,40 @@ public:
|
||||
|
||||
virtual QObject const *getAPI() { return nullptr; }
|
||||
|
||||
virtual void mod_switchResetline() { }
|
||||
|
||||
|
||||
// direct ticket printing
|
||||
// new from 22.5.2024, print Json-Printer-Template which
|
||||
// is stored locally here in PTU memory,
|
||||
// rather then loading several jsons to DC and tell it to print (until now)
|
||||
// the local printer-json can have any length using predefined commands
|
||||
// printing a local printer-json happens like this:
|
||||
// 1) select a file to be printed from memory
|
||||
// 2) load, parse, translate and save the file with following function
|
||||
// 3) set dynamics (values from current transaction)
|
||||
// 4) send saved file to printer one or several times
|
||||
// hint: dynamics can be changed at any time without reloading the ticket, just repeat 3) and 4)
|
||||
|
||||
virtual void prn_translateLocalPrinterJson(QByteArray jsonFile2print) const
|
||||
{ Q_UNUSED(jsonFile2print) }
|
||||
// load, parse, translate and save the file
|
||||
|
||||
virtual void prnStoreDynamics(char *bufferDynPrintVars[], uint8_t nrOfDyns) const
|
||||
{ Q_UNUSED(bufferDynPrintVars); Q_UNUSED(nrOfDyns) }
|
||||
// store nrOfDyns (up to 16) dynamics before printing
|
||||
// max length = 16 byte per dynamic
|
||||
// 16 strings with up to 16bytes each
|
||||
|
||||
virtual void prn_printTranslatedTicket(void) const { }
|
||||
|
||||
virtual uint8_t prn_waitForDirectTicket(void) const { return 0; }
|
||||
// return: 0: just printing, wait
|
||||
// 1: OK - last print was succesful
|
||||
// 2: error - not printed
|
||||
// 2: printer error 3: no connection to DC
|
||||
|
||||
|
||||
|
||||
signals:
|
||||
/*
|
||||
@@ -2422,31 +2511,7 @@ signals:
|
||||
|
||||
virtual void hwapi_coinAttached() const = 0;
|
||||
|
||||
// NOTE: declaring a "pure virtual" "signal" should be an error and thus not valid.
|
||||
/* GH Version, bringt Fehler
|
||||
void hwapi_templatePrintFinished_OK() const;
|
||||
void hwapi_templatePrintFinished_Err() const;
|
||||
|
||||
void hwapi_coinCollectionJustStarted() const;
|
||||
void hwapi_coinCollectionAborted() const;
|
||||
|
||||
void hwapi_gotNewCoin() const;
|
||||
void hwapi_payStopByMax() const;
|
||||
void hwapi_payStopByPushbutton() const;
|
||||
|
||||
void hwapi_payStopByEscrow() const;
|
||||
void hwapi_payStopByError() const;
|
||||
void hwapi_payStopByTimeout() const;
|
||||
void hwapi_payCancelled() const;
|
||||
void hwapi_coinProcessJustStopped() const;
|
||||
|
||||
void hwapi_doorServiceDoorOpened() const;
|
||||
void hwapi_doorVaultDoorOpened() const;
|
||||
void hwapi_doorCoinBoxRemoved() const;
|
||||
void hwapi_doorCoinBoxInserted() const;
|
||||
void hwapi_doorCBinAndAllDoorsClosed() const;
|
||||
void hwapi_doorAllDoorsClosed() const;
|
||||
*/
|
||||
};
|
||||
|
||||
|
||||
@@ -2511,11 +2576,21 @@ signals:
|
||||
// hier von =0 auf {} durch Gerhard
|
||||
//#define HWINF_iid "Atb.Psa1256ptu5.software.HWapi/5.2"
|
||||
// 7.11.2023: bna functions activated
|
||||
#define HWINF_iid "Atb.Psa1256ptu5.software.HWapi/5.3"
|
||||
//#define HWINF_iid "Atb.Psa1256ptu5.software.HWapi/5.3"
|
||||
// 14.3.24:new function bool hwapi::cash_isCollectionStarted(void) const
|
||||
// padding three struct to 64 byte to avoid stack overflow when using
|
||||
// signal coin attached is much faster now
|
||||
|
||||
//#define HWINF_iid "Atb.Psa1256ptu5.software.HWapi/5.4"
|
||||
// 7.may.2024, matches to DC V6, some structs extended
|
||||
// new function: modem reset, dyn. data come with two commands now
|
||||
// released 17.may.2024
|
||||
|
||||
#define HWINF_iid "Atb.Psa1256ptu5.software.HWapi/5.5"
|
||||
// started at 21.5.24, integration of ticket interpreter
|
||||
// see change log in hwapi.h
|
||||
|
||||
|
||||
Q_DECLARE_INTERFACE(hwinf, HWINF_iid)
|
||||
|
||||
|
||||
|
@@ -23,7 +23,6 @@
|
||||
#include "shared_mem_buffer.h"
|
||||
|
||||
|
||||
|
||||
class T_runProc : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -36,6 +35,16 @@ class T_runProc : public QObject
|
||||
|
||||
void restoreDeviceParameter(struct T_devices *deviceSettings);
|
||||
|
||||
void clearPrnFile(void);
|
||||
char subFeedPaper(char *valueStr);
|
||||
bool subGetVariStr(char *valueStr, char *returnStr);
|
||||
//void subAppendNxtTxt(char *textLine);
|
||||
void sub_changeStyle(char *valueStr);
|
||||
void subPrintGrafics(char *valueStr);
|
||||
char prn_directTicket_cycle(void);
|
||||
void runProc_subPerformPrintCmds(uint8_t nextCmd, uint8_t nextPara);
|
||||
uint16_t subStoreTicketText(char *textLine);
|
||||
|
||||
#ifndef THIS_IS_CA_MASTER
|
||||
std::atomic_bool m_coinAttached{false};
|
||||
#endif
|
||||
@@ -53,6 +62,9 @@ public:
|
||||
uint8_t epi_restore64BdevParameter(uint8_t *length, uint8_t *buf);
|
||||
bool doors_supervise(void);
|
||||
uint8_t prn_getHwState(struct Tprn_hw_state *prn_hw_state);
|
||||
// byte 0: 0:unknown 1: printer OK 100: printer OK but paper near end
|
||||
// 200: not connected 201: printer on error 202: no paper
|
||||
|
||||
void bl_completeStart(void);
|
||||
void dc_autoRequest(bool on);
|
||||
void bl_rebootDC(void);
|
||||
@@ -60,6 +72,48 @@ public:
|
||||
void bl_checkBL(void);
|
||||
bool bl_isUp(void);
|
||||
|
||||
// new from 21.5.24 ..................................................................
|
||||
|
||||
uint16_t sys_getCustomerNumber(void);
|
||||
uint16_t sys_getMachineNumber(void);
|
||||
uint16_t sys_getBoroughNumber(void);
|
||||
uint16_t sys_getZoneNumber(void);
|
||||
uint16_t sys_getMachineAlias(void);
|
||||
void sys_getLocation(char *locStr);
|
||||
void prn_sendText(QByteArray *buf);
|
||||
void prn_sendPrnSysCmd(uint8_t para1, uint8_t para2, uint32_t para3);
|
||||
void prn_printBarcode(uint8_t kindOf, uint8_t withText, uint8_t offset, uint8_t rotation, uint8_t dataLeng, uint8_t *data);
|
||||
bool sys_parseFile(QByteArray jsonFile2print);
|
||||
// and copy all keys and values to arrays
|
||||
|
||||
bool sys_translateKeys(void);
|
||||
|
||||
bool sys_interpretPrnCmds(void);
|
||||
|
||||
|
||||
void prn_sendPrnSetup(uint16_t paperSpeed, uint8_t density, uint8_t alignment, uint8_t orientation);
|
||||
// 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!)
|
||||
|
||||
void prnStoreDynamics(char *bufferDynPrintVars[], uint8_t nrOfDyns);
|
||||
// store nrOfDyns (up to 16) dynamics before printing
|
||||
// max length = 16 byte per dynamic
|
||||
|
||||
bool prnRestoreDynamic(uint8_t nrOfDyn, char *bufferOneDyn);
|
||||
// nrOfDyn = 0...15
|
||||
// buffer bufferOneDyn[16] needs length of at least 16 byte
|
||||
|
||||
bool prn_isUpAndReady(void);
|
||||
|
||||
void prnStartDirectPrinting(void);
|
||||
|
||||
uint8_t prn_getDirectPrintResult(void);
|
||||
// return: 0: just printing, wait
|
||||
// 1: OK - last print was succesful
|
||||
// 2: error - not printed
|
||||
// 2: printer error 3: no connection to DC
|
||||
|
||||
signals:
|
||||
//void runProc_templatePrintFinished_OK(void) const override;
|
||||
|
2
include/sendWRcmd.h
Normal file → Executable file
2
include/sendWRcmd.h
Normal file → Executable file
@@ -14,6 +14,8 @@ uint8_t sendWRcmd_getSendBlock160(uint8_t *leng, uint8_t *buf);
|
||||
|
||||
void sendWRcmd_INI(void);
|
||||
|
||||
uint8_t sendWRcmd_getStackSize(void);
|
||||
|
||||
// #define FDCMD_STACKDEPTH 16 / 32
|
||||
// short and long commands are queued into the same stack to guaranty right order
|
||||
void sendFDcmd_clrStack(void);
|
||||
|
5
include/shared_mem_buffer.h
Normal file → Executable file
5
include/shared_mem_buffer.h
Normal file → Executable file
@@ -230,6 +230,9 @@ struct SharedMem
|
||||
uint8_t store_bnaCollect[8];
|
||||
uint8_t store_bnaContent[64];
|
||||
|
||||
// new, 8.5.24
|
||||
uint8_t store_machCon2len;
|
||||
uint8_t store_machCon2[66];
|
||||
|
||||
|
||||
|
||||
@@ -242,7 +245,7 @@ struct SharedMem
|
||||
// ------------------ Data OUTPUT --------------------------------
|
||||
|
||||
// sendWRcmd.cpp
|
||||
#define CMDSTACKDEPTH 16
|
||||
#define CMDSTACKDEPTH 32
|
||||
uint16_t nextAsynchsendCmd0[CMDSTACKDEPTH];
|
||||
uint8_t nrOfCmdsInQueue;
|
||||
|
||||
|
8
include/storeINdata.h
Normal file → Executable file
8
include/storeINdata.h
Normal file → Executable file
@@ -529,7 +529,7 @@ bool epi_areDcDataValid();
|
||||
|
||||
void epi_setDcDataValid(void);
|
||||
|
||||
void epi_resetDcDataValid(void);
|
||||
void epi_resetDcDataValid(char reason);
|
||||
|
||||
|
||||
void epi_clearDynData(void);
|
||||
@@ -626,6 +626,12 @@ void epi_restoreBnaContent(uint8_t *data);
|
||||
|
||||
|
||||
|
||||
void epi_clearDynMachCond2(void);
|
||||
|
||||
void gpi_storeDynMachCond2(uint8_t leng, uint8_t *data);
|
||||
|
||||
void epi_restoreDynMachCond2(uint8_t *leng, uint8_t *data);
|
||||
|
||||
|
||||
|
||||
|
||||
|
33
include/tslib.h
Normal file → Executable file
33
include/tslib.h
Normal file → Executable file
@@ -1,7 +1,7 @@
|
||||
#ifndef TSLIB_H
|
||||
#define TSLIB_H
|
||||
#include <QByteArray>
|
||||
|
||||
#include "stdint.h"
|
||||
|
||||
#define LOWBYTE false
|
||||
#define HIGHBYTE true
|
||||
@@ -87,6 +87,37 @@ void biox_CopyBlock(uint8_t *src, uint16_t srcPos, uint8_t *dest, uint16_t destP
|
||||
|
||||
bool tslib_strComp(uint8_t *buf, char *compStr);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
uint16_t tslib_StrLen(char *str);
|
||||
|
||||
|
||||
|
||||
void tslib_itoa(int n, char *str);
|
||||
// -23456 -> str[0]='-' str[1]='2' ...[5]='6' str[6]=0
|
||||
// 5 -> str[0]='5' str[1..6]=0
|
||||
|
||||
void tslib_uitoa(unsigned int n, char *str);
|
||||
|
||||
void tslib_ltoa(long n, char *str);
|
||||
// -2147483647 -> str[0]='-' str[1]='2' ...[10]='6' str[11]=0
|
||||
|
||||
void tslib_ultoa( long n, char *str);
|
||||
// 0... ->4294967296 str[0]='4' str[1]='2' ...[9]='6' str[10]=0 str[11]=0
|
||||
|
||||
void tslib_uitobin( int decval, char *str);
|
||||
|
||||
long tslib_atol( char *AscString);
|
||||
// change ascii string ( of ascii numbers '0'..'9') to number
|
||||
// AscString must be 0-terminated!
|
||||
// a leading '-' is ignored, a'.' or a ',' stops calculation
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // TSLIB_H
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user