Merge "Remove test for overloaded function."
diff --git a/Android.bp b/Android.bp
index 5d7c8b8..2350c5f 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,6 +1,7 @@
// This is an autogenerated file, do not edit.
subdirs = [
"benchmarks/msgq/1.0",
+ "bluetooth/1.0",
"nfc/1.0",
"nfc/1.0/default",
"radio/1.0",
diff --git a/benchmarks/msgq/1.0/IBenchmarkMsgQ.hal b/benchmarks/msgq/1.0/IBenchmarkMsgQ.hal
index 2e50335..3af0b71 100644
--- a/benchmarks/msgq/1.0/IBenchmarkMsgQ.hal
+++ b/benchmarks/msgq/1.0/IBenchmarkMsgQ.hal
@@ -20,36 +20,37 @@
/*
* This method requests the service to set up Synchronous read/write
* wait-free FMQ with the client as reader.
- * @return ret Will be 0 if the setup is successful.
+ * @return ret Will be true if the setup was successful, false otherwise.
* @return mqDescIn This structure describes the FMQ that was set up
* by the service. Client can use it to set up the FMQ at its end.
*/
configureClientInboxSyncReadWrite()
- generates(int32_t ret, MQDescriptorSync mqDescIn);
+ generates(bool ret, MQDescriptorSync mqDescIn);
/*
* This method requests the service to set up Synchronous read/write
* wait-free FMQ with the client as writer.
- * @return Will be 0 if the setup is successful.
+ * @return ret Will be true if the setup was successful, false otherwise.
* @return mqDescOut This structure describes the FMQ that was set up
* by the service. Client can use it to set up the FMQ at its end.
*/
configureClientOutboxSyncReadWrite()
- generates(int32_t ret, MQDescriptorSync mqDescOut);
+ generates(bool ret, MQDescriptorSync mqDescOut);
/*
* This method request the service to write into the FMQ.
* @param count Number to messages to write.
- * @ret Number of messages succesfully written.
+ * @return ret Will be true if the write operation was successful,
+ * false otherwise.
*/
- requestWrite(int32_t count) generates (int32_t ret);
+ requestWrite(int32_t count) generates (bool ret);
/*
* This method request the service to read from the FMQ.
* @param count Number to messages to read.
- * @ret Number of messages succesfully read.
+ * @ret Will be true if the read operation was successful, false otherwise.
*/
- requestRead(int32_t count) generates (int32_t ret);
+ requestRead(int32_t count) generates (bool ret);
/*
* This method kicks off a benchmarking experiment where
diff --git a/bluetooth/1.0/Android.bp b/bluetooth/1.0/Android.bp
new file mode 100644
index 0000000..c5f898d
--- /dev/null
+++ b/bluetooth/1.0/Android.bp
@@ -0,0 +1,54 @@
+// This file is autogenerated by hidl-gen. Do not edit manually.
+
+genrule {
+ name: "android.hardware.bluetooth@1.0_genc++",
+ tool: "hidl-gen",
+ cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.bluetooth@1.0",
+ srcs: [
+ "types.hal",
+ "IBluetoothHci.hal",
+ "IBluetoothHciCallbacks.hal",
+ ],
+ out: [
+ "android/hardware/bluetooth/1.0/types.cpp",
+ "android/hardware/bluetooth/1.0/BluetoothHciAll.cpp",
+ "android/hardware/bluetooth/1.0/BluetoothHciCallbacksAll.cpp",
+ ],
+}
+
+genrule {
+ name: "android.hardware.bluetooth@1.0_genc++_headers",
+ tool: "hidl-gen",
+ cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.bluetooth@1.0",
+ srcs: [
+ "types.hal",
+ "IBluetoothHci.hal",
+ "IBluetoothHciCallbacks.hal",
+ ],
+ out: [
+ "android/hardware/bluetooth/1.0/types.h",
+ "android/hardware/bluetooth/1.0/IBluetoothHci.h",
+ "android/hardware/bluetooth/1.0/IHwBluetoothHci.h",
+ "android/hardware/bluetooth/1.0/BnBluetoothHci.h",
+ "android/hardware/bluetooth/1.0/BpBluetoothHci.h",
+ "android/hardware/bluetooth/1.0/BsBluetoothHci.h",
+ "android/hardware/bluetooth/1.0/IBluetoothHciCallbacks.h",
+ "android/hardware/bluetooth/1.0/IHwBluetoothHciCallbacks.h",
+ "android/hardware/bluetooth/1.0/BnBluetoothHciCallbacks.h",
+ "android/hardware/bluetooth/1.0/BpBluetoothHciCallbacks.h",
+ "android/hardware/bluetooth/1.0/BsBluetoothHciCallbacks.h",
+ ],
+}
+
+cc_library_shared {
+ name: "android.hardware.bluetooth@1.0",
+ generated_sources: ["android.hardware.bluetooth@1.0_genc++"],
+ generated_headers: ["android.hardware.bluetooth@1.0_genc++_headers"],
+ export_generated_headers: ["android.hardware.bluetooth@1.0_genc++_headers"],
+ shared_libs: [
+ "libhidl",
+ "libhwbinder",
+ "libutils",
+ "libcutils",
+ ],
+}
diff --git a/bluetooth/1.0/Android.mk b/bluetooth/1.0/Android.mk
new file mode 100644
index 0000000..7100765
--- /dev/null
+++ b/bluetooth/1.0/Android.mk
@@ -0,0 +1,144 @@
+# This file is autogenerated by hidl-gen. Do not edit manually.
+
+LOCAL_PATH := $(call my-dir)
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.bluetooth@1.0-java
+LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+
+intermediates := $(local-generated-sources-dir)
+
+HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
+
+#
+# Build types.hal (Status)
+#
+GEN := $(intermediates)/android/hardware/bluetooth/1.0/Status.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.bluetooth@1.0::types.Status
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IBluetoothHci.hal
+#
+GEN := $(intermediates)/android/hardware/bluetooth/1.0/IBluetoothHci.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IBluetoothHci.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IBluetoothHciCallbacks.hal
+$(GEN): $(LOCAL_PATH)/IBluetoothHciCallbacks.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.bluetooth@1.0::IBluetoothHci
+
+$(GEN): $(LOCAL_PATH)/IBluetoothHci.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IBluetoothHciCallbacks.hal
+#
+GEN := $(intermediates)/android/hardware/bluetooth/1.0/IBluetoothHciCallbacks.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IBluetoothHciCallbacks.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.bluetooth@1.0::IBluetoothHciCallbacks
+
+$(GEN): $(LOCAL_PATH)/IBluetoothHciCallbacks.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_JAVA_LIBRARY)
+
+
+################################################################################
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := android.hardware.bluetooth@1.0-java-static
+LOCAL_MODULE_CLASS := JAVA_LIBRARIES
+
+intermediates := $(local-generated-sources-dir)
+
+HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
+
+#
+# Build types.hal (Status)
+#
+GEN := $(intermediates)/android/hardware/bluetooth/1.0/Status.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.bluetooth@1.0::types.Status
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IBluetoothHci.hal
+#
+GEN := $(intermediates)/android/hardware/bluetooth/1.0/IBluetoothHci.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IBluetoothHci.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IBluetoothHciCallbacks.hal
+$(GEN): $(LOCAL_PATH)/IBluetoothHciCallbacks.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.bluetooth@1.0::IBluetoothHci
+
+$(GEN): $(LOCAL_PATH)/IBluetoothHci.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build IBluetoothHciCallbacks.hal
+#
+GEN := $(intermediates)/android/hardware/bluetooth/1.0/IBluetoothHciCallbacks.java
+$(GEN): $(HIDL)
+$(GEN): PRIVATE_HIDL := $(HIDL)
+$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IBluetoothHciCallbacks.hal
+$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/types.hal
+$(GEN): $(LOCAL_PATH)/types.hal
+$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
+$(GEN): PRIVATE_CUSTOM_TOOL = \
+ $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
+ -Ljava -randroid.hardware:hardware/interfaces \
+ android.hardware.bluetooth@1.0::IBluetoothHciCallbacks
+
+$(GEN): $(LOCAL_PATH)/IBluetoothHciCallbacks.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+include $(BUILD_STATIC_JAVA_LIBRARY)
+
+
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/bluetooth/1.0/IBluetoothHci.hal b/bluetooth/1.0/IBluetoothHci.hal
new file mode 100644
index 0000000..10cf914
--- /dev/null
+++ b/bluetooth/1.0/IBluetoothHci.hal
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.bluetooth@1.0;
+
+import IBluetoothHciCallbacks;
+
+/*
+ * The Host Controller Interface (HCI) is the layer defined by the Bluetooth
+ * specification between the software that runs on the host and the Bluetooth
+ * controller chip. This boundary is the natural choice for a Hardware
+ * Abstraction Layer (HAL). Dealing only in HCI packets and events simplifies
+ * the stack and abstracts away power management, initialization, and other
+ * implementation-specific details related to the hardware.
+ */
+
+interface IBluetoothHci {
+ /**
+ * Initialize the underlying HCI interface.
+ *
+ * This method should be used to initialize any hardware interfaces
+ * required to communicate with the Bluetooth hardware in the
+ * device.
+ *
+ * @param callback implements IBluetoothHciCallbacks which will
+ * receive callbacks when incoming HCI packets are received
+ * from the controller to be sent to the host.
+ * @return status result of the initialization
+ */
+ initialize(IBluetoothHciCallbacks callback) generates (Status status);
+
+ /**
+ * Send an HCI command (as specified in the Bluetooth Specification
+ * V4.2, Vol 2, Part 5, Section 5.4.1) to the Bluetooth controller.
+ * Commands must be executed in order.
+ *
+ * @param command is the HCI command to be sent
+ */
+ sendHciCommand(HciPacket command);
+
+ /**
+ * Send an HCI ACL data packet (as specified in the Bluetooth Specification
+ * V4.2, Vol 2, Part 5, Section 5.4.2) to the Bluetooth controller.
+ * Packets must be processed in order.
+ * @param data HCI data packet to be sent
+ */
+ sendAclData(HciPacket data);
+
+ /**
+ * Send an SCO data packet (as specified in the Bluetooth Specification
+ * V4.2, Vol 2, Part 5, Section 5.4.3) to the Bluetooth controller.
+ * Packets must be processed in order.
+ * @param data HCI data packet to be sent
+ */
+ sendScoData(HciPacket data);
+
+ /**
+ * Close the HCI interface
+ */
+ close();
+};
diff --git a/bluetooth/1.0/IBluetoothHciCallbacks.hal b/bluetooth/1.0/IBluetoothHciCallbacks.hal
new file mode 100644
index 0000000..afaab6c
--- /dev/null
+++ b/bluetooth/1.0/IBluetoothHciCallbacks.hal
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.bluetooth@1.0;
+
+/* The interface from the Bluetooth Controller to the stack. */
+interface IBluetoothHciCallbacks {
+ /**
+ * This function is invoked when an HCI event is received from the
+ * Bluetooth controller to be forwarded to the Bluetooth stack.
+ * @param event is the HCI event to be sent to the Bluetooth stack.
+ */
+ oneway hciEventReceived(HciPacket event);
+
+ /**
+ * Send an ACL data packet form the controller to the host.
+ * @param data the ACL HCI packet to be passed to the host stack
+ */
+ oneway aclDataReceived(HciPacket data);
+
+ /**
+ * Send a SCO data packet form the controller to the host.
+ * @param data the SCO HCI packet to be passed to the host stack
+ */
+ oneway scoDataReceived(HciPacket data);
+};
diff --git a/bluetooth/1.0/types.hal b/bluetooth/1.0/types.hal
new file mode 100644
index 0000000..5f5570a
--- /dev/null
+++ b/bluetooth/1.0/types.hal
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.bluetooth@1.0;
+
+enum Status : int32_t {
+ SUCCESS,
+ TRANSPORT_ERROR,
+ INITIALIZATION_ERROR,
+ UNKNOWN
+};
+
+/**
+ * HCI packets are transmitted as a vector of type uint8_t.
+ */
+typedef vec<uint8_t> HciPacket;
diff --git a/nfc/1.0/Android.mk b/nfc/1.0/Android.mk
index b6840bc..07775e9 100644
--- a/nfc/1.0/Android.mk
+++ b/nfc/1.0/Android.mk
@@ -13,9 +13,9 @@
HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
#
-# Build types.hal (nfc_data_t)
+# Build types.hal (NfcEvent)
#
-GEN := $(intermediates)/android/hardware/nfc/1.0/nfc_data_t.java
+GEN := $(intermediates)/android/hardware/nfc/1.0/NfcEvent.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -23,16 +23,16 @@
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava -randroid.hardware:hardware/interfaces \
- android.hardware.nfc@1.0::types.nfc_data_t
+ android.hardware.nfc@1.0::types.NfcEvent
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (nfc_event_t)
+# Build types.hal (NfcStatus)
#
-GEN := $(intermediates)/android/hardware/nfc/1.0/nfc_event_t.java
+GEN := $(intermediates)/android/hardware/nfc/1.0/NfcStatus.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -40,24 +40,7 @@
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava -randroid.hardware:hardware/interfaces \
- android.hardware.nfc@1.0::types.nfc_event_t
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (nfc_status_t)
-#
-GEN := $(intermediates)/android/hardware/nfc/1.0/nfc_status_t.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava -randroid.hardware:hardware/interfaces \
- android.hardware.nfc@1.0::types.nfc_status_t
+ android.hardware.nfc@1.0::types.NfcStatus
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
@@ -116,9 +99,9 @@
HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
#
-# Build types.hal (nfc_data_t)
+# Build types.hal (NfcEvent)
#
-GEN := $(intermediates)/android/hardware/nfc/1.0/nfc_data_t.java
+GEN := $(intermediates)/android/hardware/nfc/1.0/NfcEvent.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -126,16 +109,16 @@
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava -randroid.hardware:hardware/interfaces \
- android.hardware.nfc@1.0::types.nfc_data_t
+ android.hardware.nfc@1.0::types.NfcEvent
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (nfc_event_t)
+# Build types.hal (NfcStatus)
#
-GEN := $(intermediates)/android/hardware/nfc/1.0/nfc_event_t.java
+GEN := $(intermediates)/android/hardware/nfc/1.0/NfcStatus.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -143,24 +126,7 @@
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava -randroid.hardware:hardware/interfaces \
- android.hardware.nfc@1.0::types.nfc_event_t
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (nfc_status_t)
-#
-GEN := $(intermediates)/android/hardware/nfc/1.0/nfc_status_t.java
-$(GEN): $(HIDL)
-$(GEN): PRIVATE_HIDL := $(HIDL)
-$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
-$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
-$(GEN): PRIVATE_CUSTOM_TOOL = \
- $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
- -Ljava -randroid.hardware:hardware/interfaces \
- android.hardware.nfc@1.0::types.nfc_status_t
+ android.hardware.nfc@1.0::types.NfcStatus
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
diff --git a/nfc/1.0/INfc.hal b/nfc/1.0/INfc.hal
index 88fd39a..f003b2c 100644
--- a/nfc/1.0/INfc.hal
+++ b/nfc/1.0/INfc.hal
@@ -27,7 +27,7 @@
* NCI initialization - ie accept CORE_RESET and subsequent commands through
* the write() call.
*
- * If open() returns 0, the NCI stack will wait for a HAL_NFC_OPEN_CPLT_EVT
+ * If open() returns 0, the NCI stack will wait for a NfcEvent.OPEN_CPLT
* before continuing.
*
* If open() returns any other value, the NCI stack will stop.
@@ -41,32 +41,32 @@
* This method may queue writes and return immediately. The only
* requirement is that the writes are executed in order.
*/
- write(nfc_data_t data) generates (int32_t retval);
+ write(NfcData data) generates (int32_t retval);
/*
- * core_initialized() is called after the CORE_INIT_RSP is received from the NFCC.
+ * coreInitialized() is called after the CORE_INIT_RSP is received from the NFCC.
* At this time, the HAL can do any chip-specific configuration.
*
- * If core_initialized() returns 0, the NCI stack will wait for a HAL_NFC_POST_INIT_CPLT_EVT
+ * If coreInitialized() returns 0, the NCI stack will wait for a NfcEvent.POST_INIT_CPLT
* before continuing.
*
- * If core_initialized() returns any other value, the NCI stack will continue
+ * If coreInitialized() returns any other value, the NCI stack will continue
* immediately.
*/
- core_initialized(vec<uint8_t> data) generates (int32_t retval);
+ coreInitialized(NfcData data) generates (int32_t retval);
/*
- * pre_discover is called every time before starting RF discovery.
+ * prediscover is called every time before starting RF discovery.
* It is a good place to do vendor-specific configuration that must be
* performed every time RF discovery is about to be started.
*
- * If pre_discover() returns 0, the NCI stack will wait for a HAL_NFC_PRE_DISCOVER_CPLT_EVT
+ * If prediscover() returns 0, the NCI stack will wait for a NfcEvent.PREDISCOVER_CPLT
* before continuing.
*
- * If pre_discover() returns any other value, the NCI stack will start
+ * If prediscover() returns any other value, the NCI stack will start
* RF discovery immediately.
*/
- pre_discover() generates (int32_t retval);
+ prediscover() generates (int32_t retval);
/*
* Close the NFC controller. Should free all resources.
@@ -75,15 +75,15 @@
/*
* Grant HAL the exclusive control to send NCI commands.
- * Called in response to HAL_REQUEST_CONTROL_EVT.
+ * Called in response to NfcEvent.REQUEST_CONTROL.
* Must only be called when there are no NCI commands pending.
- * HAL_RELEASE_CONTROL_EVT will notify when HAL no longer needs exclusive control.
+ * NfcEvent.RELEASE_CONTROL will notify when HAL no longer needs exclusive control.
*/
- control_granted() generates (int32_t retval);
+ controlGranted() generates (int32_t retval);
/*
* Restart controller by power cyle;
- * HAL_OPEN_CPLT_EVT will notify when operation is complete.
+ * NfcEvent.OPEN_CPLT will notify when operation is complete.
*/
- power_cycle() generates (int32_t retval);
+ powerCycle() generates (int32_t retval);
};
diff --git a/nfc/1.0/INfcClientCallback.hal b/nfc/1.0/INfcClientCallback.hal
index f10062e..a56cc09 100644
--- a/nfc/1.0/INfcClientCallback.hal
+++ b/nfc/1.0/INfcClientCallback.hal
@@ -21,11 +21,11 @@
* The callback passed in from the NFC stack that the HAL
* can use to pass events back to the stack.
*/
- sendEvent(nfc_event_t event, nfc_status_t event_status);
+ sendEvent(NfcEvent event, NfcStatus status);
/*
* The callback passed in from the NFC stack that the HAL
* can use to pass incomming data to the stack.
*/
- sendData(nfc_data_t data);
+ sendData(NfcData data);
};
diff --git a/nfc/1.0/default/Nfc.cpp b/nfc/1.0/default/Nfc.cpp
index b836ada..d3868c1 100644
--- a/nfc/1.0/default/Nfc.cpp
+++ b/nfc/1.0/default/Nfc.cpp
@@ -19,19 +19,19 @@
// Methods from ::android::hardware::nfc::V1_0::INfc follow.
::android::hardware::Return<int32_t> Nfc::open(const sp<INfcClientCallback>& clientCallback) {
mCallback = clientCallback;
- return mDevice->open(mDevice, event_callback, data_callback);
+ return mDevice->open(mDevice, eventCallback, dataCallback);
}
-::android::hardware::Return<int32_t> Nfc::write(const nfc_data_t& data) {
- return mDevice->write(mDevice, data.data.size(), &data.data[0]);
+::android::hardware::Return<int32_t> Nfc::write(const hidl_vec<uint8_t>& data) {
+ return mDevice->write(mDevice, data.size(), &data[0]);
}
-::android::hardware::Return<int32_t> Nfc::core_initialized(const hidl_vec<uint8_t>& data) {
+::android::hardware::Return<int32_t> Nfc::coreInitialized(const hidl_vec<uint8_t>& data) {
hidl_vec<uint8_t> copy = data;
return mDevice->core_initialized(mDevice, ©[0]);
}
-::android::hardware::Return<int32_t> Nfc::pre_discover() {
+::android::hardware::Return<int32_t> Nfc::prediscover() {
return mDevice->pre_discover(mDevice);
}
@@ -39,11 +39,11 @@
return mDevice->close(mDevice);
}
-::android::hardware::Return<int32_t> Nfc::control_granted() {
+::android::hardware::Return<int32_t> Nfc::controlGranted() {
return mDevice->control_granted(mDevice);
}
-::android::hardware::Return<int32_t> Nfc::power_cycle() {
+::android::hardware::Return<int32_t> Nfc::powerCycle() {
return mDevice->power_cycle(mDevice);
}
diff --git a/nfc/1.0/default/Nfc.h b/nfc/1.0/default/Nfc.h
index 98cd57e..e596495 100644
--- a/nfc/1.0/default/Nfc.h
+++ b/nfc/1.0/default/Nfc.h
@@ -13,7 +13,6 @@
using ::android::hardware::nfc::V1_0::INfc;
using ::android::hardware::nfc::V1_0::INfcClientCallback;
-using ::android::hardware::nfc::V1_0::nfc_data_t;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
@@ -23,23 +22,23 @@
struct Nfc : public INfc {
Nfc(nfc_nci_device_t* device);
::android::hardware::Return<int32_t> open(const sp<INfcClientCallback>& clientCallback) override;
- ::android::hardware::Return<int32_t> write(const nfc_data_t& data) override;
- ::android::hardware::Return<int32_t> core_initialized(const hidl_vec<uint8_t>& data) override;
- ::android::hardware::Return<int32_t> pre_discover() override;
+ ::android::hardware::Return<int32_t> write(const hidl_vec<uint8_t>& data) override;
+ ::android::hardware::Return<int32_t> coreInitialized(const hidl_vec<uint8_t>& data) override;
+ ::android::hardware::Return<int32_t> prediscover() override;
::android::hardware::Return<int32_t> close() override;
- ::android::hardware::Return<int32_t> control_granted() override;
- ::android::hardware::Return<int32_t> power_cycle() override;
+ ::android::hardware::Return<int32_t> controlGranted() override;
+ ::android::hardware::Return<int32_t> powerCycle() override;
- static void event_callback(uint8_t event, uint8_t status) {
+ static void eventCallback(uint8_t event, uint8_t status) {
if (mCallback != nullptr) {
mCallback->sendEvent(
- (::android::hardware::nfc::V1_0::nfc_event_t) event,
- (::android::hardware::nfc::V1_0::nfc_status_t) status);
+ (::android::hardware::nfc::V1_0::NfcEvent) event,
+ (::android::hardware::nfc::V1_0::NfcStatus) status);
}
}
- static void data_callback(uint16_t data_len, uint8_t* p_data) {
- nfc_data_t data;
- data.data.setToExternal(p_data, data_len);
+ static void dataCallback(uint16_t data_len, uint8_t* p_data) {
+ hidl_vec<uint8_t> data;
+ data.setToExternal(p_data, data_len);
if (mCallback != nullptr) {
mCallback->sendData(data);
}
diff --git a/nfc/1.0/default/service.cpp b/nfc/1.0/default/service.cpp
index 8952052..e70388d 100644
--- a/nfc/1.0/default/service.cpp
+++ b/nfc/1.0/default/service.cpp
@@ -26,7 +26,7 @@
const char instance[] = "nfc_nci";
ALOGI("Retrieving default implementation of instance %s.",
instance);
- android::sp<INfc> service = INfc::getService(instance, true);
+ android::sp<INfc> service = INfc::getService(instance, true /* getStub */);
if (service.get() == nullptr) {
ALOGE("INfc::getService returned NULL, exiting");
return -1;
@@ -35,7 +35,7 @@
instance, (service->isRemote() ? "REMOTE" : "LOCAL"));
LOG_FATAL_IF(service->isRemote(), "Implementation is REMOTE!");
ALOGI("Registering instance %s.", instance);
- service->registerAsService("nfc_nci");
+ service->registerAsService(instance);
ALOGI("Ready.");
ProcessState::self()->setThreadPoolMaxThreadCount(0);
diff --git a/nfc/1.0/types.hal b/nfc/1.0/types.hal
index 738dfd9..a266178 100644
--- a/nfc/1.0/types.hal
+++ b/nfc/1.0/types.hal
@@ -16,24 +16,22 @@
package android.hardware.nfc@1.0;
-enum nfc_event_t : uint32_t {
- HAL_NFC_OPEN_CPLT_EVT = 0,
- HAL_NFC_CLOSE_CPLT_EVT = 1,
- HAL_NFC_POST_INIT_CPLT_EVT = 2,
- HAL_NFC_PRE_DISCOVER_CPLT_EVT = 3,
- HAL_NFC_REQUEST_CONTROL_EVT = 4,
- HAL_NFC_RELEASE_CONTROL_EVT = 5,
- HAL_NFC_ERROR_EVT = 6
+enum NfcEvent : uint32_t {
+ OPEN_CPLT = 0,
+ CLOSE_CPLT = 1,
+ POST_INIT_CPLT = 2,
+ PRE_DISCOVER_CPLT = 3,
+ REQUEST_CONTROL = 4,
+ RELEASE_CONTROL = 5,
+ ERROR = 6
};
-enum nfc_status_t : uint32_t {
- HAL_NFC_STATUS_OK = 0,
- HAL_NFC_STATUS_FAILED = 1,
- HAL_NFC_STATUS_ERR_TRANSPORT = 2,
- HAL_NFC_STATUS_ERR_CMD_TIMEOUT = 3,
- HAL_NFC_STATUS_REFUSED = 4
+enum NfcStatus : uint32_t {
+ OK = 0,
+ FAILED = 1,
+ ERR_TRANSPORT = 2,
+ ERR_CMD_TIMEOUT = 3,
+ REFUSED = 4
};
-struct nfc_data_t {
- vec<uint8_t> data;
-};
+typedef vec<uint8_t> NfcData;
diff --git a/tests/msgq/1.0/ITestMsgQ.hal b/tests/msgq/1.0/ITestMsgQ.hal
index 93a6e8a..fc96181 100644
--- a/tests/msgq/1.0/ITestMsgQ.hal
+++ b/tests/msgq/1.0/ITestMsgQ.hal
@@ -20,24 +20,26 @@
/*
* This method requests the service to set up Synchronous read/write
* wait-free FMQ with the client as reader.
- * @return ret Will be 0 if the setup is successful.
+ * @return ret Will be true if the setup is successful, false otherwise.
* @return mqDesc This structure describes the FMQ that was
* set up by the service. Client can use it to set up the FMQ at its end.
*/
configureFmqSyncReadWrite()
- generates(int32_t ret, MQDescriptorSync mqDesc);
+ generates(bool ret, MQDescriptorSync mqDesc);
/*
* This method request the service to write into the FMQ.
* @param count Number to messages to write.
- * @ret Number of messages succesfully written.
+ * @return ret Will be true if the write operation was successful,
+ * false otherwise.
*/
- requestWrite(int32_t count) generates(int32_t ret);
+ requestWrite(int32_t count) generates(bool ret);
/*
* This method request the service to read from the FMQ.
* @param count Number to messages to read.
- * @ret Number of messages succesfully read.
+ * @return ret Will be true if the read operation was successful, false
+ * otherwise.
*/
- requestRead(int32_t count) generates(int32_t ret);
+ requestRead(int32_t count) generates(bool ret);
};
diff --git a/tests/pointer/1.0/IPointer.hal b/tests/pointer/1.0/IPointer.hal
index e68fb31..4560a4a 100644
--- a/tests/pointer/1.0/IPointer.hal
+++ b/tests/pointer/1.0/IPointer.hal
@@ -17,6 +17,8 @@
package android.hardware.tests.pointer@1.0;
interface IPointer {
+ struct S { int32_t data; };
+ struct A { S s; };
// type declarations
struct Sam { int32_t data; };
struct Ada { ref<Sam> s_ptr; };