libnfc
1.7.1
include
nfc
nfc-emulation.h
Go to the documentation of this file.
1
/*-
2
* Free/Libre Near Field Communication (NFC) library
3
*
4
* Libnfc historical contributors:
5
* Copyright (C) 2009 Roel Verdult
6
* Copyright (C) 2009-2013 Romuald Conty
7
* Copyright (C) 2010-2012 Romain Tartière
8
* Copyright (C) 2010-2013 Philippe Teuwen
9
* Copyright (C) 2012-2013 Ludovic Rousseau
10
* See AUTHORS file for a more comprehensive list of contributors.
11
* Additional contributors of this file:
12
*
13
* This program is free software: you can redistribute it and/or modify it
14
* under the terms of the GNU Lesser General Public License as published by the
15
* Free Software Foundation, either version 3 of the License, or (at your
16
* option) any later version.
17
*
18
* This program is distributed in the hope that it will be useful, but WITHOUT
19
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
21
* more details.
22
*
23
* You should have received a copy of the GNU Lesser General Public License
24
* along with this program. If not, see <http://www.gnu.org/licenses/>
25
*/
26
32
#ifndef __NFC_EMULATION_H__
33
#define __NFC_EMULATION_H__
34
35
#include <sys/types.h>
36
#include <
nfc/nfc.h
>
37
38
#ifdef __cplusplus
39
extern
"C"
{
40
#endif
/* __cplusplus */
41
42
struct
nfc_emulator
;
43
struct
nfc_emulation_state_machine
;
44
49
struct
nfc_emulator
{
50
nfc_target
*target;
51
struct
nfc_emulation_state_machine
*state_machine;
52
void
*user_data;
53
};
54
59
struct
nfc_emulation_state_machine
{
60
int (*io)(
struct
nfc_emulator
*emulator,
const
uint8_t *data_in,
const
size_t
data_in_len, uint8_t *data_out,
const
size_t
data_out_len);
61
void
*data;
62
};
63
64
NFC_EXPORT
int
nfc_emulate_target
(
nfc_device
*pnd,
struct
nfc_emulator
*emulator,
const
int
timeout);
65
66
#ifdef __cplusplus
67
}
68
#endif
/* __cplusplus */
69
70
71
#endif
/* __NFC_EMULATION_H__ */
nfc_device
NFC device information.
Definition:
nfc-internal.h:190
nfc_emulate_target
NFC_EXPORT int nfc_emulate_target(nfc_device *pnd, struct nfc_emulator *emulator, const int timeout)
Emulate a target.
Definition:
nfc-emulation.c:48
nfc_target
NFC target structure.
Definition:
nfc-types.h:328
nfc_emulation_state_machine
NFC emulation state machine structure.
Definition:
nfc-emulation.h:59
nfc_emulator
NFC emulator structure.
Definition:
nfc-emulation.h:49
nfc.h
libnfc interface
Generated by
1.8.17