summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-08-12 19:10:47 +0800
committerHarald Welte <laforge@gnumonks.org>2010-08-12 19:10:47 +0800
commit138096b4d2595818f0c14776e46a06cfc3395f6c (patch)
tree11617f77145f9689022dfcbc18c405be329ed2af
parented097192e3e53d92ed6f701f93bb1aae997caddd (diff)
add transaction number parsing
-rw-r--r--easytool/easytool.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/easytool/easytool.c b/easytool/easytool.c
index 8ab2262..b2436c6 100644
--- a/easytool/easytool.c
+++ b/easytool/easytool.c
@@ -91,7 +91,8 @@ static void parse_acc_bits(struct acc_bits_parsed *abp, uint8_t *acc_bits)
/* storage of a transaction log record on the transponder itself */
struct easy_log_rec {
- uint8_t unknown[2];
+ uint8_t trans_id;
+ uint8_t unknown;
uint8_t timestamp[3]; /* seconds since January 1st 1970 / 256 */
uint8_t trans_type;
uint16_t amount; /* transaction amount / value */
@@ -111,9 +112,9 @@ static void dump_easy_log(const struct easy_log_rec *elr)
{
time_t t_time = convert_timestamp(elr->timestamp);
struct tm *t_tm = gmtime(&t_time);
- printf("%4u-%02u-%02u %02u:%02u | %10s | Paid %4u NTD | %4u NTD remaining\n",
+ printf("%4u-%02u-%02u %02u:%02u | %02x | %10s | Paid %4u NTD | %4u NTD remaining\n",
t_tm->tm_year+1900, t_tm->tm_mon+1, t_tm->tm_mday,
- t_tm->tm_hour, t_tm->tm_min,
+ t_tm->tm_hour, t_tm->tm_min, elr->trans_id,
get_value_string(easy_tt_names, elr->trans_type),
elr->amount, elr->remaining);
switch (elr->trans_type) {
personal git repositories of Harald Welte. Your mileage may vary