summaryrefslogtreecommitdiff
path: root/easytool
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-08-12 18:40:13 +0800
committerHarald Welte <laforge@gnumonks.org>2010-08-12 18:40:13 +0800
commit6b11875a07f58817a82aae689458be90f8d691c0 (patch)
treef5c579b08266f86940e027bb7d8ca5b8705039c7 /easytool
parent9c008a1decbaf79b5158ff31cc72296431cd2d85 (diff)
print MRT station name
Diffstat (limited to 'easytool')
-rw-r--r--easytool/easytool.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/easytool/easytool.c b/easytool/easytool.c
index 6086916..4481385 100644
--- a/easytool/easytool.c
+++ b/easytool/easytool.c
@@ -96,7 +96,10 @@ struct easy_log_rec {
uint8_t trans_type;
uint16_t amount; /* transaction amount / value */
uint16_t remaining; /* remaining value on card _after_ trans */
- uint8_t unknown2[6];
+ uint8_t unknown2;
+ uint8_t station_code; /* MRT station code */
+ uint16_t reader_code; /* unique code of RFID reader */
+ uint8_t unknown3[2];
} __attribute__ ((packed));
static time_t convert_timestamp(const uint8_t *easy_ts)
@@ -113,6 +116,14 @@ static void dump_easy_log(const struct easy_log_rec *elr)
t_tm->tm_hour, t_tm->tm_min,
get_value_string(easy_tt_names, elr->trans_type),
elr->amount, elr->remaining);
+ switch (elr->trans_type) {
+ case EASY_TT_MRT_ENTER:
+ case EASY_TT_MRT_EXIT:
+ printf("\tMRT Station %s\n",
+ get_value_string(taipei_mrt_stn_id,
+ elr->station_code));
+ break;
+ }
}
static void dump_mfcl(mifare_tag *mft)
personal git repositories of Harald Welte. Your mileage may vary