annotate service/rfid_pn532/nfc-nim/nfc-emulation.h @ 507:f3c1d2e7c5df

add missing files for the record Ignore-this: 8541c95ef1644cf85b311259602d2892
author drewp@bigasterisk.com
date Sun, 21 Apr 2019 03:28:21 -0700
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
507
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
1 /*-
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
2 * Free/Libre Near Field Communication (NFC) library
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
3 *
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
4 * Libnfc historical contributors:
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
5 * Copyright (C) 2009 Roel Verdult
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
6 * Copyright (C) 2009-2013 Romuald Conty
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
7 * Copyright (C) 2010-2012 Romain Tartière
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
8 * Copyright (C) 2010-2013 Philippe Teuwen
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
9 * Copyright (C) 2012-2013 Ludovic Rousseau
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
10 * See AUTHORS file for a more comprehensive list of contributors.
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
11 * Additional contributors of this file:
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
12 *
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
13 * This program is free software: you can redistribute it and/or modify it
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
14 * under the terms of the GNU Lesser General Public License as published by the
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
15 * Free Software Foundation, either version 3 of the License, or (at your
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
16 * option) any later version.
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
17 *
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
18 * This program is distributed in the hope that it will be useful, but WITHOUT
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
19 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
20 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
21 * more details.
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
22 *
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
23 * You should have received a copy of the GNU Lesser General Public License
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
24 * along with this program. If not, see <http://www.gnu.org/licenses/>
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
25 */
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
26
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
27 /**
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
28 * @file nfc-emulation.h
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
29 * @brief Provide a small API to ease emulation in libnfc
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
30 */
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
31
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
32 #ifndef __NFC_EMULATION_H__
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
33 #define __NFC_EMULATION_H__
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
34
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
35 #include <sys/types.h>
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
36 #include <nfc/nfc.h>
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
37
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
38 #ifdef __cplusplus
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
39 extern "C" {
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
40 #endif /* __cplusplus */
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
41
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
42 struct nfc_emulator;
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
43 struct nfc_emulation_state_machine;
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
44
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
45 /**
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
46 * @struct nfc_emulator
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
47 * @brief NFC emulator structure
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
48 */
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
49 struct nfc_emulator {
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
50 nfc_target *target;
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
51 struct nfc_emulation_state_machine *state_machine;
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
52 void *user_data;
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
53 };
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
54
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
55 /**
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
56 * @struct nfc_emulation_state_machine
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
57 * @brief NFC emulation state machine structure
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
58 */
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
59 struct nfc_emulation_state_machine {
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
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);
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
61 void *data;
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
62 };
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
63
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
64 NFC_EXPORT int nfc_emulate_target(nfc_device *pnd, struct nfc_emulator *emulator, const int timeout);
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
65
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
66 #ifdef __cplusplus
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
67 }
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
68 #endif /* __cplusplus */
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
69
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
70
f3c1d2e7c5df add missing files for the record
drewp@bigasterisk.com
parents:
diff changeset
71 #endif /* __NFC_EMULATION_H__ */