gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cash2ecash] 02/04: implemented Cashacceptor calls


From: gnunet
Subject: [cash2ecash] 02/04: implemented Cashacceptor calls
Date: Fri, 17 Jan 2025 22:00:38 +0100

This is an automated email from the git hooks/post-receive script.

manuel-geissbuehler pushed a commit to branch master
in repository cash2ecash.

commit ab59bc474f178a87a18492291c6e1c4ea12cc393
Author: Manuel Geissbühler <manuel@debian>
AuthorDate: Thu Jan 9 10:16:15 2025 +0100

    implemented Cashacceptor calls
---
 src/cash2ecash.cpp | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/cash2ecash.cpp b/src/cash2ecash.cpp
index dfdb2dd..0b76ac3 100644
--- a/src/cash2ecash.cpp
+++ b/src/cash2ecash.cpp
@@ -4,6 +4,8 @@
 #include <ostream>
 #include <vector>
 #include <mutex>
+#include "cashacceptor/cashacceptor.hpp"
+#include "cashacceptor/dg600f.hpp"
 #include "utils.hpp"
 #include "gui.hpp"
 #include "global.hpp"
@@ -37,12 +39,16 @@ char *string = hello;
 Gui gui;
 Timer withdrawalStatusTimer;
 
+
 ScreenWelcome *screenWelcome = new ScreenWelcome;
 ScreenIdentification *screenIdentification = new ScreenIdentification;
 ScreenConnection  *screenConnection = new ScreenConnection;
 ScreenAcceptCash  *screenAcceptCash = new ScreenAcceptCash(string);
 void guiDriver();
 BankCommunication bankCommunication;
+char serialpath[] = "/dev/ttyAMA3";
+DG600F Cashaccepor(serialpath);
+TALER_Amount confirmedAmount;
 
 typedef void(*action_t)();
 
@@ -82,8 +88,8 @@ void actionEventAbortConnection(){
 
 void actionEventFinishCashin(){
   std::cout << "Action Event Finish Cashin called" << std::endl;
-  static struct TALER_Amount confirmedAmount;
-  TALER_string_to_amount("KUDOS:2.0", &confirmedAmount);
+  Cashaccepor.readAccumulated(&confirmedAmount);
+  Cashaccepor.stopMoneyAcceptance();
   bankCommunication.withdrawalConfirmRequest(withdrawal_id, &confirmedAmount);
   gui.setActiveScreen(screenWelcome);
 }
@@ -116,6 +122,7 @@ void actionEventBankWithdrawalDone(){
 void actionEventBankWStatusSelected(){
   std::cout << "Action Event Bank Withdrawal Status Confirmed called" << 
std::endl;
   gui.setActiveScreen(screenAcceptCash);
+  Cashaccepor.startMoneyAcceptance();
 }
 
 void actionEventBankWStatusPending(){
@@ -135,8 +142,8 @@ void actionEventIdentificationTimeout(){
 
 void actionEventAcceptCashTimeout(){
   std::cout << "Action Event Acceptcash Timeout called" << std::endl;
-  static struct TALER_Amount confirmedAmount;
-  TALER_string_to_amount("KUDOS:2.0", &confirmedAmount);
+  Cashaccepor.readAccumulated(&confirmedAmount);
+  Cashaccepor.stopMoneyAcceptance();
   bankCommunication.withdrawalConfirmRequest(withdrawal_id, &confirmedAmount);
 }
 
@@ -227,7 +234,7 @@ void eventHandler(){
 }
 
 int main(int argc, char *argv[]){
-  char serialpath[] = "/dev/ttyAMA3";
+  
   std::cout << "The Program is running" <<std::endl;
   Timer timer1;
   timer1.setTimeMillis(10000);

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]