diff options
author | Ruchi Kandoi | 2017-12-04 19:05:24 -0600 |
---|---|---|
committer | Ruchi Kandoi | 2018-02-01 10:32:07 -0600 |
commit | 4475917d651b01c659d7db668f6b5f437662b0df (patch) | |
tree | 8f13be7aad9f7f01928306f5bf0964af5de0f20b /nfc/1.1 | |
parent | de542acbbf46812cfb53d231ecb50048baf8780e (diff) | |
download | platform-hardware-interfaces-4475917d651b01c659d7db668f6b5f437662b0df.tar.gz platform-hardware-interfaces-4475917d651b01c659d7db668f6b5f437662b0df.tar.xz platform-hardware-interfaces-4475917d651b01c659d7db668f6b5f437662b0df.zip |
Add NFC HAL 1.1
Adds factoryReset(). This must be used by the HAL to clear the chip and
use the do a full initialization at the next init.
Adds closeForPowerOffCase(). There are vendor specific
configurations that are need during NFC power off to enable low battery
and power off use cases. This will distinguish cases where the user
turns NFC off because they do not want to use NFC and NFC is turned off
as a result of device switched off.
HCI_NETWORK_RESET event has been added to indicate something went wrong
on the firmware level and HCI network needs to be re-initialized.
Bug: 70294869
Bug: 70294551
Test: Run VtsHalNfcV1_1TargetTest
Change-Id: Ib981a56ac94e06b74bd901a159791f09ea16483a
Diffstat (limited to 'nfc/1.1')
-rw-r--r-- | nfc/1.1/Android.bp | 23 | ||||
-rw-r--r-- | nfc/1.1/INfc.hal | 52 | ||||
-rw-r--r-- | nfc/1.1/INfcClientCallback.hal | 28 | ||||
-rw-r--r-- | nfc/1.1/types.hal | 23 |
4 files changed, 126 insertions, 0 deletions
diff --git a/nfc/1.1/Android.bp b/nfc/1.1/Android.bp new file mode 100644 index 00000000..73dc70ad --- /dev/null +++ b/nfc/1.1/Android.bp | |||
@@ -0,0 +1,23 @@ | |||
1 | // This file is autogenerated by hidl-gen -Landroidbp. | ||
2 | |||
3 | hidl_interface { | ||
4 | name: "android.hardware.nfc@1.1", | ||
5 | root: "android.hardware", | ||
6 | vndk: { | ||
7 | enabled: true, | ||
8 | }, | ||
9 | srcs: [ | ||
10 | "types.hal", | ||
11 | "INfc.hal", | ||
12 | "INfcClientCallback.hal", | ||
13 | ], | ||
14 | interfaces: [ | ||
15 | "android.hardware.nfc@1.0", | ||
16 | "android.hidl.base@1.0", | ||
17 | ], | ||
18 | types: [ | ||
19 | "NfcEvent", | ||
20 | ], | ||
21 | gen_java: true, | ||
22 | } | ||
23 | |||
diff --git a/nfc/1.1/INfc.hal b/nfc/1.1/INfc.hal new file mode 100644 index 00000000..ea6a571c --- /dev/null +++ b/nfc/1.1/INfc.hal | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2017 The Android Open Source Project | ||
3 | * | ||
4 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | * you may not use this file except in compliance with the License. | ||
6 | * You may obtain a copy of the License at | ||
7 | * | ||
8 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | * | ||
10 | * Unless required by applicable law or agreed to in writing, software | ||
11 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | * See the License for the specific language governing permissions and | ||
14 | * limitations under the License. | ||
15 | */ | ||
16 | package android.hardware.nfc@1.1; | ||
17 | |||
18 | import @1.1::INfcClientCallback; | ||
19 | import @1.0::INfc; | ||
20 | import @1.0::NfcStatus; | ||
21 | |||
22 | interface INfc extends @1.0::INfc { | ||
23 | /** | ||
24 | * Clears the NFC chip. | ||
25 | * | ||
26 | * Must be called during factory reset and/or before the first time the HAL is | ||
27 | * initialized after a factory reset | ||
28 | */ | ||
29 | factoryReset(); | ||
30 | |||
31 | /** | ||
32 | * Enable Power off use cases and close the NFC controller. | ||
33 | * Should free all resources. | ||
34 | * | ||
35 | * This call must enable NFC functionality for off host usecases in power | ||
36 | * off use cases, if the device supports power off use cases. If the | ||
37 | * device doesn't support power off use cases, this call should be same as | ||
38 | * close() | ||
39 | * | ||
40 | * @return NfcStatus::OK on success and NfcStatus::FAILED on error. | ||
41 | */ | ||
42 | closeForPowerOffCase() generates (NfcStatus status); | ||
43 | |||
44 | /** | ||
45 | * Open call to take the @1.1::INfcClientCallback | ||
46 | * | ||
47 | * @param clientCallback for sending events and data to client. | ||
48 | * @return status NfcStatus::FAILED in case of error, | ||
49 | * NfcStatus::SUCCESS otherwise. | ||
50 | */ | ||
51 | open_1_1(INfcClientCallback clientCallback) generates (NfcStatus status); | ||
52 | }; | ||
diff --git a/nfc/1.1/INfcClientCallback.hal b/nfc/1.1/INfcClientCallback.hal new file mode 100644 index 00000000..8e1a7bc8 --- /dev/null +++ b/nfc/1.1/INfcClientCallback.hal | |||
@@ -0,0 +1,28 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2018 The Android Open Source Project | ||
3 | * | ||
4 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | * you may not use this file except in compliance with the License. | ||
6 | * You may obtain a copy of the License at | ||
7 | * | ||
8 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | * | ||
10 | * Unless required by applicable law or agreed to in writing, software | ||
11 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | * See the License for the specific language governing permissions and | ||
14 | * limitations under the License. | ||
15 | */ | ||
16 | |||
17 | package android.hardware.nfc@1.1; | ||
18 | |||
19 | import @1.0::INfcClientCallback; | ||
20 | import @1.0::NfcStatus; | ||
21 | |||
22 | interface INfcClientCallback extends @1.0::INfcClientCallback { | ||
23 | /** | ||
24 | * The callback passed in from the NFC stack that the HAL | ||
25 | * can use to pass events back to the stack. | ||
26 | */ | ||
27 | sendEvent_1_1(NfcEvent event, NfcStatus status); | ||
28 | }; | ||
diff --git a/nfc/1.1/types.hal b/nfc/1.1/types.hal new file mode 100644 index 00000000..2f5ec7f0 --- /dev/null +++ b/nfc/1.1/types.hal | |||
@@ -0,0 +1,23 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2017 The Android Open Source Project | ||
3 | * | ||
4 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | * you may not use this file except in compliance with the License. | ||
6 | * You may obtain a copy of the License at | ||
7 | * | ||
8 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | * | ||
10 | * Unless required by applicable law or agreed to in writing, software | ||
11 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | * See the License for the specific language governing permissions and | ||
14 | * limitations under the License. | ||
15 | */ | ||
16 | package android.hardware.nfc@1.1; | ||
17 | |||
18 | import @1.0::NfcEvent; | ||
19 | |||
20 | enum NfcEvent : @1.0::NfcEvent { | ||
21 | /** In case of an error, HCI network needs to be re-initialized */ | ||
22 | HCI_NETWORK_RESET = 7 | ||
23 | }; | ||