blob: c99af1362c15888aa818832a232848755a9f5a42 [file] [log] [blame]
Andreas Hubera4831392016-07-29 15:05:03 -07001package android.hardware.nfc@1.0;
2
3import INfcClientCallback;
4
Zhuoyao Zhang80b6a122016-08-10 22:37:34 -07005@hal_type(type="NFC")
Andreas Hubera4831392016-07-29 15:05:03 -07006interface INfc {
7 /*
8 * Opens the NFC controller device and performs initialization.
9 * This may include patch download and other vendor-specific initialization.
10 *
11 * If open completes successfully, the controller should be ready to perform
12 * NCI initialization - ie accept CORE_RESET and subsequent commands through
13 * the write() call.
14 *
15 * If open() returns 0, the NCI stack will wait for a HAL_NFC_OPEN_CPLT_EVT
16 * before continuing.
17 *
18 * If open() returns any other value, the NCI stack will stop.
19 *
20 */
21 open(INfcClientCallback clientCallback) generates (int32_t retval);
22
23 /*
24 * Performs an NCI write.
25 *
26 * This method may queue writes and return immediately. The only
27 * requirement is that the writes are executed in order.
28 */
29 write(nfc_data_t data) generates (int32_t retval);
30
31 /*
32 * core_initialized() is called after the CORE_INIT_RSP is received from the NFCC.
33 * At this time, the HAL can do any chip-specific configuration.
34 *
35 * If core_initialized() returns 0, the NCI stack will wait for a HAL_NFC_POST_INIT_CPLT_EVT
36 * before continuing.
37 *
38 * If core_initialized() returns any other value, the NCI stack will continue
39 * immediately.
40 */
41 core_initialized(vec<uint8_t> data) generates (int32_t retval);
42
43 /*
44 * pre_discover is called every time before starting RF discovery.
45 * It is a good place to do vendor-specific configuration that must be
46 * performed every time RF discovery is about to be started.
47 *
48 * If pre_discover() returns 0, the NCI stack will wait for a HAL_NFC_PRE_DISCOVER_CPLT_EVT
49 * before continuing.
50 *
51 * If pre_discover() returns any other value, the NCI stack will start
52 * RF discovery immediately.
53 */
54 pre_discover() generates (int32_t retval);
55
56 /*
57 * Close the NFC controller. Should free all resources.
58 */
59 close() generates (int32_t retval);
60
61 /*
62 * Grant HAL the exclusive control to send NCI commands.
63 * Called in response to HAL_REQUEST_CONTROL_EVT.
64 * Must only be called when there are no NCI commands pending.
65 * HAL_RELEASE_CONTROL_EVT will notify when HAL no longer needs exclusive control.
66 */
67 control_granted() generates (int32_t retval);
68
69 /*
70 * Restart controller by power cyle;
71 * HAL_OPEN_CPLT_EVT will notify when operation is complete.
72 */
73 power_cycle() generates (int32_t retval);
74};