gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-mdb] branch master updated: fix and backlight file now in .


From: gnunet
Subject: [taler-taler-mdb] branch master updated: fix and backlight file now in .conf too
Date: Thu, 05 Dec 2019 17:11:59 +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.

The following commit(s) were added to refs/heads/master by this push:
     new 2cc5d93  fix and backlight file now in .conf too
2cc5d93 is described below

commit 2cc5d9391842b717fd0b50b58562c63ba97f1e4d
Author: Boss Marco <address@hidden>
AuthorDate: Thu Dec 5 17:04:03 2019 +0100

    fix and backlight file now in .conf too
---
 src/main.c | 27 ++++++++++++++++++++++-----
 taler.conf |  2 ++
 2 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/src/main.c b/src/main.c
index 3e51403..e8d35c7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -491,10 +491,15 @@ static struct MdbCommand approveVend;
 static struct MdbCommand endSession;
 
 /**
- * @brief FRAMEBUFFER_DEVICE framebuffer device to diplay qr code
+ * Name of the framebuffer device (i.e. /dev/fb1).
  */
 static char *framebuffer_device_filename;
 
+/**
+ * Name of the backlight file of @e framebuffer_device_filename (i.e. 
/sys/class/backlight/soc:backlight/brightness).
+ */
+static char *framebuffer_backlight_filename;
+
 /**
  * Name of the UART device with the MDB (i.e. /dev/ttyAMA0).
  */
@@ -1535,7 +1540,7 @@ write_mdb_command (void *cls)
       chkSum += mdb.txBuffer[idx] = mdb.cmd->cmd.bin[idx];
     for (size_t idx = 0; idx < mdb.cmd->data.bin_size; idx++)
       chkSum += mdb.txBuffer[idx + mdb.cmd->cmd.bin_size] =
-        mdb.cmd->data.bin[idx];
+                  mdb.cmd->data.bin[idx];
     mdb.txBuffer[mdb.cmd->cmd.bin_size + mdb.cmd->data.bin_size] =
       (uint8_t) (chkSum & 0xFF);
   }
@@ -2073,7 +2078,19 @@ run (void *cls,
     GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
                                "taler-mdb",
                                "FRAMEBUFFER_DEVICE");
-    uart_device_filename = GNUNET_strdup ("/dev/fb1");
+    framebuffer_device_filename = GNUNET_strdup ("/dev/fb1");
+  }
+  if (GNUNET_OK !=
+      GNUNET_CONFIGURATION_get_value_filename (cfg,
+                                               "taler-mdb",
+                                               "FRAMEBUFFER_BACKLIGHT",
+                                               
&framebuffer_backlight_filename))
+  {
+    GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+                               "taler-mdb",
+                               "FRAMEBUFFER_BACKLIGHT");
+    framebuffer_backlight_filename = GNUNET_strdup (
+      "/sys/class/backlight/soc:backlight/brightness");
   }
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_string (cfg,
@@ -2228,12 +2245,12 @@ run (void *cls,
             * sizeof (uint16_t));
 
     qrDisplay.backlightfd = open (
-      "/sys/class/backlight/soc:backlight/brightness", O_WRONLY);
+      framebuffer_backlight_filename, O_WRONLY);
     if (0 > qrDisplay.backlightfd)
     {
       GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
                                 "open",
-                                
"/sys/class/backlight/soc:backlight/brightness");
+                                framebuffer_backlight_filename);
     }
     else
     {
diff --git a/taler.conf b/taler.conf
index ac50abb..e85fc08 100644
--- a/taler.conf
+++ b/taler.conf
@@ -18,6 +18,8 @@ UART_DEVICE = /dev/ttyAMA0
 
 # Name of the framebuffer to use for the QR code.
 FRAMEBUFFER_DEVICE = /dev/fb1
+# Name of the backlight file for the framebuffer
+FRAMEBUFFER_BACKLIGHT = /sys/class/backlight/soc:backlight/brightness
 
 #Products
 #end declaration

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



reply via email to

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