diff options
Diffstat (limited to 'easytool/easycard.h')
-rw-r--r-- | easytool/easycard.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/easytool/easycard.h b/easytool/easycard.h index 37caf1f..8979524 100644 --- a/easytool/easycard.h +++ b/easytool/easycard.h @@ -1,6 +1,8 @@ #ifndef EASYCARD_H #define EASYCARD_H +#include <nfc/nfc-types.h> +#include <nfc/mifaretag.h> #include "utils.h" #define EASY_TT_MRT_ENTER 0x00 @@ -52,17 +54,31 @@ struct easy_log_rec { uint8_t unknown3[2]; } __attribute__ ((packed)); +/* functions for data format conversion */ + time_t easy_timestamp2time(const uint8_t *easy_ts); char *easy_asc_timestamp(const uint8_t *timestamp); -/* apply a telta (positive or negative) to a EasyCard log record */ +/* functions to make a change to individual portions of the card */ + +/* apply a delta (positive or negative) to a EasyCard log record */ int easy_update_log_rec(struct easy_log_rec *elr, int16_t delta); /* apply a delta to the 'sum of day' record in Sector 15 Block 2 */ int easy_update_sum_of_day(struct easy_sect15blk2 *s15b2, int16_t delta); -void easy_dump_log_rec(const struct easy_log_rec *elr); +/* functions to make a comprehensive change, leave all card state in + * a consistent state */ -typedef mifare_tag; +/* positive value: make it more expensive. negative: cheaper */ +int easy_alter_last_purchase(mifare_tag *mft, int16_t delta); +/* positive value: make it more expensive. negative: cheaper */ +int easy_alter_last_recharge(mifare_tag *mft, int16_t delta); + +/* functions to dump the transaction log */ + +/* dump a single log record */ +void easy_dump_log_rec(const struct easy_log_rec *elr); +/* dump the entire transaction log */ void easy_dump_log(mifare_tag *mft); #endif /* EASYCARD_H */ |