2018-11-21 01:26:11 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <windows.h>
|
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#include "hook/iobuf.h"
|
|
|
|
|
|
|
|
struct sg_nfc_ops {
|
2018-12-17 22:09:56 +00:00
|
|
|
HRESULT (*mifare_poll)(void *ctx, uint32_t *uid);
|
2019-02-25 22:23:04 +00:00
|
|
|
HRESULT (*mifare_read_luid)(
|
|
|
|
void *ctx,
|
|
|
|
uint32_t uid,
|
|
|
|
uint8_t *luid,
|
|
|
|
size_t nbytes);
|
2018-11-21 01:26:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct sg_nfc {
|
|
|
|
const struct sg_nfc_ops *ops;
|
|
|
|
void *ops_ctx;
|
|
|
|
uint8_t addr;
|
|
|
|
};
|
|
|
|
|
|
|
|
void sg_nfc_init(
|
|
|
|
struct sg_nfc *nfc,
|
|
|
|
uint8_t addr,
|
|
|
|
const struct sg_nfc_ops *ops,
|
|
|
|
void *ops_ctx);
|
|
|
|
|
|
|
|
void sg_nfc_transact(
|
|
|
|
struct sg_nfc *nfc,
|
|
|
|
struct iobuf *resp_frame,
|
|
|
|
const void *req_bytes,
|
|
|
|
size_t req_nbytes);
|