gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-mdb] branch master updated (c6d1cce -> b68e8d8)


From: gnunet
Subject: [taler-taler-mdb] branch master updated (c6d1cce -> b68e8d8)
Date: Sat, 28 Dec 2019 17:46:23 +0100

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

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

    from c6d1cce  fix
     new dfbf7d7  Added message for display of VM
     new b68e8d8  Changed product name

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/main.c | 37 +++++++++++++++++++++++++++++++++----
 taler.conf |  2 +-
 2 files changed, 34 insertions(+), 5 deletions(-)

diff --git a/src/main.c b/src/main.c
index a5d1df3..c1e6abb 100644
--- a/src/main.c
+++ b/src/main.c
@@ -216,8 +216,13 @@ along with
 /* Cancelled Command */
 #define READER_CANCELLED "08"
 
-/* Unused reader commands */
+/* Display Request for Sold Out product */
 #define READER_DISPLAY_REQUEST "02"
+#define READER_DISPLAY_REQUEST_TIME "32"
+#define READER_DISPLAY_SOLD_OUT 
"202020202020202020204175737665726b617566742020202020202020202020"
+#define READER_DISPLAY_INTERNAL_ERROR 
"202020496e7465726e616c204572726f72202d2054727920416761696e202020i"
+
+/* Unused reader commands */
 #define READER_SESSION_CANCEL_REQUEST "04"
 #define READER_REVALUE_DENIED "0E"
 
@@ -581,6 +586,16 @@ static struct MdbCommand revalueAmount;
  * Send NACK 
  */
 static struct MdbCommand readerNACK;
+
+/**
+ * Display Request for Sold Out
+ */
+static struct MdbCommand readerDisplaySoldOut;
+
+/**
+ * Display Request for Error Message
+ */
+static struct MdbCommand readerDisplayInternalError;
 /**
  * Terminate session.
  */
@@ -1647,7 +1662,7 @@ read_keyboard_command (void *cls)
         GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                     "Product %s sold out, denying vend\n",
                     products[i].description);
-        mdb.cmd = &denyVend;
+        mdb.cmd = &readerDisplaySoldOut;
         run_mdb_event_loop ();
         start_read_keyboard ();
         return;
@@ -1866,6 +1881,11 @@ handle_ack ()
     mdb.session_running = GNUNET_NO;
     mdb.cmd = &endSession;
   }
+       if (&readerDisplaySoldOut == mdb.last_cmd)
+               mdb.cmd = &denyVend;
+       if (&readerDisplayInternalError == mdb.last_cmd)
+               mdb.cmd = &denyVend;
+
   mdb.last_cmd = NULL;
   /* Cause the write-task to be re-scheduled now */
   if (NULL != mdb.wtask)
@@ -1936,7 +1956,7 @@ handle_command (const char *hex,
                }
                if ( ((uint8_t) (chkSum & 0xFF)) != tmp )
                {
-                       mdb.cmd = &denyVend;
+                       mdb.cmd = &readerDisplayInternalError;
                        GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                      "Received command with wrong checksum `%.*s'\n",
                      (int) hex_len,
@@ -2007,7 +2027,7 @@ handle_command (const char *hex,
                 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                             "Product %s sold out, denying vend\n",
                             products[i].description);
-                mdb.cmd = &denyVend;
+                mdb.cmd = &readerDisplaySoldOut;
                 return;
               }
               payment_activity = launch_payment (&products[i]);
@@ -2949,6 +2969,15 @@ main (int argc,
                                  READER_NACK,
                                  NULL);
 
+       readerDisplaySoldOut = setup_mdb_cmd ("Display Sold Out",
+                                                                               
                                                                        
READER_DISPLAY_REQUEST,
+                                                                               
                                                                        
READER_DISPLAY_REQUEST_TIME
+                                                                               
                                                                        
READER_DISPLAY_SOLD_OUT);
+
+       readerDisplayInternalError = setup_mdb_cmd ("Display Communication 
Error",
+                                                                               
                                                                                
                        READER_DISPLAY_REQUEST,
+                                                                               
                                                                                
                        READER_DISPLAY_REQUEST_TIME
+                                                                               
                                                                                
                        READER_DISPLAY_INTERNAL_ERROR);
 
   ret = GNUNET_PROGRAM_run (argc,
                             argv,
diff --git a/taler.conf b/taler.conf
index 4edf87f..397e1f9 100644
--- a/taler.conf
+++ b/taler.conf
@@ -109,7 +109,7 @@ number = 25
 
 #machine number 30
 [product-8]
-description = Meter
+description = Ruler
 price = EUR:10.0
 key = w
 number = 21

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



reply via email to

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