gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-mdb] branch master updated: Change GPIO Pin


From: gnunet
Subject: [taler-taler-mdb] branch master updated: Change GPIO Pin
Date: Fri, 27 Dec 2019 17:31:06 +0100

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

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

The following commit(s) were added to refs/heads/master by this push:
     new 939c303  Change GPIO Pin
939c303 is described below

commit 939c3035191fb6ad89099e5d0249b91a11f9a479
Author: Dominik Hofer <address@hidden>
AuthorDate: Fri Dec 27 17:30:59 2019 +0100

    Change GPIO Pin
---
 src/main.c | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 92 insertions(+), 2 deletions(-)

diff --git a/src/main.c b/src/main.c
index 90a9efb..ff8b8de 100644
--- a/src/main.c
+++ b/src/main.c
@@ -125,6 +125,7 @@ along with
 /* VMC commands */
 #define VMC_CMD_START 0x02
 #define VMC_CMD_END 0x03
+#define VMC_CMD_RESET 0x10
 
 /**
  * Acknowledgement
@@ -135,6 +136,8 @@ along with
  * Request for configuration.
  */
 #define VMC_CONF 0x11
+#define VMC_READER_CONF 0x00
+#define VMC_SETUP_MAX_MIN_PRICES 0x01
 
 /**
  * Machine is polling for something.
@@ -192,7 +195,11 @@ along with
 /* Session Commands */
 /* Refer to the mdb interface specifications v4.2 p.131 */
 #define READER_BEGIN_SESSION "03"
+<<<<<<< Updated upstream
 #define READER_FUNDS_AVAILABLE "000A"
+=======
+#define READER_FUNDS_AVAILABLE "00A0"
+>>>>>>> Stashed changes
 #define READER_END_SESSION "07"
 
 /* Vend Commands */
@@ -796,6 +803,11 @@ cleanup_payment (struct PaymentActivity *pa)
     nfc_abort_command (pa->pnd);
     nfc_close (pa->pnd);
   }
+       if (NULL != cancelbutton_task)
+       {
+               GNUNET_SCHEDULER_cancel (cancelbutton_task);
+               cancelbutton_task = NULL;
+       }
   if (NULL != pa->po)
     TALER_MERCHANT_proposal_cancel (pa->po);
   if (NULL != pa->cpo)
@@ -895,6 +907,11 @@ shutdown_task (void *cls)
   {
     cleanup_payment (payment_activity);
     payment_activity = NULL;
+  }
+       if (NULL != cancelbutton_task)
+  {
+    GNUNET_SCHEDULER_cancel (cancelbutton_task);
+    cancelbutton_task = NULL;
   }
   if (NULL != keyboard_task)
   {
@@ -947,7 +964,11 @@ shutdown_task (void *cls)
       GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                   "Unable to open /gpio/unexport for cancel button\n");
     }
+<<<<<<< Updated upstream
     (void) write (cancelButton.cancelbuttonfd, "17", 2);
+=======
+    (void) write (cancelButton.cancelbuttonfd, "23", 2);
+>>>>>>> Stashed changes
     close (cancelButton.cancelbuttonfd);
   }
   /* free the allocated productes read from config file */
@@ -2043,14 +2064,64 @@ handle_command (const char *hex,
       break;
     }
   case VMC_CONF:
+<<<<<<< Updated upstream
     GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+=======
+               {
+      unsigned int subcmd;
+
+      if (4 > hex_len)
+      {
+        GNUNET_break_op (0);
+        return;
+      }
+      if (1 != sscanf (&hex[2],
+                       "%2X",
+                       &subcmd))
+      {
+        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                    "Received non-HEX input `%.*s'\n",
+                    (int) hex_len - 2,
+                    &hex[2]);
+        GNUNET_break_op (0);
+        return;
+      }
+      switch (subcmd)
+      {
+      case VMC_READER_CONF:
+        {
+                               GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+>>>>>>> Stashed changes
                 "Received request for configuration via MDB\n");
-    mdb.cmd = &readerConfigData;
-    break;
+               mdb.cmd = &readerConfigData;
+               break;
+          
+        }
+      case VMC_SETUP_MAX_MIN_PRICES:
+        {
+          GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                      "Received max and min prices via MDB\n");
+          break;
+        }
+      default:
+        GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                    "Unknown MDB sub-command %X of command %X\n",
+                    subcmd,
+                    cmd);
+        break;
+      }
+      break;
+    }
   case VMC_POLL:
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "Received POLL from MDB (ignored)\n");
     break;
+       case VMC_CMD_RESET:
+               {
+               GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "Received RESET from MDB (ignored)\n");
+               break;
+               }
   case VMC_READER:
     {
       unsigned int subcmd;
@@ -2592,25 +2663,44 @@ run (void *cls,
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                 "Unable to open /gpio/export for cancel button\n");
   }
+<<<<<<< Updated upstream
   (void) write (cancelButton.cancelbuttonfd, "17", 2);
   close (cancelButton.cancelbuttonfd);
 
   cancelButton.cancelbuttonfd = open ("/sys/class/gpio/gpio17/direction",
+=======
+  (void) write (cancelButton.cancelbuttonfd, "23", 2);
+  close (cancelButton.cancelbuttonfd);
+
+  cancelButton.cancelbuttonfd = open ("/sys/class/gpio/gpio23/direction",
+>>>>>>> Stashed changes
                                       O_WRONLY);
   if (0 > cancelButton.cancelbuttonfd)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+<<<<<<< Updated upstream
                 "Unable to open /gpio/gpio17/direction for cancel button\n");
+=======
+                "Unable to open /gpio/gpio23/direction for cancel button\n");
+>>>>>>> Stashed changes
   }
   (void) write (cancelButton.cancelbuttonfd, "in", 2);
   close (cancelButton.cancelbuttonfd);
 
+<<<<<<< Updated upstream
   cancelButton.cancelbuttonfd = open ("/sys/class/gpio/gpio17/value",
+=======
+  cancelButton.cancelbuttonfd = open ("/sys/class/gpio/gpio23/value",
+>>>>>>> Stashed changes
                                       O_RDONLY);
   if (0 > cancelButton.cancelbuttonfd)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+<<<<<<< Updated upstream
                 "Unable to open /gpio/gpio17/value for cancel button\n");
+=======
+                "Unable to open /gpio/gpio23/value for cancel button\n");
+>>>>>>> Stashed changes
   }
 
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

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