[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-mdb] 35/93: explicitly detect not-found code
From: |
gnunet |
Subject: |
[taler-taler-mdb] 35/93: explicitly detect not-found code |
Date: |
Mon, 18 Nov 2019 21:12:58 +0100 |
This is an automated email from the git hooks/post-receive script.
marco-boss pushed a commit to branch master
in repository taler-mdb.
commit d1436e8642d69a81c745a2dc19b896bf4262d529
Author: Christian Grothoff <address@hidden>
AuthorDate: Sat Nov 9 19:41:58 2019 +0100
explicitly detect not-found code
---
src/main.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/src/main.c b/src/main.c
index 0de6f34..19aef59 100644
--- a/src/main.c
+++ b/src/main.c
@@ -49,6 +49,11 @@ along with
*/
#define APDU_SUCCESS "\x90\x00"
+/**
+ * Code returned by libnfc in case Taler wallet is not installed.
+ */
+#define APDU_NOT_FOUND "\x6a\x82"
+
/* json order request keys */
#define SNACK_JSON_REQ_ORDER "order"
#define SNACK_JSON_REQ_SUMMARY "summary"
@@ -125,7 +130,6 @@ static char *authorization;
static struct PaymentActivity *payment_activity;
-
/**
* FIXME: read from configuration file instead!
* GNUNET_CONFIGURATION_* iteration over values.
@@ -157,7 +161,8 @@ SNACK_print_hex_info (const char*message,
char hex[5] = {""};
char str[64] = {""};
- for ( unsigned int i = 0; i < sizeHex; ++i ) {
+ for (unsigned int i = 0; i < sizeHex; ++i)
+ {
sprintf (hex, "%.2x ", hexArray[i]);
strcat (str, hex);
}
@@ -321,6 +326,16 @@ wallet_select_aid (void *cls)
pa);
return;
}
+ if (0 == memcmp (response,
+ APDU_NOT_FOUND,
+ sizeof (response)))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Taler wallet NOT found on this device\n");
+ pa->task = GNUNET_SCHEDULER_add_now (&connect_target,
+ pa);
+ return;
+ }
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"AID selection failure, return code: %x%x, trying to find
another NFC client\n",
response[0],
@@ -330,7 +345,6 @@ wallet_select_aid (void *cls)
}
-
/* upper and lower bounds for mifare targets uid length */
#define UID_LEN_UPPER 7
#define UID_LEN_LOWER 4
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [taler-taler-mdb] 33/93: typo, (continued)
- [taler-taler-mdb] 33/93: typo, gnunet, 2019/11/18
- [taler-taler-mdb] 30/93: cleanup, gnunet, 2019/11/18
- [taler-taler-mdb] 24/93: use event loop, gnunet, 2019/11/18
- [taler-taler-mdb] 32/93: retry NFC failures more nicely, gnunet, 2019/11/18
- [taler-taler-mdb] 36/93: fixed delay when cancelling, new bugs detected marked with FIXME, gnunet, 2019/11/18
- [taler-taler-mdb] 46/93: first steps in configurable products, gnunet, 2019/11/18
- [taler-taler-mdb] 28/93: misc cleanup, gnunet, 2019/11/18
- [taler-taler-mdb] 45/93: first steps in configurable products, gnunet, 2019/11/18
- [taler-taler-mdb] 40/93: fix, gnunet, 2019/11/18
- [taler-taler-mdb] 43/93: preparations for QR code alternative path, gnunet, 2019/11/18
- [taler-taler-mdb] 35/93: explicitly detect not-found code,
gnunet <=
- [taler-taler-mdb] 39/93: use test for now, gnunet, 2019/11/18
- [taler-taler-mdb] 38/93: merged, gnunet, 2019/11/18
- [taler-taler-mdb] 37/93: fixed delay when cancelling, new bugs detected marked with FIXME, gnunet, 2019/11/18
- [taler-taler-mdb] 34/93: fix, gnunet, 2019/11/18
- [taler-taler-mdb] 42/93: print URI sent to wallet for diagnostics, gnunet, 2019/11/18
- [taler-taler-mdb] 18/93: GNUnet logs added, -h option added, gnunet, 2019/11/18
- [taler-taler-mdb] 27/93: fixes, gnunet, 2019/11/18
- [taler-taler-mdb] 41/93: this was fixed, gnunet, 2019/11/18
- [taler-taler-mdb] 44/93: prepare logic for generation of QR codes, gnunet, 2019/11/18
- [taler-taler-mdb] 29/93: dce, gnunet, 2019/11/18