This PR adds everything that's needed on the segatools side to add E-Money support regarding Thinca authentication cards. I've also included set-up documentation (with a network side bonus which was as far as I could figure out so far, but I'm pretty certain no more changes to segatools will be needed) Due to the nature of a custom protcol called TCAP that Thinca uses for networking (see docs), I can't fully test that everything works as I haven't yet bothered to figure that protocol out. Tested with both APMv3 and FGO.  Reviewed-on: TeamTofuShop/segatools#35 Co-authored-by: Haruka <haruka@noreply.gitea.tendokyu.moe> Co-committed-by: Haruka <haruka@noreply.gitea.tendokyu.moe>
46 lines
967 B
C
46 lines
967 B
C
#pragma once
|
|
|
|
#include <windows.h>
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
#include "hook/iobuf.h"
|
|
|
|
#include "iccard/felica.h"
|
|
#include "iccard/mifare.h"
|
|
|
|
struct sg_nfc_ops {
|
|
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;
|
|
unsigned int gen;
|
|
unsigned int proxy_flag;
|
|
struct felica felica;
|
|
struct mifare mifare;
|
|
const wchar_t* authdata_path;
|
|
};
|
|
|
|
void sg_nfc_init(
|
|
struct sg_nfc *nfc,
|
|
uint8_t addr,
|
|
const struct sg_nfc_ops *ops,
|
|
unsigned int gen,
|
|
unsigned int proxy_flag,
|
|
const wchar_t* authdata_path,
|
|
void *ops_ctx);
|
|
|
|
void sg_nfc_transact(
|
|
struct sg_nfc *nfc,
|
|
struct iobuf *res_frame,
|
|
const void *req_bytes,
|
|
size_t req_nbytes);
|