diff options
author | Boss Marco <bossm8@students.bfh.ch> | 2019-12-24 17:12:12 +0100 |
---|---|---|
committer | Boss Marco <bossm8@students.bfh.ch> | 2019-12-24 17:12:12 +0100 |
commit | d53044f1fe2e0bb8d30a8895f826aa2cc75272bb (patch) | |
tree | ab1eac112e164f15c6abdde78c0ee95d52b7ea11 | |
parent | 9ef6c44fc8fa36c069234c115863d2398f64eb4c (diff) | |
download | taler-mdb-d53044f1fe2e0bb8d30a8895f826aa2cc75272bb.tar.gz taler-mdb-d53044f1fe2e0bb8d30a8895f826aa2cc75272bb.tar.bz2 taler-mdb-d53044f1fe2e0bb8d30a8895f826aa2cc75272bb.zip |
updated readme
-rw-r--r-- | README | 49 | ||||
-rw-r--r-- | src/main.c | 50 |
2 files changed, 53 insertions, 46 deletions
@@ -1,43 +1,50 @@ -# Project: GNU Taler snack machine +# GNU Taler snack machine #### Author(s) * BOSS Marco * HOFER Dominik * GROTHOFF Christian -#### Prerequisite +#### Prequisites * GNU gcc tool-chain * C standard libraries * libnfc - * libcurl - * pthread + * libcurl/libgnurl + * libjansson * GNU make - * GNUnet + * GNUNet * GNU Taler (exchange + merchant) + * libqrencode (optional) #### Tested on * Ubuntu LTS (18.04) + * Raspian Lite (4.19) -#### Description - This is a app to run a snack machine as Taler merchant with NFC payment interface. +#### Hardware used for prototype + * Raspberry Pi 3B+ + * ACR122U NFC USB reader + * MDB/ICP Converter from Shanghai Wafer Microelectronics + * Adafruit PiTFT 3.5" display -#### Tasks - Improve documentation - Integration testing +#### Description +This is a app to run a snack machine as Taler merchant with NFC payment interface. +Optionally there can a QRCode be shown on a display to get the payment link. #### Remarks - * When using an ACR122 device there may be problems with libnfc, see libnfc for further information + * When using an ACR122 device there may be problems with libnfc. + [see here](https://github.com/nfc-tools/libnfc) for further information + * At the moment there is no option to cross compile -#### Noticeable points - * Taler wallet does not receive a second message when the payment was aborted, the wallet - has to be started again to receive a message via nfc - * Wallet does not show succes url string +#### Build +Building should be easily done with the following three commands: + ```bash + ./bootstrap + ./configure + make + ``` -=================== +#### Configuration +To configure the merchants backend and the product numbers of the snack machine edit +taler.conf file. -TODO: -- generate upper-case URLs once wallet supports TALER:// -- document your functions Doxygen-style, in particular - you must document every function, every argument, - every struct, every member of every struct @@ -19,7 +19,7 @@ along with /** * @file main.c * @brief main functionality of the application -* @author Boss Marco +* @author Marco Boss * @author Christian Grothoff * @author Dominik Hofer * @@ -1756,7 +1756,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); } @@ -1930,9 +1930,9 @@ handle_command (const char *hex, } break; } - case VMC_REVALUE: - { - unsigned int subcmd; + case VMC_REVALUE: + { + unsigned int subcmd; if (4 > hex_len) { @@ -1955,27 +1955,27 @@ handle_command (const char *hex, case VMC_REVALUE_REQUEST: { GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "Received request for revalue via MDB\n"); - mdb.cmd = &revalueApproved; + "Received request for revalue via MDB\n"); + mdb.cmd = &revalueApproved; + break; + } + case VMC_REVALUE_LIMIT_REQUEST: + { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Received request for revalue limit amount via MDB\n"); + mdb.cmd = &revalueAmount; break; } - case VMC_REVALUE_LIMIT_REQUEST: - { - GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "Received request for revalue limit amount via MDB\n"); - mdb.cmd = &revalueAmount; - break; - } - default: + default: GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Unknown MDB sub-command %X of command %X\n", subcmd, cmd); break; - } - break; - } - case VMC_CONF: + } + break; + } + case VMC_CONF: GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Received request for configuration via MDB\n"); mdb.cmd = &readerConfigData; @@ -2728,13 +2728,13 @@ main (int argc, endSession = setup_mdb_cmd ("End Session", READER_END_SESSION, NULL); - revalueApproved = setup_mdb_cmd ("Reader Approve Revalue", - READER_REVALUE_APPROVED, - NULL); + revalueApproved = setup_mdb_cmd ("Reader Approve Revalue", + READER_REVALUE_APPROVED, + NULL); - revalueAmount = setup_mdb_cmd ("Send Revalue Limit Amount", - READER_REVALUE_LIMIT, - READER_REVALUE_LIMIT_AMOUNT); + revalueAmount = setup_mdb_cmd ("Send Revalue Limit Amount", + READER_REVALUE_LIMIT, + READER_REVALUE_LIMIT_AMOUNT); ret = GNUNET_PROGRAM_run (argc, argv, |