Overhaul card reader emulation

This commit is contained in:
Tau
2019-10-19 15:51:10 -04:00
parent 225a889b34
commit 5ed6eaa203
8 changed files with 451 additions and 198 deletions

View File

@ -7,19 +7,23 @@
#include "hook/iobuf.h"
#include "iccard/felica.h"
#include "iccard/mifare.h"
struct sg_nfc_ops {
HRESULT (*mifare_poll)(void *ctx, uint32_t *uid);
HRESULT (*mifare_read_luid)(
void *ctx,
uint32_t uid,
uint8_t *luid,
size_t nbytes);
HRESULT (*poll)(void *ctx);
HRESULT (*get_aime_id)(void *ctx, uint8_t *luid, size_t nbytes);
HRESULT (*get_felica_id)(void *ctx, uint64_t *IDm);
// TODO Banapass, AmuseIC
};
struct sg_nfc {
const struct sg_nfc_ops *ops;
void *ops_ctx;
uint8_t addr;
struct felica felica;
struct mifare mifare;
};
void sg_nfc_init(