From ffa470f49f8d79b5d1084ba7e4ed927aac22c40a Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Thu, 9 Nov 2023 10:17:46 +0100 Subject: [PATCH] Provide default implementations for all function in interfaces.h. --- include/interfaces.h | 93 ++++++++++++++++++++++---------------------- 1 file changed, 46 insertions(+), 47 deletions(-) diff --git a/include/interfaces.h b/include/interfaces.h index 3d7b7f1..e394b76 100755 --- a/include/interfaces.h +++ b/include/interfaces.h @@ -2196,61 +2196,60 @@ public: virtual void bna_sendSettings(uint16_t notesToAccept, uint16_t parameters, uint16_t *billDenomination, - uint32_t acceptanceLimit) const =0; - // notesToAccept: bit0=bill1 (lowest donomination) bitH=accept bit L = deny - // parameters: e.g. use escrow function for some notes - // billDenomination = array of 16 bill values (e.g. 5, 10, 20...) - // these can be set alternatively by Json-File DC2C_cash.json - // acceptanceLimit: device will stop acceptance once this amount is reached and - // optionally keep last bill in escrow until vend_success() - // is called (put bill to stacker) or vend_failed() is called (return bill) + uint32_t acceptanceLimit) const { + Q_UNUSED(notesToAccept); + Q_UNUSED(parameters); + Q_UNUSED(billDenomination); + Q_UNUSED(acceptanceLimit); - virtual void bna_setCurrentAcceptance(uint16_t notesToAccept) const =0; - // can be used to block notes dynamically, example: from now only 5€ bills are allowed (if only 3€ are to be paid) + } + // notesToAccept: bit0=bill1 (lowest donomination) bitH=accept bit L = deny + // parameters: e.g. use escrow function for some notes + // billDenomination = array of 16 bill values (e.g. 5, 10, 20...) + // these can be set alternatively by Json-File DC2C_cash.json + // acceptanceLimit: device will stop acceptance once this amount is reached and + // optionally keep last bill in escrow until vend_success() + // is called (put bill to stacker) or vend_failed() is called (return bill) - virtual void bna_requestParameters(void) const =0; - // send command to DC in order to get static invariable device parameters like currency - // device must be powered and polled to get these + virtual void bna_setCurrentAcceptance(uint16_t notesToAccept) const { + Q_UNUSED(notesToAccept); + } + // can be used to block notes dynamically, example: from now only 5€ bills are allowed (if only 3€ are to be paid) - virtual bool bna_getAllParameters(struct T_bna *bna) const =0; - // get all constant data from reader (e.g. currency) - // and actual Host-Settings (sent with bna_sendSettings() or json) - // retval = true if data are valid + virtual void bna_requestParameters() const {} + // send command to DC in order to get static invariable device parameters like currency + // device must be powered and polled to get these - virtual void bna_requestCurrentNotes(void) const =0; - // send command to DC in order to get transaction data + virtual bool bna_getAllParameters(struct T_bna *bna) const { + Q_UNUSED(bna); + return false; + } + // get all constant data from reader (e.g. currency) + // and actual Host-Settings (sent with bna_sendSettings() or json) + // retval = true if data are valid - virtual uint8_t bna_getCurrentNotes(uint16_t latestBill, uint16_t *currentNotes) const =0; - // returns number of collected bank notes since start-command (current transaction) - // latestBill: last accepted bank note, value in cent - // currentNotes an array with up to 16 (further) notes collected + virtual void bna_requestCurrentNotes() const {} + // send command to DC in order to get transaction data - virtual void bna_requestStackerLevel(void) const =0; + virtual uint8_t bna_getCurrentNotes(uint16_t latestBill, uint16_t *currentNotes) const { + Q_UNUSED(latestBill); + Q_UNUSED(currentNotes); + return 0; + } + // returns number of collected bank notes since start-command (current transaction) + // latestBill: last accepted bank note, value in cent + // currentNotes an array with up to 16 (further) notes collected - virtual uint16_t bna_getStackerLevel(uint32_t *amountInStacker, uint16_t *countOfBills) const =0; - // return val: nr of bills in stacker - // countOfBills: array of up to 16 sums, countOfBills[0]=nr of 5€-bills in stacker - // countOfBills[1] for 10€ and so on + virtual void bna_requestStackerLevel() const {} - - - -signals: - virtual void hwapi_templatePrintFinished_OK(void) const=0; - virtual void hwapi_templatePrintFinished_Err(void) const=0; - - virtual void hwapi_coinCollectionJustStarted(void) const=0; - virtual void hwapi_coinCollectionAborted(void) const=0; - - virtual void hwapi_gotNewCoin(void) const=0; - virtual void hwapi_payStopByMax(void) const=0; - virtual void hwapi_payStopByPushbutton(void) const=0; - - virtual void hwapi_payStopByEscrow(void) const=0; - virtual void hwapi_payStopByError(void) const=0; - virtual void hwapi_payStopByTimeout(void) const=0; - virtual void hwapi_payCancelled(void) const=0; - virtual void hwapi_coinProcessJustStopped(void) const=0; + virtual uint16_t bna_getStackerLevel(uint32_t *amountInStacker, uint16_t *countOfBills) const { + Q_UNUSED(amountInStacker); + Q_UNUSED(countOfBills); + return 0; + } + // return val: nr of bills in stacker + // countOfBills: array of up to 16 sums, countOfBills[0]=nr of 5€-bills in stacker + // countOfBills[1] for 10€ and so on virtual void hwapi_doorServiceDoorOpened(void) const=0; virtual void hwapi_doorVaultDoorOpened(void) const=0;