gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-mdb] branch master updated: include ESSID in payto URI


From: gnunet
Subject: [taler-taler-mdb] branch master updated: include ESSID in payto URI
Date: Wed, 01 Jul 2020 13:44:46 +0200

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

grothoff pushed a commit to branch master
in repository taler-mdb.

The following commit(s) were added to refs/heads/master by this push:
     new a808e1d  include ESSID in payto URI
a808e1d is described below

commit a808e1d5422ea7818110753e5b4ff7205b984d30
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Wed Jul 1 13:44:42 2020 +0200

    include ESSID in payto URI
---
 src/main.c | 51 ++++++++++++++++++++++++++++++++++++---------------
 taler.conf |  2 ++
 2 files changed, 38 insertions(+), 15 deletions(-)

diff --git a/src/main.c b/src/main.c
index a80bda5..103b101 100644
--- a/src/main.c
+++ b/src/main.c
@@ -621,6 +621,11 @@ static char *fulfillment_msg;
  */
 static char *authorization;
 
+/**
+ * ESSID of a WLAN network offered by the snack system, or NULL.
+ */
+static char *essid;
+
 /**
  * Handle for the payment
  */
@@ -1392,6 +1397,7 @@ check_payment_cb (void *cls,
                   const char *taler_pay_uri)
 {
   struct PaymentActivity *pa = cls;
+  char *uri;
 
   (void) refunded;
   (void) refund_amount;
@@ -1424,29 +1430,33 @@ check_payment_cb (void *cls,
     }
     return;
   }
-  else
+  /* Start to check for payment. Note that we do this even before
+     we talked successfully to the wallet via NFC because we MAY show the
+     QR code in the future and in that case the payment may happen
+     anytime even before the NFC communication succeeds. */
+  if ( (NULL == pa->cpo) &&
+       (NULL == pa->delay_pay_task) )
   {
-    /* Start to check for payment. Note that we do this even before
-       we talked successfully to the wallet via NFC because we MAY show the
-       QR code in the future and in that case the payment may happen
-       anytime even before the NFC communication succeeds. */
-    if ( (NULL == pa->cpo) &&
-         (NULL == pa->delay_pay_task) )
-    {
-      pa->delay_pay_task = GNUNET_SCHEDULER_add_delayed (MAX_HTTP_RETRY_FREQ,
-                                                         &check_payment_again,
-                                                         pa);
-    }
+    pa->delay_pay_task = GNUNET_SCHEDULER_add_delayed (MAX_HTTP_RETRY_FREQ,
+                                                       &check_payment_again,
+                                                       pa);
   }
   if (NULL == pa->taler_pay_uri)
   {
+    if (NULL == essid)
+      uri = GNUNET_strdup (taler_pay_uri);
+    else
+      GNUNET_asprintf (&uri,
+                       "%s#%s",
+                       taler_pay_uri,
+                       essid);
     GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                 "Trying to talk to wallet to give it pay URI `%s'\n",
-                taler_pay_uri);
+                uri);
     GNUNET_assert (NULL == pa->pnd);
-    pa->taler_pay_uri = GNUNET_strdup (taler_pay_uri);
+    pa->taler_pay_uri = uri;
 #if HAVE_QRENCODE_H
-    show_qrcode (taler_pay_uri);
+    show_qrcode (uri);
 #endif
     pa->task = GNUNET_SCHEDULER_add_now (&open_nfc_reader,
                                          pa);
@@ -2943,6 +2953,17 @@ run (void *cls,
                      auth);
     GNUNET_free (auth);
   }
+  {
+    if (GNUNET_OK !=
+        GNUNET_CONFIGURATION_get_value_string (cfg,
+                                               "taler-mdb",
+                                               "essid",
+                                               &essid))
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                  "No ESSID specified, will not advertise WLAN\n");
+    }
+  }
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_string (cfg,
                                              "taler-mdb",
diff --git a/taler.conf b/taler.conf
index 7d925de..15296c8 100644
--- a/taler.conf
+++ b/taler.conf
@@ -21,6 +21,8 @@ FRAMEBUFFER_DEVICE = /dev/fb1
 # Name of the backlight file for the framebuffer
 FRAMEBUFFER_BACKLIGHT = /sys/class/backlight/soc:backlight/brightness
 
+ESSID = snack
+
 #Products 
 #If sold out is enabled, products with description "empty" will be registered 
as sold out.
 

-- 
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]