[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-mdb] branch master updated: Commented Code
From: |
gnunet |
Subject: |
[taler-taler-mdb] branch master updated: Commented Code |
Date: |
Sun, 29 Dec 2019 14:21:29 +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 8c3dd6a Commented Code
8c3dd6a is described below
commit 8c3dd6adc49436abf582d0a5271de5d99dda480f
Author: Dominik Hofer <address@hidden>
AuthorDate: Sun Dec 29 14:21:21 2019 +0100
Commented Code
---
src/main.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++----------
1 file changed, 69 insertions(+), 13 deletions(-)
diff --git a/src/main.c b/src/main.c
index b85578f..14062c6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -23,8 +23,6 @@ along with
* @author Christian Grothoff
* @author Dominik Hofer
*
-* TODO:
-* - comment code mdb incl. doxygen struct members (hofer)
*/
#include "config.h"
#include <stdio.h>
@@ -231,8 +229,14 @@ along with
*/
struct MdbBlock
{
+ /**
+ * Data containing a mdb command or the data of an mdb command
+ */
uint8_t *bin;
-
+
+ /**
+ * Size of the data referenced by *bin
+ */
size_t bin_size;
};
@@ -242,10 +246,19 @@ struct MdbBlock
*/
struct MdbCommand
{
- const char *name;
+ /**
+ * Name of the command for the logging
+ */
+ const char *name;
+ /**
+ * Data block containing the information about the mdb command
+ */
struct MdbBlock cmd;
-
+
+ /**
+ * Data block containing the information about the mdb command data
+ */
struct MdbBlock data;
};
@@ -364,19 +377,40 @@ struct PaymentActivity
*/
struct MdbHandle
{
-
+
+ /**
+ * Buffer to save the received data from UART
+ */
uint8_t rxBuffer[MAX_SIZE_RX_BUFFER];
+ /**
+ * Buffer to save the data to send via UART
+ */
uint8_t txBuffer[MAX_SIZE_TX_BUFFER];
+ /**
+ * Reference to scheduler task to read from UART
+ */
struct GNUNET_SCHEDULER_Task *rtask;
-
+
+ /**
+ * Reference to scheduler task to write to UART
+ */
struct GNUNET_SCHEDULER_Task *wtask;
+ /**
+ * Reference to the mdb cmd which will be sent next
+ */
const struct MdbCommand *cmd;
-
+
+ /**
+ * Reference to the mdb cmd which was sent last
+ */
const struct MdbCommand *last_cmd;
+ /**
+ * Current read offset in @e rxBuffer.
+ */
size_t rx_off;
/**
@@ -390,12 +424,24 @@ struct MdbHandle
*/
size_t tx_len;
+ /**
+ * Time out to wait for an acknoweledge received via the mdb bus
+ */
struct GNUNET_TIME_Absolute ack_timeout;
+ /**
+ * Backup of the config data to restore the configuration of the UART before
closing it
+ */
struct termios uart_opts_backup;
+ /**
+ * Indicates if a vend session is running or not
+ */
int session_running;
+ /**
+ * File descriptor to the UART device file
+ */
int uartfd;
};
@@ -437,6 +483,16 @@ struct Display
struct fb_fix_screeninfo fix_info;
};
+/**
+ * Handle for the Cancel Button
+ */
+struct CancelButton
+{
+ /**
+ * File descriptor to read the state of the cancel button gpio pin
+ */
+ int cancelbuttonfd;
+};
/**
* DLL of pending refund operations.
*/
@@ -486,10 +542,13 @@ static int global_ret;
static int in_shutdown;
/**
- * Refenence to the keyboard task
+ * Reference to the keyboard task
*/
static struct GNUNET_SCHEDULER_Task *keyboard_task;
+/**
+ * Reference to the cancel button task
+ */
static struct GNUNET_SCHEDULER_Task *cancelbutton_task;
/**
@@ -626,10 +685,7 @@ static char backlight_on = '1';
*/
static char backlight_off = '0';
-struct CancelButton
-{
- int cancelbuttonfd;
-};
+
static struct CancelButton cancelButton;
/**
* Name of the UART device with the MDB (i.e. /dev/ttyAMA0).
--
To stop receiving notification emails like this one, please contact
address@hidden.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-taler-mdb] branch master updated: Commented Code,
gnunet <=