[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cash2ecash] branch master updated: testing
From: |
gnunet |
Subject: |
[cash2ecash] branch master updated: testing |
Date: |
Thu, 02 Jan 2025 13:15:43 +0100 |
This is an automated email from the git hooks/post-receive script.
manuel-geissbuehler pushed a commit to branch master
in repository cash2ecash.
The following commit(s) were added to refs/heads/master by this push:
new 1be24bc testing
1be24bc is described below
commit 1be24bc4751d2a2b0e9d01187da4876f79554526
Author: Manuel Geissbühler <manuel@debian>
AuthorDate: Thu Jan 2 13:15:20 2025 +0100
testing
---
build/CMakeCache.txt | 3 +
build/Makefile | 14 +++
build/bank/Makefile | 42 +++++++
build/compile_commands.json | 5 +
src/CMakeLists.txt | 2 +-
src/bank/#bankAPI.c# | 244 ---------------------------------------
src/bank/CMakeLists.txt | 5 +
src/bank/bankAPI.c | 244 ---------------------------------------
src/bank/bankCommunication.cpp | 3 +
src/bank/bankCommunication.hpp | 6 +-
src/bank/bank_lib.c | 2 +-
src/cash2ecash.cpp | 8 --
src/gui/screenIdentification.hpp | 14 +++
13 files changed, 91 insertions(+), 501 deletions(-)
diff --git a/build/CMakeCache.txt b/build/CMakeCache.txt
index 5a82695..eba7cf2 100644
--- a/build/CMakeCache.txt
+++ b/build/CMakeCache.txt
@@ -256,6 +256,9 @@ PKG_CONFIG_ARGN:STRING=
//pkg-config executable
PKG_CONFIG_EXECUTABLE:FILEPATH=/usr/bin/pkg-config
+//Dependencies for the target
+bankCommunication_LIB_DEPENDS:STATIC=general;bank;general;talerutil;
+
//Dependencies for the target
bank_LIB_DEPENDS:STATIC=general;talerjson;general;talercurl;general;talerutil;general;talerbank;general;gnunetutil;general;gnunetcurl;general;gnunetjson;general;jansson;general;curl;
diff --git a/build/Makefile b/build/Makefile
index 1253991..0de7a6d 100644
--- a/build/Makefile
+++ b/build/Makefile
@@ -200,6 +200,19 @@ bank/fast:
$(MAKE) $(MAKESILENT) -f bank/CMakeFiles/bank.dir/build.make
bank/CMakeFiles/bank.dir/build
.PHONY : bank/fast
+#=============================================================================
+# Target rules for targets named bankCommunication
+
+# Build rule for target.
+bankCommunication: cmake_check_build_system
+ $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 bankCommunication
+.PHONY : bankCommunication
+
+# fast build rule for target.
+bankCommunication/fast:
+ $(MAKE) $(MAKESILENT) -f
bank/CMakeFiles/bankCommunication.dir/build.make
bank/CMakeFiles/bankCommunication.dir/build
+.PHONY : bankCommunication/fast
+
#=============================================================================
# Target rules for targets named lvgl
@@ -315,6 +328,7 @@ help:
@echo "... list_install_components"
@echo "... rebuild_cache"
@echo "... bank"
+ @echo "... bankCommunication"
@echo "... cash2ecash"
@echo "... cashacceptor"
@echo "... gui"
diff --git a/build/bank/Makefile b/build/bank/Makefile
index 4e01803..a6fe59a 100644
--- a/build/bank/Makefile
+++ b/build/bank/Makefile
@@ -175,6 +175,44 @@ bank/fast:
cd
/home/manuel/Dokumente/Studium/BTE5512_Projektarbeit/cash2ecash/build &&
$(MAKE) $(MAKESILENT) -f bank/CMakeFiles/bank.dir/build.make
bank/CMakeFiles/bank.dir/build
.PHONY : bank/fast
+# Convenience name for target.
+bank/CMakeFiles/bankCommunication.dir/rule:
+ cd
/home/manuel/Dokumente/Studium/BTE5512_Projektarbeit/cash2ecash/build &&
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2
bank/CMakeFiles/bankCommunication.dir/rule
+.PHONY : bank/CMakeFiles/bankCommunication.dir/rule
+
+# Convenience name for target.
+bankCommunication: bank/CMakeFiles/bankCommunication.dir/rule
+.PHONY : bankCommunication
+
+# fast build rule for target.
+bankCommunication/fast:
+ cd
/home/manuel/Dokumente/Studium/BTE5512_Projektarbeit/cash2ecash/build &&
$(MAKE) $(MAKESILENT) -f bank/CMakeFiles/bankCommunication.dir/build.make
bank/CMakeFiles/bankCommunication.dir/build
+.PHONY : bankCommunication/fast
+
+bankCommunication.o: bankCommunication.cpp.o
+.PHONY : bankCommunication.o
+
+# target to build an object file
+bankCommunication.cpp.o:
+ cd
/home/manuel/Dokumente/Studium/BTE5512_Projektarbeit/cash2ecash/build &&
$(MAKE) $(MAKESILENT) -f bank/CMakeFiles/bankCommunication.dir/build.make
bank/CMakeFiles/bankCommunication.dir/bankCommunication.cpp.o
+.PHONY : bankCommunication.cpp.o
+
+bankCommunication.i: bankCommunication.cpp.i
+.PHONY : bankCommunication.i
+
+# target to preprocess a source file
+bankCommunication.cpp.i:
+ cd
/home/manuel/Dokumente/Studium/BTE5512_Projektarbeit/cash2ecash/build &&
$(MAKE) $(MAKESILENT) -f bank/CMakeFiles/bankCommunication.dir/build.make
bank/CMakeFiles/bankCommunication.dir/bankCommunication.cpp.i
+.PHONY : bankCommunication.cpp.i
+
+bankCommunication.s: bankCommunication.cpp.s
+.PHONY : bankCommunication.s
+
+# target to generate assembly for a file
+bankCommunication.cpp.s:
+ cd
/home/manuel/Dokumente/Studium/BTE5512_Projektarbeit/cash2ecash/build &&
$(MAKE) $(MAKESILENT) -f bank/CMakeFiles/bankCommunication.dir/build.make
bank/CMakeFiles/bankCommunication.dir/bankCommunication.cpp.s
+.PHONY : bankCommunication.cpp.s
+
bank_api_account_withdrawal.o: bank_api_account_withdrawal.c.o
.PHONY : bank_api_account_withdrawal.o
@@ -236,6 +274,10 @@ help:
@echo "... list_install_components"
@echo "... rebuild_cache"
@echo "... bank"
+ @echo "... bankCommunication"
+ @echo "... bankCommunication.o"
+ @echo "... bankCommunication.i"
+ @echo "... bankCommunication.s"
@echo "... bank_api_account_withdrawal.o"
@echo "... bank_api_account_withdrawal.i"
@echo "... bank_api_account_withdrawal.s"
diff --git a/build/compile_commands.json b/build/compile_commands.json
index 8512abc..662a17a 100644
--- a/build/compile_commands.json
+++ b/build/compile_commands.json
@@ -24,6 +24,11 @@
"command": "/usr/bin/cc
-I/home/manuel/Dokumente/Studium/BTE5512_Projektarbeit/cash2ecash/src/include
-g -o CMakeFiles/bank.dir/bank_api_account_withdrawal.c.o -c
/home/manuel/Dokumente/Studium/BTE5512_Projektarbeit/cash2ecash/src/bank/bank_api_account_withdrawal.c",
"file":
"/home/manuel/Dokumente/Studium/BTE5512_Projektarbeit/cash2ecash/src/bank/bank_api_account_withdrawal.c"
},
+{
+ "directory":
"/home/manuel/Dokumente/Studium/BTE5512_Projektarbeit/cash2ecash/build/bank",
+ "command": "/usr/bin/c++
-I/home/manuel/Dokumente/Studium/BTE5512_Projektarbeit/cash2ecash/src/include
-g -o CMakeFiles/bankCommunication.dir/bankCommunication.cpp.o -c
/home/manuel/Dokumente/Studium/BTE5512_Projektarbeit/cash2ecash/src/bank/bankCommunication.cpp",
+ "file":
"/home/manuel/Dokumente/Studium/BTE5512_Projektarbeit/cash2ecash/src/bank/bankCommunication.cpp"
+},
{
"directory":
"/home/manuel/Dokumente/Studium/BTE5512_Projektarbeit/cash2ecash/build/extern/lvgl",
"command": "/usr/bin/cc -DLV_CONF_INCLUDE_SIMPLE -DLV_LVGL_H_INCLUDE_SIMPLE
-I/home/manuel/Dokumente/Studium/BTE5512_Projektarbeit/cash2ecash/src/include
-I/home/manuel/Dokumente/Studium/BTE5512_Projektarbeit/cash2ecash/src/extern
-I/usr/include/libdrm -isystem
/home/manuel/Dokumente/Studium/BTE5512_Projektarbeit/cash2ecash/src/extern/lvgl
-isystem
/home/manuel/Dokumente/Studium/BTE5512_Projektarbeit/cash2ecash/build/extern/lvgl
-g -std=gnu99 -o CMakeFiles/lvgl.dir/src/core/lv_group.c. [...]
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 140fbd0..0c4b71a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -23,4 +23,4 @@ target_link_libraries(cash2ecash PRIVATE cashacceptor
utils
gui
lvgl
- bank)
+ bankCommunication)
diff --git a/src/bank/#bankAPI.c# b/src/bank/#bankAPI.c#
deleted file mode 100644
index 812f5ad..0000000
--- a/src/bank/#bankAPI.c#
+++ /dev/null
@@ -1,244 +0,0 @@
-#include <string.h>
-#include <taler/taler_bank_service.h>
-#include <taler/taler_util.h>
-#include <gnunet/gnunet_common.h>
-#include <gnunet/gnunet_scheduler_lib.h>
-#include <stdio.h>
-#include <gnunet/gnunet_curl_lib.h>
-#include <gnunet/gnunet_util_lib.h>
-#include "taler_bank_service_cash2ecash.h"
-
-
-
-static struct TALER_BANK_AuthenticationData auth;
-static struct GNUNET_CURL_Context *ctx;
-static struct GNUNET_CURL_RescheduleContext *rc;
-static struct TALER_BANK_AccountTokenHandle *ath;
-static struct TALER_BANK_AccountWithdrawalHandle *awh;
-static struct TALER_BANK_AccountWithdrawalConfirmHandle *awch;
-static const char *configfilename = "/home/manuel/.config/taler-exchange.conf";
-static const char *account_section = "bank-accountcredentials-cash2ecash";
-static const char *withdrawal_id;
-static const char *taler_withdraw_uri;
-struct TALER_Amount *testamount;
-struct TALER_Amount *testsuggestedamount;
-
-// Forward Declarations
-static void account_token_cb(void *cls,
- const struct TALER_BANK_AccountTokenResponse
*atr);
-static void account_withdrawal_cb(void *cls,
- const struct
TALER_BANK_AccountWithdrawalResponse *awr);
-static void account_withdrawal_confirm_cb(
- void *cls, const struct
TALER_BANK_AccountWithdrawalConfirmResponse *awcr);
-
-
-
-
-
-/**
- *Callback function for TALER_BANK_account_token
- */
-static void account_token_cb(void *cls, const struct
TALER_BANK_AccountTokenResponse *atr){
- (void) cls;
-
- ath = NULL;
- switch (atr->http_status) {
- case 0:
- fprintf(stderr, "Failed to obtain HTTP reply from `%s'\n",
- auth.wire_gateway_url);
- break;
- default:
- fprintf (stderr,
- "Failed to obtain debit history from `%s': HTTP status %u (%s)\n",
- auth.wire_gateway_url,
- atr->http_status,
- TALER_ErrorCode_get_hint (atr->ec));
- if (NULL != atr->response)
- json_dumpf (atr->response,
- stderr,
- JSON_INDENT (2));
- break;
- }
-
- //Switch Authentification method to Bearer and add Token
- GNUNET_free(auth.details.basic.password);
- GNUNET_free(auth.details.basic.username);
- auth.method = TALER_BANK_AUTH_BEARER;
- auth.details.bearer.token = GNUNET_strdup(atr->details.ok.access_token);
-
- //Make Withdrawal request (Do I have to check if the account Token request
did allready run completely?)
-
- awh = TALER_BANK_account_withdrawal(ctx,
- &auth,
- "finsteraarhorn",
- testamount,
- testsuggestedamount,
- &account_withdrawal_cb,
- NULL);
-
- if (NULL == awh){
- printf("error with awh");
- GNUNET_SCHEDULER_shutdown();
- }
-
- //GNUNET_SCHEDULER_shutdown();
-}
-
-
-
-/**
- *Callback function for TALER_BANK_account_withdrawal
- */
-static void account_withdrawal_cb(void *cls,
- const struct
TALER_BANK_AccountWithdrawalResponse *awr){
- (void) cls;
- awh = NULL;
-
- fprintf(stdout, "account withdrawal callback called\n");
- fprintf(stdout, "%s\n", awr->details.ok.taler_withdraw_uri);
- json_dumpf (awr->response,
- stderr,
- JSON_INDENT (2));
-
- //Not sure if the correspondign memory is freed somewhere, might be
neccessary to strdup and otherwise
- //take responsibility to free.
- withdrawal_id = awr->details.ok.withdrawal_id;
- taler_withdraw_uri = awr->details.ok.taler_withdraw_uri;
-
- char useserinput[5];
- scanf("%s",useserinput);
- if (0 != strcmp("go", useserinput)){
- printf("error");
- }
-
- awch = TALER_BANK_account_withdrawal_confirm(ctx, &auth,
- "finsteraarhorn",
- withdrawal_id,
- testsuggestedamount,
- &account_withdrawal_confirm_cb,
- NULL);
- if (NULL == awch){
- printf("error with awch");
- GNUNET_SCHEDULER_shutdown();
- }
-}
-
-/**
- *Callback function for TALER_BANK_account_withdrawal_confirm
- */
-static void account_withdrawal_confirm_cb(void *cls, const struct
TALER_BANK_AccountWithdrawalConfirmResponse *awcr){
- (void) cls;
- awch = NULL;
-
- fprintf(stderr, "%s", TALER_ErrorCode_get_hint (awcr->ec));
- fprintf(stdout, "account withdrawal confirmation callback called\n");
- GNUNET_SCHEDULER_shutdown();
-}
-
-/**
- *Function to do the cleanup
- */
-static void do_shutdown(void *cls){
- (void) cls;
-
- if(NULL != ath){
- TALER_BANK_account_token_cancel(ath);
- }
-
- if (NULL != awh){
- TALER_BANK_account_withdrawal_cancel(awh);
- }
-
- if (NULL != awch) {
- TALER_BANK_account_withdrawal_confirm_cancel(awch);
- }
-
- if (NULL != ctx){
- GNUNET_CURL_fini(ctx);
- }
-
- if (NULL != rc){
- GNUNET_CURL_gnunet_rc_destroy(rc);
- }
- TALER_BANK_auth_free(&auth);
-}
-
-
-/**
- *Main Program to be Run trough GNUNET_PROGRAM_run()
- */
-static void run(void *cls, char *const *args, const char *cfgfile, const
struct GNUNET_CONFIGURATION_Handle *cfg){
- (void) cls;
- (void) args;
- (void) cfgfile;
- (void) cfg;
-
- GNUNET_SCHEDULER_add_shutdown(&do_shutdown, NULL);
-
- ctx = GNUNET_CURL_init(&GNUNET_CURL_gnunet_scheduler_reschedule, &rc);
- GNUNET_assert(NULL != ctx);
- rc = GNUNET_CURL_gnunet_rc_create(ctx);
-
-
- //Parse Config
- if (GNUNET_OK != TALER_BANK_auth_parse_cfg(cfg, account_section, &auth)){
- printf("error parsing authentification Data");
- }
-
- //Make Token request
- struct GNUNET_TIME_Relative duration = {UINT64_MAX};
- ath = TALER_BANK_account_token(ctx,
- &auth,
- "finsteraarhorn",
- TALER_BANK_TOKEN_SCOPE_READWRITE,
- true,
- "this is a description",
- duration,
- &account_token_cb,
- NULL);
-
- if (NULL == ath){
- printf("error with ath");
- GNUNET_SCHEDULER_shutdown();
- }
-
- struct TALER_Amount amount;
- TALER_string_to_amount("KUDOS:3.1415", &amount);
- testamount = &amount;
- testsuggestedamount = NULL;
- printf("currency: %s\n",amount.currency);
- printf("fraction: %d\n",amount.fraction);
- printf("value: %ld\n",amount.value);
-
-
-
-}
-
-
-/**
- *main runs function run() trough GNUNET_PROGRAM_run()
- */
-int main(int argc,
- char *const *argv){
- int retval;
-
- //Run Program
- const struct GNUNET_GETOPT_CommandLineOption options[] = {
- GNUNET_GETOPT_OPTION_END
- };
- retval = GNUNET_PROGRAM_run(
- TALER_EXCHANGE_project_data(),
- argc, argv,
- "bankapi-test",
- gettext_noop("Test Function for bankapi"),
- options,
- &run, NULL);
- if (GNUNET_SYSERR == retval)
- return 3;
- if (GNUNET_NO == retval)
- return 0;
-
- return 0;
-}
-
-
diff --git a/src/bank/CMakeLists.txt b/src/bank/CMakeLists.txt
index 047c620..f82c342 100644
--- a/src/bank/CMakeLists.txt
+++ b/src/bank/CMakeLists.txt
@@ -9,3 +9,8 @@ target_link_libraries(bank PRIVATE
gnunetjson
jansson
curl)
+
+add_library(bankCommunication bankCommunication.cpp)
+target_link_libraries(bankCommunication PRIVATE
+ bank
+ talerutil)
diff --git a/src/bank/bankAPI.c b/src/bank/bankAPI.c
deleted file mode 100644
index 812f5ad..0000000
--- a/src/bank/bankAPI.c
+++ /dev/null
@@ -1,244 +0,0 @@
-#include <string.h>
-#include <taler/taler_bank_service.h>
-#include <taler/taler_util.h>
-#include <gnunet/gnunet_common.h>
-#include <gnunet/gnunet_scheduler_lib.h>
-#include <stdio.h>
-#include <gnunet/gnunet_curl_lib.h>
-#include <gnunet/gnunet_util_lib.h>
-#include "taler_bank_service_cash2ecash.h"
-
-
-
-static struct TALER_BANK_AuthenticationData auth;
-static struct GNUNET_CURL_Context *ctx;
-static struct GNUNET_CURL_RescheduleContext *rc;
-static struct TALER_BANK_AccountTokenHandle *ath;
-static struct TALER_BANK_AccountWithdrawalHandle *awh;
-static struct TALER_BANK_AccountWithdrawalConfirmHandle *awch;
-static const char *configfilename = "/home/manuel/.config/taler-exchange.conf";
-static const char *account_section = "bank-accountcredentials-cash2ecash";
-static const char *withdrawal_id;
-static const char *taler_withdraw_uri;
-struct TALER_Amount *testamount;
-struct TALER_Amount *testsuggestedamount;
-
-// Forward Declarations
-static void account_token_cb(void *cls,
- const struct TALER_BANK_AccountTokenResponse
*atr);
-static void account_withdrawal_cb(void *cls,
- const struct
TALER_BANK_AccountWithdrawalResponse *awr);
-static void account_withdrawal_confirm_cb(
- void *cls, const struct
TALER_BANK_AccountWithdrawalConfirmResponse *awcr);
-
-
-
-
-
-/**
- *Callback function for TALER_BANK_account_token
- */
-static void account_token_cb(void *cls, const struct
TALER_BANK_AccountTokenResponse *atr){
- (void) cls;
-
- ath = NULL;
- switch (atr->http_status) {
- case 0:
- fprintf(stderr, "Failed to obtain HTTP reply from `%s'\n",
- auth.wire_gateway_url);
- break;
- default:
- fprintf (stderr,
- "Failed to obtain debit history from `%s': HTTP status %u (%s)\n",
- auth.wire_gateway_url,
- atr->http_status,
- TALER_ErrorCode_get_hint (atr->ec));
- if (NULL != atr->response)
- json_dumpf (atr->response,
- stderr,
- JSON_INDENT (2));
- break;
- }
-
- //Switch Authentification method to Bearer and add Token
- GNUNET_free(auth.details.basic.password);
- GNUNET_free(auth.details.basic.username);
- auth.method = TALER_BANK_AUTH_BEARER;
- auth.details.bearer.token = GNUNET_strdup(atr->details.ok.access_token);
-
- //Make Withdrawal request (Do I have to check if the account Token request
did allready run completely?)
-
- awh = TALER_BANK_account_withdrawal(ctx,
- &auth,
- "finsteraarhorn",
- testamount,
- testsuggestedamount,
- &account_withdrawal_cb,
- NULL);
-
- if (NULL == awh){
- printf("error with awh");
- GNUNET_SCHEDULER_shutdown();
- }
-
- //GNUNET_SCHEDULER_shutdown();
-}
-
-
-
-/**
- *Callback function for TALER_BANK_account_withdrawal
- */
-static void account_withdrawal_cb(void *cls,
- const struct
TALER_BANK_AccountWithdrawalResponse *awr){
- (void) cls;
- awh = NULL;
-
- fprintf(stdout, "account withdrawal callback called\n");
- fprintf(stdout, "%s\n", awr->details.ok.taler_withdraw_uri);
- json_dumpf (awr->response,
- stderr,
- JSON_INDENT (2));
-
- //Not sure if the correspondign memory is freed somewhere, might be
neccessary to strdup and otherwise
- //take responsibility to free.
- withdrawal_id = awr->details.ok.withdrawal_id;
- taler_withdraw_uri = awr->details.ok.taler_withdraw_uri;
-
- char useserinput[5];
- scanf("%s",useserinput);
- if (0 != strcmp("go", useserinput)){
- printf("error");
- }
-
- awch = TALER_BANK_account_withdrawal_confirm(ctx, &auth,
- "finsteraarhorn",
- withdrawal_id,
- testsuggestedamount,
- &account_withdrawal_confirm_cb,
- NULL);
- if (NULL == awch){
- printf("error with awch");
- GNUNET_SCHEDULER_shutdown();
- }
-}
-
-/**
- *Callback function for TALER_BANK_account_withdrawal_confirm
- */
-static void account_withdrawal_confirm_cb(void *cls, const struct
TALER_BANK_AccountWithdrawalConfirmResponse *awcr){
- (void) cls;
- awch = NULL;
-
- fprintf(stderr, "%s", TALER_ErrorCode_get_hint (awcr->ec));
- fprintf(stdout, "account withdrawal confirmation callback called\n");
- GNUNET_SCHEDULER_shutdown();
-}
-
-/**
- *Function to do the cleanup
- */
-static void do_shutdown(void *cls){
- (void) cls;
-
- if(NULL != ath){
- TALER_BANK_account_token_cancel(ath);
- }
-
- if (NULL != awh){
- TALER_BANK_account_withdrawal_cancel(awh);
- }
-
- if (NULL != awch) {
- TALER_BANK_account_withdrawal_confirm_cancel(awch);
- }
-
- if (NULL != ctx){
- GNUNET_CURL_fini(ctx);
- }
-
- if (NULL != rc){
- GNUNET_CURL_gnunet_rc_destroy(rc);
- }
- TALER_BANK_auth_free(&auth);
-}
-
-
-/**
- *Main Program to be Run trough GNUNET_PROGRAM_run()
- */
-static void run(void *cls, char *const *args, const char *cfgfile, const
struct GNUNET_CONFIGURATION_Handle *cfg){
- (void) cls;
- (void) args;
- (void) cfgfile;
- (void) cfg;
-
- GNUNET_SCHEDULER_add_shutdown(&do_shutdown, NULL);
-
- ctx = GNUNET_CURL_init(&GNUNET_CURL_gnunet_scheduler_reschedule, &rc);
- GNUNET_assert(NULL != ctx);
- rc = GNUNET_CURL_gnunet_rc_create(ctx);
-
-
- //Parse Config
- if (GNUNET_OK != TALER_BANK_auth_parse_cfg(cfg, account_section, &auth)){
- printf("error parsing authentification Data");
- }
-
- //Make Token request
- struct GNUNET_TIME_Relative duration = {UINT64_MAX};
- ath = TALER_BANK_account_token(ctx,
- &auth,
- "finsteraarhorn",
- TALER_BANK_TOKEN_SCOPE_READWRITE,
- true,
- "this is a description",
- duration,
- &account_token_cb,
- NULL);
-
- if (NULL == ath){
- printf("error with ath");
- GNUNET_SCHEDULER_shutdown();
- }
-
- struct TALER_Amount amount;
- TALER_string_to_amount("KUDOS:3.1415", &amount);
- testamount = &amount;
- testsuggestedamount = NULL;
- printf("currency: %s\n",amount.currency);
- printf("fraction: %d\n",amount.fraction);
- printf("value: %ld\n",amount.value);
-
-
-
-}
-
-
-/**
- *main runs function run() trough GNUNET_PROGRAM_run()
- */
-int main(int argc,
- char *const *argv){
- int retval;
-
- //Run Program
- const struct GNUNET_GETOPT_CommandLineOption options[] = {
- GNUNET_GETOPT_OPTION_END
- };
- retval = GNUNET_PROGRAM_run(
- TALER_EXCHANGE_project_data(),
- argc, argv,
- "bankapi-test",
- gettext_noop("Test Function for bankapi"),
- options,
- &run, NULL);
- if (GNUNET_SYSERR == retval)
- return 3;
- if (GNUNET_NO == retval)
- return 0;
-
- return 0;
-}
-
-
diff --git a/src/bank/bankCommunication.cpp b/src/bank/bankCommunication.cpp
index 15beaf8..7f69dda 100644
--- a/src/bank/bankCommunication.cpp
+++ b/src/bank/bankCommunication.cpp
@@ -1 +1,4 @@
#include "bankCommunication.hpp"
+
+
+const char **BankCommunication::status;
diff --git a/src/bank/bankCommunication.hpp b/src/bank/bankCommunication.hpp
index a21b8f4..a539086 100644
--- a/src/bank/bankCommunication.hpp
+++ b/src/bank/bankCommunication.hpp
@@ -26,11 +26,11 @@ class BankCommunication{
}
static void withdrawalIDInfoRequestCallback(){
- if (0 == strcmp(*status, "pending")){
+ if (0 == std::strcmp(*status, "pending")){
eventHandler(EVENT_BANK_W_STATUS_PENDING);
- }else if (0 == strcmp(*status, "selected")) {
+ }else if (0 == std::strcmp(*status, "selected")) {
eventHandler(EVENT_BANK_W_STATUS_SELECTED);
- }else if (0 == strcmp(*status, "aborted")) {
+ }else if (0 == std::strcmp(*status, "aborted")) {
eventHandler(EVENT_BUTTON_ABORT);
}else{
std::cerr << "Unexpected Withdrawal Staus: " << *status << std::endl;
diff --git a/src/bank/bank_lib.c b/src/bank/bank_lib.c
index 9eaad0f..a7f36e4 100644
--- a/src/bank/bank_lib.c
+++ b/src/bank/bank_lib.c
@@ -377,7 +377,7 @@ void bankCommunicationWithdrawalIDInfoRequest(const char
*withdrawal_id, const c
bankCommunicationRun(runWithdrawalIDInfoRequest);
}
-void bankCommunicatonWithdrawalConfirmRequest(const char *withdrawal_id,
struct TALER_Amount *amount, bankCommunicationWithdrawalConfirmCallback_t
callback){
+void bankCommunicationWithdrawalConfirmRequest(const char *withdrawal_id,
struct TALER_Amount *amount, bankCommunicationWithdrawalConfirmCallback_t
callback){
//Store the parameters globaly
extWithdrawalConfirmCallback = callback;
parWithdrawal_id = withdrawal_id;
diff --git a/src/cash2ecash.cpp b/src/cash2ecash.cpp
index aeaf188..f453ba1 100644
--- a/src/cash2ecash.cpp
+++ b/src/cash2ecash.cpp
@@ -2,15 +2,7 @@
#include <cstdio>
#include <iostream>
#include <ostream>
-#include <src/misc/lv_types.h>
#include <vector>
-#include "bank/bankCommunication.hpp"
-#include "cashacceptors.hpp"
-#include "gui/screen.hpp"
-#include "gui/screenAcceptCash.hpp"
-#include "gui/screenConnection.hpp"
-#include "gui/screenIdentification.hpp"
-#include "gui/screenWelcomme.hpp"
#include "utils.hpp"
#include "gui.hpp"
#include "global.hpp"
diff --git a/src/gui/screenIdentification.hpp b/src/gui/screenIdentification.hpp
index b83be92..bdbed73 100644
--- a/src/gui/screenIdentification.hpp
+++ b/src/gui/screenIdentification.hpp
@@ -10,10 +10,15 @@
class ScreenIdentification : public Screen {
private:
lv_obj_t *abortButton;
+ lv_obj_t *identButton;
static void abortButtonEvent(lv_event_t *e){
eventHandler(EVENT_BUTTON_ABORT);
}
+
+ static void identButtonEvent(lv_event_t *e){
+ eventHandler(EVENT_IDENTIFICATION_SUCCESS);
+ }
protected:
public:
@@ -29,6 +34,15 @@ class ScreenIdentification : public Screen {
lv_label_set_text(label, "Abort");
lv_obj_add_style(label, &buttonLabelDefaultStyle, 0);
lv_obj_add_event_cb(abortButton, abortButtonEvent, LV_EVENT_CLICKED, NULL);
+
+ //Add button "Identificate" as long as identification is not implemented...
+ identButton = lv_button_create(buttonsContainer);
+ lv_obj_add_style(identButton, &buttonDefaultStyle, 0);
+ label = lv_label_create(identButton);
+ lv_label_set_text(label, "Identificate");
+ lv_obj_add_style(label, &buttonLabelDefaultStyle, 0);
+ lv_obj_add_event_cb(identButton, identButtonEvent, LV_EVENT_CLICKED, NULL);
+
}
};
#endif
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [cash2ecash] branch master updated: testing,
gnunet <=
- [cash2ecash] branch master updated: testing, gnunet, 2025/01/02
- [cash2ecash] branch master updated: testing, gnunet, 2025/01/02
- [cash2ecash] branch master updated: testing, gnunet, 2025/01/02
- [cash2ecash] branch master updated: testing, gnunet, 2025/01/02
- [cash2ecash] branch master updated: testing, gnunet, 2025/01/02
- [cash2ecash] branch master updated: testing, gnunet, 2025/01/02