1
0
mirror of https://gitea.tendokyu.moe/Dniel97/segatools.git synced 2024-11-24 05:20:10 +01:00
segatools-dniel97/board/sg-nfc.h
Tau 8606d17699 board/sg-nfc.c: Pass UID consistently
If we receive it from the upper ops layer then we should send it
back as well.
2019-02-26 13:49:29 -05:00

36 lines
682 B
C

#pragma once
#include <windows.h>
#include <stddef.h>
#include <stdint.h>
#include "hook/iobuf.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);
};
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);