[AWARE] Update HIDL interface and link to legacy HAL
HAL: Refine first cut implementation of HIDL interfaces and bring
up-to-date with changes to HAL.
Server: connect to legacy HAL, convert all structures.
Bug: 32207606
Test: builds
Change-Id: Ice1ba44014aa98cc948c0d0202b4fd18bf875502
diff --git a/wifi/1.0/Android.mk b/wifi/1.0/Android.mk
index bb8d144..1058cc7 100644
--- a/wifi/1.0/Android.mk
+++ b/wifi/1.0/Android.mk
@@ -36,9 +36,9 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanAvailDuration)
+# Build types.hal (NanBandIndex)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanAvailDuration.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanBandIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -48,7 +48,26 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanAvailDuration
+ android.hardware.wifi@1.0::types.NanBandIndex
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (NanBandSpecificConfig)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanBandSpecificConfig.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 \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.wifi@1.0::types.NanBandSpecificConfig
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
@@ -74,25 +93,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanBeaconSdfPayloadReceive)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanBeaconSdfPayloadReceive.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanBeaconSdfPayloadReceive
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanBeaconSdfPayloadRequest)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanBeaconSdfPayloadRequest.java
@@ -112,9 +112,9 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanCapabilitiesResponse)
+# Build types.hal (NanCapabilities)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanCapabilitiesResponse.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanCapabilities.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -124,16 +124,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanCapabilitiesResponse
+ android.hardware.wifi@1.0::types.NanCapabilities
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanCapabilitiesResponseMsg)
+# Build types.hal (NanCipherSuiteType)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanCapabilitiesResponseMsg.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanCipherSuiteType.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -143,16 +143,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanCapabilitiesResponseMsg
+ android.hardware.wifi@1.0::types.NanCipherSuiteType
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanChannelIndex)
+# Build types.hal (NanClusterEventInd)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanChannelIndex.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanClusterEventInd.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -162,7 +162,26 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanChannelIndex
+ android.hardware.wifi@1.0::types.NanClusterEventInd
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (NanClusterEventType)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanClusterEventType.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 \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.wifi@1.0::types.NanClusterEventType
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
@@ -188,63 +207,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanConnectionType)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanConnectionType.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanConnectionType
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathAppInfo)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathAppInfo.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathAppInfo
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathCfg)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathCfg.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathCfg
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanDataPathChannelCfg)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathChannelCfg.java
@@ -283,82 +245,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanDataPathEndInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathEndInd.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathEndInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathEndRequest)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathEndRequest.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathEndRequest
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathIndicationResponse)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathIndicationResponse.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathIndicationResponse
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathInitiatorRequest)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathInitiatorRequest.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathInitiatorRequest
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanDataPathRequestInd)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathRequestInd.java
@@ -378,9 +264,9 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanDataPathResponse)
+# Build types.hal (NanDebugConfig)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathResponse.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDebugConfig.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -390,16 +276,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathResponse
+ android.hardware.wifi@1.0::types.NanDebugConfig
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanDataPathResponseCode)
+# Build types.hal (NanDiscoveryCommonConfig)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathResponseCode.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDiscoveryCommonConfig.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -409,102 +295,7 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathResponseCode
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathResponseMsg)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathResponseMsg.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathResponseMsg
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDeviceRole)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDeviceRole.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDeviceRole
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDisabledInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDisabledInd.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDisabledInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDiscEngEventInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDiscEngEventInd.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDiscEngEventInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDiscEngEventType)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDiscEngEventType.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDiscEngEventType
+ android.hardware.wifi@1.0::types.NanDiscoveryCommonConfig
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
@@ -530,9 +321,9 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanFollowupInd)
+# Build types.hal (NanFollowupReceivedInd)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanFollowupInd.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanFollowupReceivedInd.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -542,16 +333,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanFollowupInd
+ android.hardware.wifi@1.0::types.NanFollowupReceivedInd
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanFurtherAvailabilityChannel)
+# Build types.hal (NanInitiateDataPathRequest)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanFurtherAvailabilityChannel.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanInitiateDataPathRequest.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -561,7 +352,7 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanFurtherAvailabilityChannel
+ android.hardware.wifi@1.0::types.NanInitiateDataPathRequest
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
@@ -587,25 +378,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanMatchExpiredInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanMatchExpiredInd.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanMatchExpiredInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanMatchInd)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanMatchInd.java
@@ -625,44 +397,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanMaxSize)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanMaxSize.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanMaxSize
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanPublishCancelRequest)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishCancelRequest.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanPublishCancelRequest
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanPublishRequest)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishRequest.java
@@ -682,63 +416,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanPublishResponse)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishResponse.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanPublishResponse
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanPublishResponseMsg)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishResponseMsg.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanPublishResponseMsg
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanPublishTerminatedInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishTerminatedInd.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanPublishTerminatedInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanPublishType)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishType.java
@@ -758,9 +435,9 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanReceiveVendorSpecificAttribute)
+# Build types.hal (NanRangingIndication)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanReceiveVendorSpecificAttribute.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanRangingIndication.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -770,16 +447,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanReceiveVendorSpecificAttribute
+ android.hardware.wifi@1.0::types.NanRangingIndication
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanResponseMsgHeader)
+# Build types.hal (NanRespondToDataPathIndicationRequest)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanResponseMsgHeader.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanRespondToDataPathIndicationRequest.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -789,64 +466,7 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanResponseMsgHeader
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanResponseType)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanResponseType.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanResponseType
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanSocialChannelScanParams)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSocialChannelScanParams.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanSocialChannelScanParams
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanSrfIncludeType)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSrfIncludeType.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanSrfIncludeType
+ android.hardware.wifi@1.0::types.NanRespondToDataPathIndicationRequest
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
@@ -891,25 +511,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanSubscribeCancelRequest)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeCancelRequest.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanSubscribeCancelRequest
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanSubscribeRequest)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeRequest.java
@@ -929,63 +530,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanSubscribeResponse)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeResponse.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanSubscribeResponse
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanSubscribeResponseMsg)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeResponseMsg.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanSubscribeResponseMsg
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanSubscribeTerminatedInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeTerminatedInd.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanSubscribeTerminatedInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanSubscribeType)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeType.java
@@ -1005,25 +549,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanTransmitFollowupInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTransmitFollowupInd.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanTransmitFollowupInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanTransmitFollowupRequest)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTransmitFollowupRequest.java
@@ -1043,63 +568,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanTransmitVendorSpecificAttribute)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTransmitVendorSpecificAttribute.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanTransmitVendorSpecificAttribute
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanTransmitWindowType)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTransmitWindowType.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanTransmitWindowType
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanTxPriority)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTxPriority.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanTxPriority
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanTxType)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTxType.java
@@ -1974,6 +1442,25 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
+# Build types.hal (WifiNanStatus)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/WifiNanStatus.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 \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.wifi@1.0::types.WifiNanStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
# Build types.hal (WifiRateInfo)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/WifiRateInfo.java
@@ -2407,9 +1894,9 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanAvailDuration)
+# Build types.hal (NanBandIndex)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanAvailDuration.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanBandIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -2419,7 +1906,26 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanAvailDuration
+ android.hardware.wifi@1.0::types.NanBandIndex
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (NanBandSpecificConfig)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanBandSpecificConfig.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 \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.wifi@1.0::types.NanBandSpecificConfig
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
@@ -2445,25 +1951,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanBeaconSdfPayloadReceive)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanBeaconSdfPayloadReceive.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanBeaconSdfPayloadReceive
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanBeaconSdfPayloadRequest)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanBeaconSdfPayloadRequest.java
@@ -2483,9 +1970,9 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanCapabilitiesResponse)
+# Build types.hal (NanCapabilities)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanCapabilitiesResponse.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanCapabilities.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -2495,16 +1982,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanCapabilitiesResponse
+ android.hardware.wifi@1.0::types.NanCapabilities
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanCapabilitiesResponseMsg)
+# Build types.hal (NanCipherSuiteType)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanCapabilitiesResponseMsg.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanCipherSuiteType.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -2514,16 +2001,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanCapabilitiesResponseMsg
+ android.hardware.wifi@1.0::types.NanCipherSuiteType
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanChannelIndex)
+# Build types.hal (NanClusterEventInd)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanChannelIndex.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanClusterEventInd.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -2533,7 +2020,26 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanChannelIndex
+ android.hardware.wifi@1.0::types.NanClusterEventInd
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
+# Build types.hal (NanClusterEventType)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanClusterEventType.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 \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.wifi@1.0::types.NanClusterEventType
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
@@ -2559,63 +2065,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanConnectionType)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanConnectionType.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanConnectionType
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathAppInfo)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathAppInfo.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathAppInfo
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathCfg)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathCfg.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathCfg
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanDataPathChannelCfg)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathChannelCfg.java
@@ -2654,82 +2103,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanDataPathEndInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathEndInd.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathEndInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathEndRequest)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathEndRequest.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathEndRequest
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathIndicationResponse)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathIndicationResponse.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathIndicationResponse
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathInitiatorRequest)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathInitiatorRequest.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathInitiatorRequest
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanDataPathRequestInd)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathRequestInd.java
@@ -2749,9 +2122,9 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanDataPathResponse)
+# Build types.hal (NanDebugConfig)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathResponse.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDebugConfig.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -2761,16 +2134,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathResponse
+ android.hardware.wifi@1.0::types.NanDebugConfig
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanDataPathResponseCode)
+# Build types.hal (NanDiscoveryCommonConfig)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathResponseCode.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDiscoveryCommonConfig.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -2780,102 +2153,7 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathResponseCode
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDataPathResponseMsg)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDataPathResponseMsg.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDataPathResponseMsg
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDeviceRole)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDeviceRole.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDeviceRole
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDisabledInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDisabledInd.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDisabledInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDiscEngEventInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDiscEngEventInd.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDiscEngEventInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanDiscEngEventType)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanDiscEngEventType.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanDiscEngEventType
+ android.hardware.wifi@1.0::types.NanDiscoveryCommonConfig
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
@@ -2901,9 +2179,9 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanFollowupInd)
+# Build types.hal (NanFollowupReceivedInd)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanFollowupInd.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanFollowupReceivedInd.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -2913,16 +2191,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanFollowupInd
+ android.hardware.wifi@1.0::types.NanFollowupReceivedInd
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanFurtherAvailabilityChannel)
+# Build types.hal (NanInitiateDataPathRequest)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanFurtherAvailabilityChannel.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanInitiateDataPathRequest.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -2932,7 +2210,7 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanFurtherAvailabilityChannel
+ android.hardware.wifi@1.0::types.NanInitiateDataPathRequest
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
@@ -2958,25 +2236,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanMatchExpiredInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanMatchExpiredInd.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanMatchExpiredInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanMatchInd)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanMatchInd.java
@@ -2996,44 +2255,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanMaxSize)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanMaxSize.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanMaxSize
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanPublishCancelRequest)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishCancelRequest.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanPublishCancelRequest
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanPublishRequest)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishRequest.java
@@ -3053,63 +2274,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanPublishResponse)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishResponse.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanPublishResponse
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanPublishResponseMsg)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishResponseMsg.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanPublishResponseMsg
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanPublishTerminatedInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishTerminatedInd.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanPublishTerminatedInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanPublishType)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanPublishType.java
@@ -3129,9 +2293,9 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanReceiveVendorSpecificAttribute)
+# Build types.hal (NanRangingIndication)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanReceiveVendorSpecificAttribute.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanRangingIndication.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -3141,16 +2305,16 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanReceiveVendorSpecificAttribute
+ android.hardware.wifi@1.0::types.NanRangingIndication
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanResponseMsgHeader)
+# Build types.hal (NanRespondToDataPathIndicationRequest)
#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanResponseMsgHeader.java
+GEN := $(intermediates)/android/hardware/wifi/V1_0/NanRespondToDataPathIndicationRequest.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@@ -3160,64 +2324,7 @@
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanResponseMsgHeader
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanResponseType)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanResponseType.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanResponseType
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanSocialChannelScanParams)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSocialChannelScanParams.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanSocialChannelScanParams
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanSrfIncludeType)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSrfIncludeType.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanSrfIncludeType
+ android.hardware.wifi@1.0::types.NanRespondToDataPathIndicationRequest
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
@@ -3262,25 +2369,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanSubscribeCancelRequest)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeCancelRequest.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanSubscribeCancelRequest
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanSubscribeRequest)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeRequest.java
@@ -3300,63 +2388,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanSubscribeResponse)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeResponse.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanSubscribeResponse
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanSubscribeResponseMsg)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeResponseMsg.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanSubscribeResponseMsg
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanSubscribeTerminatedInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeTerminatedInd.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanSubscribeTerminatedInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanSubscribeType)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanSubscribeType.java
@@ -3376,25 +2407,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanTransmitFollowupInd)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTransmitFollowupInd.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanTransmitFollowupInd
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanTransmitFollowupRequest)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTransmitFollowupRequest.java
@@ -3414,63 +2426,6 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
-# Build types.hal (NanTransmitVendorSpecificAttribute)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTransmitVendorSpecificAttribute.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanTransmitVendorSpecificAttribute
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanTransmitWindowType)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTransmitWindowType.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanTransmitWindowType
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
-# Build types.hal (NanTxPriority)
-#
-GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTxPriority.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 \
- -randroid.hidl:system/libhidl/transport \
- android.hardware.wifi@1.0::types.NanTxPriority
-
-$(GEN): $(LOCAL_PATH)/types.hal
- $(transform-generated-source)
-LOCAL_GENERATED_SOURCES += $(GEN)
-
-#
# Build types.hal (NanTxType)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/NanTxType.java
@@ -4345,6 +3300,25 @@
LOCAL_GENERATED_SOURCES += $(GEN)
#
+# Build types.hal (WifiNanStatus)
+#
+GEN := $(intermediates)/android/hardware/wifi/V1_0/WifiNanStatus.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 \
+ -randroid.hidl:system/libhidl/transport \
+ android.hardware.wifi@1.0::types.WifiNanStatus
+
+$(GEN): $(LOCAL_PATH)/types.hal
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+#
# Build types.hal (WifiRateInfo)
#
GEN := $(intermediates)/android/hardware/wifi/V1_0/WifiRateInfo.java
diff --git a/wifi/1.0/IWifiNanIface.hal b/wifi/1.0/IWifiNanIface.hal
index 2926c4f..3362339 100644
--- a/wifi/1.0/IWifiNanIface.hal
+++ b/wifi/1.0/IWifiNanIface.hal
@@ -39,7 +39,22 @@
generates (WifiStatus status);
/**
- * Enable NAN functionality.
+ * Get NAN capabilities.
+ *
+ * @param cmdId command Id to use for this invocation.
+ * @return status WifiStatus of the operation.
+ * Possible status codes:
+ * |WifiStatusCode.SUCCESS|,
+ * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+ * |WifiStatusCode.ERROR_UNKNOWN|
+ */
+ getCapabilitiesRequest(CommandIdShort cmdId) generates (WifiStatus status);
+
+ /**
+ * Enable NAN: configures and activates NAN clustering (does not start
+ * a discovery session or set up data-interfaces or data-paths). Use the
+ * |configureRequest| method to change the configuration of an already enabled
+ * NAN interface.
*
* @param cmdId command Id to use for this invocation.
* @param msg Instance of |NanEnableRequest|.
@@ -50,7 +65,23 @@
* |WifiStatusCode.ERROR_INVALID_ARGS|,
* |WifiStatusCode.ERROR_UNKNOWN|
*/
- enableRequest(CommandId cmdId, NanEnableRequest msg)
+ enableRequest(CommandIdShort cmdId, NanEnableRequest msg)
+ generates (WifiStatus status);
+
+ /**
+ * Configure NAN: configures an existing NAN functionality (i.e. assumes
+ * |enableRequest| already submitted and succeeded).
+ *
+ * @param cmdId command Id to use for this invocation.
+ * @param msg Instance of |NanConfigRequest|.
+ * @return status WifiStatus of the operation.
+ * Possible status codes:
+ * |WifiStatusCode.SUCCESS|,
+ * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+ * |WifiStatusCode.ERROR_INVALID_ARGS|,
+ * |WifiStatusCode.ERROR_UNKNOWN|
+ */
+ configRequest(CommandIdShort cmdId, NanConfigRequest msg)
generates (WifiStatus status);
/**
@@ -63,10 +94,10 @@
* |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
* |WifiStatusCode.ERROR_UNKNOWN|
*/
- disableRequest(CommandId cmdId) generates (WifiStatus status);
+ disableRequest(CommandIdShort cmdId) generates (WifiStatus status);
/**
- * Publish request to advertize a service.
+ * Publish request to start advertising a discovery service.
*
* @param cmdId command Id to use for this invocation.
* @param msg Instance of |NanPublishRequest|.
@@ -77,26 +108,25 @@
* |WifiStatusCode.ERROR_INVALID_ARGS|,
* |WifiStatusCode.ERROR_UNKNOWN|
*/
- publishRequest(CommandId cmdId, NanPublishRequest msg)
+ startPublishRequest(CommandIdShort cmdId, NanPublishRequest msg)
generates (WifiStatus status);
/**
- * Cancel previous publish requests.
+ * Stop publishing a discovery service.
*
* @param cmdId command Id to use for this invocation.
- * @param msg Instance of |NanPublishCancelRequest|.
+ * @param sessionId ID of the publish discovery session to be stopped.
* @return status WifiStatus of the operation.
* Possible status codes:
* |WifiStatusCode.SUCCESS|,
* |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
- * |WifiStatusCode.ERROR_INVALID_ARGS|,
* |WifiStatusCode.ERROR_UNKNOWN|
*/
- publishCancelRequest(CommandId cmdId, NanPublishCancelRequest msg)
+ stopPublishRequest(CommandIdShort cmdId, uint16_t sessionId)
generates (WifiStatus status);
/**
- * Subscribe request to search for a service.
+ * Subscribe request to start searching for a discovery service.
*
* @param cmdId command Id to use for this invocation.
* @param msg Instance of |NanSubscribeRequest|.
@@ -107,26 +137,25 @@
* |WifiStatusCode.ERROR_INVALID_ARGS|,
* |WifiStatusCode.ERROR_UNKNOWN|
*/
- subscribeRequest(CommandId cmdId, NanSubscribeRequest msg)
+ startSubscribeRequest(CommandIdShort cmdId, NanSubscribeRequest msg)
generates (WifiStatus status);
/**
- * Cancel previous subscribe requests.
+ * Stop subscribing to a discovery service.
*
* @param cmdId command Id to use for this invocation.
- * @param msg Instance of |NanSubscribeCancelRequest|.
+ * @param sessionId ID of the subscribe discovery session to be stopped.
* @return status WifiStatus of the operation.
* Possible status codes:
* |WifiStatusCode.SUCCESS|,
* |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
- * |WifiStatusCode.ERROR_INVALID_ARGS|,
* |WifiStatusCode.ERROR_UNKNOWN|
*/
- subscribeCancelRequest(CommandId cmdId, NanSubscribeCancelRequest msg)
+ stopSubscribeRequest(CommandIdShort cmdId, uint16_t sessionId)
generates (WifiStatus status);
/**
- * NAN transmit follow up request.
+ * NAN transmit follow up message request.
*
* @param cmdId command Id to use for this invocation.
* @param msg Instance of |NanTransmitFollowupRequest|.
@@ -137,14 +166,40 @@
* |WifiStatusCode.ERROR_INVALID_ARGS|,
* |WifiStatusCode.ERROR_UNKNOWN|
*/
- transmitFollowupRequest(CommandId cmdId, NanTransmitFollowupRequest msg)
+ transmitFollowupRequest(CommandIdShort cmdId, NanTransmitFollowupRequest msg)
generates (WifiStatus status);
/**
- * NAN configuration request.
+ * Create a NAN Data Interface.
*
* @param cmdId command Id to use for this invocation.
- * @param msg Instance of |NanConfigRequest|.
+ * @return status WifiStatus of the operation.
+ * Possible status codes:
+ * |WifiStatusCode.SUCCESS|,
+ * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+ * |WifiStatusCode.ERROR_UNKNOWN|
+ */
+ createDataInterfaceRequest(CommandIdShort cmdId, string ifaceName)
+ generates (WifiStatus status);
+
+ /**
+ * Delete a NAN Data Interface.
+ *
+ * @param cmdId command Id to use for this invocation.
+ * @return status WifiStatus of the operation.
+ * Possible status codes:
+ * |WifiStatusCode.SUCCESS|,
+ * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+ * |WifiStatusCode.ERROR_UNKNOWN|
+ */
+ deleteDataInterfaceRequest(CommandIdShort cmdId, string ifaceName)
+ generates (WifiStatus status);
+
+ /**
+ * Initiate a data-path (NDP) setup operation: Initiator.
+ *
+ * @param cmdId command Id to use for this invocation.
+ * @param msg Instance of |NanInitiateDataPathRequest|.
* @return status WifiStatus of the operation.
* Possible status codes:
* |WifiStatusCode.SUCCESS|,
@@ -152,13 +207,42 @@
* |WifiStatusCode.ERROR_INVALID_ARGS|,
* |WifiStatusCode.ERROR_UNKNOWN|
*/
- configRequest(CommandId cmdId, NanConfigRequest msg)
+ initiateDataPathRequest(CommandIdShort cmdId, NanInitiateDataPathRequest msg)
generates (WifiStatus status);
/**
- * Set NAN Beacon or sdf payload to discovery engine.
- * This instructs the Discovery Engine to begin publishing the
- * received payload in any Beacon or Service Discovery Frame transmitted
+ * Respond to a received data indication as part of a data-path (NDP) setup operation. An
+ * indication is received by the Responder from the Initiator.
+ *
+ * @param cmdId command Id to use for this invocation.
+ * @param msg Instance of |NanRespondToDataPathIndicationRequest|.
+ * @return status WifiStatus of the operation.
+ * Possible status codes:
+ * |WifiStatusCode.SUCCESS|,
+ * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+ * |WifiStatusCode.ERROR_INVALID_ARGS|,
+ * |WifiStatusCode.ERROR_UNKNOWN|
+ */
+ respondToDataPathIndicationRequest(CommandIdShort cmdId,
+ NanRespondToDataPathIndicationRequest msg)
+ generates (WifiStatus status);
+
+ /**
+ * Data-path (NDP) termination request: executed by either Initiator or Responder.
+ *
+ * @param cmdId command Id to use for this invocation.
+ * @param ndpInstanceId Data-path instance ID to be terminated.
+ * @return status WifiStatus of the operation.
+ * Possible status codes:
+ * |WifiStatusCode.SUCCESS|,
+ * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+ * |WifiStatusCode.ERROR_UNKNOWN|
+ */
+ terminateDataPathRequest(CommandIdShort cmdId, uint32_t ndpInstanceId)
+ generates (WifiStatus status);
+
+ /**
+ * Configure NAN Beacon or SDF payload to include vendor-specific payload.
*
* @param cmdId command Id to use for this invocation.
* @param msg Instance of |NanBeaconSdfPayloadRequest|.
@@ -169,107 +253,6 @@
* |WifiStatusCode.ERROR_INVALID_ARGS|,
* |WifiStatusCode.ERROR_UNKNOWN|
*/
- beaconSdfPayloadRequest(CommandId cmdId, NanBeaconSdfPayloadRequest msg)
- generates (WifiStatus status);
-
- /**
- * Get NAN HAL version.
- *
- * @param cmdId command Id to use for this invocation.
- * @return version Instance of |NanVersion|.
- * @return status WifiStatus of the operation.
- * Possible status codes:
- * |WifiStatusCode.SUCCESS|,
- * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
- * |WifiStatusCode.ERROR_INVALID_ARGS|,
- * |WifiStatusCode.ERROR_UNKNOWN|
- */
- getVersion() generates (WifiStatus status, NanVersion version);
-
- /**
- * Get NAN capabilities.
- *
- * @param cmdId command Id to use for this invocation.
- * @return status WifiStatus of the operation.
- * Possible status codes:
- * |WifiStatusCode.SUCCESS|,
- * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
- * |WifiStatusCode.ERROR_INVALID_ARGS|,
- * |WifiStatusCode.ERROR_UNKNOWN|
- */
- getCapabilities(CommandId cmdId) generates (WifiStatus status);
-
- /**
- * Create NAN Data Interface
- *
- * @param cmdId command Id to use for this invocation.
- * @return status WifiStatus of the operation.
- * Possible status codes:
- * |WifiStatusCode.SUCCESS|,
- * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
- * |WifiStatusCode.ERROR_INVALID_ARGS|,
- * |WifiStatusCode.ERROR_UNKNOWN|
- */
- dataInterfaceCreate(CommandId cmdId, string ifaceName)
- generates (WifiStatus status);
-
- /**
- * Delete NAN Data Interface.
- *
- * @param cmdId command Id to use for this invocation.
- * @return status WifiStatus of the operation.
- * Possible status codes:
- * |WifiStatusCode.SUCCESS|,
- * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
- * |WifiStatusCode.ERROR_INVALID_ARGS|,
- * |WifiStatusCode.ERROR_UNKNOWN|
- */
- dataInterfaceDelete(CommandId cmdId, string ifaceName)
- generates (WifiStatus status);
-
- /**
- * Initiate a NDP session: Initiator
- *
- * @param cmdId command Id to use for this invocation.
- * @param msg Instance of |NanDataPathInitiatorRequest|.
- * @return status WifiStatus of the operation.
- * Possible status codes:
- * |WifiStatusCode.SUCCESS|,
- * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
- * |WifiStatusCode.ERROR_INVALID_ARGS|,
- * |WifiStatusCode.ERROR_UNKNOWN|
- */
- dataRequestInitiator(CommandId cmdId, NanDataPathInitiatorRequest msg)
- generates (WifiStatus status);
-
- /**
- * Response to a data indication received corresponding to a NDP session. An indication
- * is received with a data request and the responder will send a data response.
- *
- * @param cmdId command Id to use for this invocation.
- * @param msg Instance of |NanDataPathIndicationResponse|.
- * @return status WifiStatus of the operation.
- * Possible status codes:
- * |WifiStatusCode.SUCCESS|,
- * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
- * |WifiStatusCode.ERROR_INVALID_ARGS|,
- * |WifiStatusCode.ERROR_UNKNOWN|
- */
- dataIndicationResponse(CommandId cmdId, NanDataPathIndicationResponse msg)
- generates (WifiStatus status);
-
- /**
- * NDL termination request: from either Initiator/Responder.
- *
- * @param cmdId command Id to use for this invocation.
- * @param msg Instance of |NanDataPathEndRequest|.
- * @return status WifiStatus of the operation.
- * Possible status codes:
- * |WifiStatusCode.SUCCESS|,
- * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
- * |WifiStatusCode.ERROR_INVALID_ARGS|,
- * |WifiStatusCode.ERROR_UNKNOWN|
- */
- dataEnd(CommandId cmdId, NanDataPathEndRequest msg)
+ beaconSdfPayloadRequest(CommandIdShort cmdId, NanBeaconSdfPayloadRequest msg)
generates (WifiStatus status);
};
diff --git a/wifi/1.0/IWifiNanIfaceEventCallback.hal b/wifi/1.0/IWifiNanIfaceEventCallback.hal
index 2b90cba..906d673 100644
--- a/wifi/1.0/IWifiNanIfaceEventCallback.hal
+++ b/wifi/1.0/IWifiNanIfaceEventCallback.hal
@@ -17,65 +17,297 @@
package android.hardware.wifi@1.0;
/**
- * NAN Response and Event Callbacks.
+ * NAN Response and Asynchronous Event Callbacks.
*/
interface IWifiNanIfaceEventCallback {
/**
- * Callback invoked to notify the status of the Publish Request.
+ * Callback invoked in response to a capability request |getCapabilitiesRequest|.
*
* @param cmdId command Id corresponding to the original request.
- * @param rspData Message Data.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * @param capabilities Capability data.
*/
- oneway notifyPublishResponse(CommandId id, NanPublishResponseMsg rspData);
+ oneway notifyCapabilitiesResponse(CommandIdShort id, WifiNanStatus status,
+ NanCapabilities capabilities);
/**
- * Callback invoked to notify the status of the Subscribe Request.
+ * Callback invoked in response to an enable request |enableRequest|.
*
* @param cmdId command Id corresponding to the original request.
- * @param rspData Message Data.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * |NanStatusType.ALREADY_ENABLED|
+ * |NanStatusType.INVALID_ARGS|
+ * |NanStatusType.INTERNAL_FAILURE|
+ * |NanStatusType.PROTOCOL_FAILURE|
+ * |NanStatusType.NAN_NOT_ALLOWED|
*/
- oneway notifySubscribeResponse(CommandId id, NanSubscribeResponseMsg rspData);
+ oneway notifyEnableResponse(CommandIdShort id, WifiNanStatus status);
/**
- * Callback invoked to notify the status of the Data Path Request.
+ * Callback invoked in response to a config request |configRequest|.
*
* @param cmdId command Id corresponding to the original request.
- * @param rspData Message Data.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * |NanStatusType.INVALID_ARGS|
+ * |NanStatusType.INTERNAL_FAILURE|
+ * |NanStatusType.PROTOCOL_FAILURE|
*/
- oneway notifyDataPathResponse(CommandId id, NanDataPathResponseMsg rspData);
+ oneway notifyConfigResponse(CommandIdShort id, WifiNanStatus status);
/**
- * Callback invoked to notify the status of the Capability Request.
+ * Callback invoked in response to a disable request |disableRequest|.
*
* @param cmdId command Id corresponding to the original request.
- * @param rspData Message Data.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * |NanStatusType.PROTOCOL_FAILURE|
*/
- oneway notifyCapabilitiesResponse(CommandId id, NanCapabilitiesResponseMsg rspData);
+ oneway notifyDisableResponse(CommandIdShort id, WifiNanStatus status);
+
+ /**
+ * Callback invoked to notify the status of the start publish request |startPublishRequest|.
+ *
+ * @param cmdId command Id corresponding to the original request.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * |NanStatusType.INVALID_ARGS|
+ * |NanStatusType.PROTOCOL_FAILURE|
+ * |NanStatusType.NO_RESOURCES_AVAILABLE|
+ * |NanStatusType.INVALID_SESSION_ID|
+ * @param sessionId ID of the new publish session (if successfully created).
+ */
+ oneway notifyStartPublishResponse(CommandIdShort id, WifiNanStatus status, uint16_t sessionId);
+
+ /**
+ * Callback invoked in response to a stop publish request |stopPublishRequest|.
+ *
+ * @param cmdId command Id corresponding to the original request.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * |NanStatusType.INVALID_SESSION_ID|
+ * |NanStatusType.INTERNAL_FAILURE|
+ */
+ oneway notifyStopPublishResponse(CommandIdShort id, WifiNanStatus status);
+
+ /**
+ * Callback invoked to notify the status of the start subscribe request |startSubscribeRequest|.
+ *
+ * @param cmdId command Id corresponding to the original request.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * |NanStatusType.INVALID_ARGS|
+ * |NanStatusType.PROTOCOL_FAILURE|
+ * |NanStatusType.NO_RESOURCES_AVAILABLE|
+ * |NanStatusType.INVALID_SESSION_ID|
+ * @param sessionId ID of the new subscribe session (if successfully created).
+ */
+ oneway notifyStartSubscribeResponse(CommandIdShort id, WifiNanStatus status, uint16_t sessionId);
+
+ /**
+ * Callback invoked in response to a stop subscribe request |stopSubscribeRequest|.
+ *
+ * @param cmdId command Id corresponding to the original request.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * |NanStatusType.INVALID_SESSION_ID|
+ * |NanStatusType.INTERNAL_FAILURE|
+ */
+ oneway notifyStopSubscribeResponse(CommandIdShort id, WifiNanStatus status);
+
+ /**
+ * Callback invoked in response to a transmit followup request |transmitFollowupRequest|.
+ *
+ * @param cmdId command Id corresponding to the original request.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * |NanStatusType.INVALID_ARGS|
+ * |NanStatusType.INTERNAL_FAILURE|
+ * |NanStatusType.INVALID_SESSION_ID|
+ * |NanStatusType.INVALID_PEER_ID|
+ */
+ oneway notifyTransmitFollowupResponse(CommandIdShort id, WifiNanStatus status);
+
+ /**
+ * Callback invoked in response to a create data interface request |createDataInterfaceRequest|.
+ *
+ * @param cmdId command Id corresponding to the original request.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * |NanStatusType.INVALID_ARGS|
+ * |NanStatusType.INTERNAL_FAILURE|
+ */
+ oneway notifyCreateDataInterfaceResponse(CommandIdShort id, WifiNanStatus status);
+
+ /**
+ * Callback invoked in response to a delete data interface request |deleteDataInterfaceRequest|.
+ *
+ * @param cmdId command Id corresponding to the original request.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * |NanStatusType.INVALID_ARGS|
+ * |NanStatusType.INTERNAL_FAILURE|
+ */
+ oneway notifyDeleteDataInterfaceResponse(CommandIdShort id, WifiNanStatus status);
+
+ /**
+ * Callback invoked in response to an initiate data path request |initiateDataPathRequest|.
+ *
+ * @param cmdId command Id corresponding to the original request.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * |NanStatusType.INVALID_ARGS|
+ * |NanStatusType.INTERNAL_FAILURE|
+ * |NanStatusType.PROTOCOL_FAILURE|
+ * |NanStatusType.INVALID_PEER_ID|
+ */
+ oneway notifyInitiateDataPathResponse(CommandIdShort id, WifiNanStatus status);
+
+ /**
+ * Callback invoked in response to a respond to data path indication request
+ * |respondToDataPathIndicationRequest|.
+ *
+ * @param cmdId command Id corresponding to the original request.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * |NanStatusType.INVALID_ARGS|
+ * |NanStatusType.INTERNAL_FAILURE|
+ * |NanStatusType.PROTOCOL_FAILURE|
+ * |NanStatusType.INVALID_NDP_ID|
+ * @param ndpInstanceId ID of the new data path being negotiated (on successful status).
+ */
+ oneway notifyRespondToDataPathIndicationResponse(CommandIdShort id, WifiNanStatus status,
+ uint32_t ndpInstanceId);
+
+ /**
+ * Callback invoked in response to a terminate data path request |terminateDataPathRequest|.
+ *
+ * @param cmdId command Id corresponding to the original request.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * |NanStatusType.INVALID_ARGS|
+ * |NanStatusType.INTERNAL_FAILURE|
+ * |NanStatusType.PROTOCOL_FAILURE|
+ * |NanStatusType.INVALID_NDP_ID|
+ */
+ oneway notifyTerminateDataPathResponse(CommandIdShort id, WifiNanStatus status);
+
+ /**
+ * Callback invoked in response to a request to include vendor-specific payload in beacon or SDF
+ * frames |beaconSdfPayloadRequest|.
+ *
+ * @param cmdId command Id corresponding to the original request.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * |NanStatusType.INVALID_ARGS|
+ * |NanStatusType.INTERNAL_FAILURE|
+ */
+ oneway notifyBeaconSdfPayloadResponse(CommandIdShort id, WifiNanStatus status);
/**
* Callbacks for the various asynchornous NAN Events.
*/
- oneway eventPublishTerminated(NanPublishTerminatedInd event);
+ /**
+ * Asynchronous callback indicating that a cluster event has been received.
+ *
+ * @param event: NanClusterEventInd containing event details.
+ */
+ oneway eventClusterEvent(NanClusterEventInd event);
+
+ /**
+ * Asynchronous callback indicating that a NAN has been disabled.
+ *
+ * @param status: WifiNanStatus describing the reason for the disable event.
+ * Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ * |NanStatusType.UNSUPPORTED_CONCURRENCY_NAN_DISABLED|
+ */
+ oneway eventDisabled(WifiNanStatus status);
+
+ /**
+ * Asynchronous callback indicating that an active publish session has terminated.
+ *
+ * @param sessionId: The discovery session ID of the terminated session.
+ * @param status: WifiNanStatus describing the reason for the session termination.
+ * Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ */
+ oneway eventPublishTerminated(uint16_t sessionId, WifiNanStatus status);
+
+ /**
+ * Asynchronous callback indicating that an active subscribe session has terminated.
+ *
+ * @param sessionId: The discovery session ID of the terminated session.
+ * @param status: WifiNanStatus describing the reason for the session termination.
+ * Possible status codes are:
+ * |NanStatusType.SUCCESS|
+ */
+ oneway eventSubscribeTerminated(uint16_t sessionId, WifiNanStatus status);
+
+ /**
+ * Asynchronous callback indicating that a match has occurred: i.e. a service has been
+ * discovered.
+ *
+ * @param event: NanMatchInd containing event details.
+ */
oneway eventMatch(NanMatchInd event);
- oneway eventMatchExpired(NanMatchExpiredInd event);
+ /**
+ * Asynchronous callback indicating that a previously discovered match (service) has expired.
+ *
+ * @param discoverySessionId: The discovery session ID of the expired match.
+ * @param peerId: The peer ID of the expired match.
+ */
+ oneway eventMatchExpired(uint16_t discoverySessionId, uint32_t peerId);
- oneway eventSubscribeTerminated(NanSubscribeTerminatedInd event);
+ /**
+ * Asynchronous callback indicating that a followup message has been received from a peer.
+ *
+ * @param event: NanFollowupReceivedInd containing event details.
+ */
+ oneway eventFollowupReceived(NanFollowupReceivedInd event);
- oneway eventFollowup(NanFollowupInd event);
+ /**
+ * Asynchronous callback providing status on a completed followup message transmit operation.
+ *
+ * @param cmdId command Id corresponding to the original |transmitFollowupRequest| request.
+ * @param status WifiNanStatus of the operation. Possible status codes are:
+ * |NanStatusType.NO_OTA_ACK|
+ * |NanStatusType.FOLLOWUP_TX_QUEUE_FULL|
+ */
+ oneway eventTransmitFollowup(CommandIdShort id, WifiNanStatus status);
- oneway eventDiscEngEvent(NanDiscEngEventInd event);
+ /**
+ * Asynchronous callback indicating a data-path (NDP) setup has been requested by an Initiator
+ * peer (received by the intended Respodner).
+ *
+ * @param event: NanDataPathRequestInd containing event details.
+ */
+ oneway eventDataPathRequest(NanDataPathRequestInd event);
- oneway eventDisabled(NanDisabledInd event);
+ /**
+ * Asynchronous callback indicating a data-path (NDP) setup has been completed: received by
+ * both Initiator and Responder.
+ *
+ * @param event: NanDataPathConfirmInd containing event details.
+ */
+ oneway eventDataPathConfirm(NanDataPathConfirmInd event);
+ /**
+ * Asynchronous callback indicating a list of data-paths (NDP) have been terminated: received by
+ * both Initiator and Responder.
+ *
+ * @param ndpInstanceId: data-path ID of the terminated data-path.
+ */
+ oneway eventDataPathTerminated(uint32_t ndpInstanceId);
+
+ /**
+ * Asynchronous callback indicating vendor-specific payload received in NAN beacon or SDF frame.
+ *
+ * @param event: NanBeaconSdfPayloadInd containing event details.
+ */
oneway eventBeaconSdfPayload(NanBeaconSdfPayloadInd event);
-
- oneway eventDataRequest(NanDataPathRequestInd event);
-
- oneway eventDataConfirm(NanDataPathConfirmInd event);
-
- oneway eventDataEnd(NanDataPathEndInd event);
-
- oneway eventTransmitFollowup(NanTransmitFollowupInd event);
};
diff --git a/wifi/1.0/default/hidl_struct_util.cpp b/wifi/1.0/default/hidl_struct_util.cpp
index a94d812..9cc57bb 100644
--- a/wifi/1.0/default/hidl_struct_util.cpp
+++ b/wifi/1.0/default/hidl_struct_util.cpp
@@ -743,123 +743,10 @@
CHECK(false);
}
-legacy_hal::NanPublishType convertHidlNanPublishTypeToLegacy(
- NanPublishType type) {
- switch (type) {
- case NanPublishType::UNSOLICITED:
- return legacy_hal::NAN_PUBLISH_TYPE_UNSOLICITED;
- case NanPublishType::SOLICITED:
- return legacy_hal::NAN_PUBLISH_TYPE_SOLICITED;
- case NanPublishType::UNSOLICITED_SOLICITED:
- return legacy_hal::NAN_PUBLISH_TYPE_UNSOLICITED_SOLICITED;
- };
- CHECK(false);
-}
-
-legacy_hal::NanTxType convertHidlNanTxTypeToLegacy(NanTxType type) {
- switch (type) {
- case NanTxType::BROADCAST:
- return legacy_hal::NAN_TX_TYPE_BROADCAST;
- case NanTxType::UNICAST:
- return legacy_hal::NAN_TX_TYPE_UNICAST;
- };
- CHECK(false);
-}
-
-legacy_hal::NanMatchAlg convertHidlNanMatchAlgToLegacy(NanMatchAlg type) {
- switch (type) {
- case NanMatchAlg::MATCH_ONCE:
- return legacy_hal::NAN_MATCH_ALG_MATCH_ONCE;
- case NanMatchAlg::MATCH_CONTINUOUS:
- return legacy_hal::NAN_MATCH_ALG_MATCH_CONTINUOUS;
- case NanMatchAlg::MATCH_NEVER:
- return legacy_hal::NAN_MATCH_ALG_MATCH_NEVER;
- };
- CHECK(false);
-}
-
-legacy_hal::NanSubscribeType convertHidlNanSubscribeTypeToLegacy(
- NanSubscribeType type) {
- switch (type) {
- case NanSubscribeType::ACTIVE:
- return legacy_hal::NAN_SUBSCRIBE_TYPE_ACTIVE;
- case NanSubscribeType::PASSIVE:
- return legacy_hal::NAN_SUBSCRIBE_TYPE_PASSIVE;
- };
- CHECK(false);
-}
-
-legacy_hal::NanSRFType convertHidlNanSrfTypeToLegacy(NanSrfType type) {
- switch (type) {
- case NanSrfType::BLOOM_FILTER:
- return legacy_hal::NAN_SRF_ATTR_BLOOM_FILTER;
- case NanSrfType::PARTIAL_MAC_ADDR:
- return legacy_hal::NAN_SRF_ATTR_PARTIAL_MAC_ADDR;
- };
- CHECK(false);
-}
-
-legacy_hal::NanSRFIncludeType convertHidlNanSrfIncludeTypeToLegacy(
- NanSrfIncludeType type) {
- switch (type) {
- case NanSrfIncludeType::DO_NOT_RESPOND:
- return legacy_hal::NAN_SRF_INCLUDE_DO_NOT_RESPOND;
- case NanSrfIncludeType::RESPOND:
- return legacy_hal::NAN_SRF_INCLUDE_RESPOND;
- };
- CHECK(false);
-}
-
NanStatusType convertLegacyNanStatusTypeToHidl(
- legacy_hal::NanStatusType /* type */) {
- // TODO: The |NanStatusType| has changed in legacy HAL and no longer in sync
- // with the HIDL interface.
- return NanStatusType::SUCCESS;
-}
-
-NanResponseType convertLegacyNanResponseTypeToHidl(
- legacy_hal::NanResponseType type) {
- switch (type) {
- case legacy_hal::NAN_RESPONSE_ENABLED:
- return NanResponseType::ENABLED;
- case legacy_hal::NAN_RESPONSE_DISABLED:
- return NanResponseType::DISABLED;
- case legacy_hal::NAN_RESPONSE_PUBLISH:
- return NanResponseType::PUBLISH;
- case legacy_hal::NAN_RESPONSE_PUBLISH_CANCEL:
- return NanResponseType::PUBLISH_CANCEL;
- case legacy_hal::NAN_RESPONSE_TRANSMIT_FOLLOWUP:
- return NanResponseType::TRANSMIT_FOLLOWUP;
- case legacy_hal::NAN_RESPONSE_SUBSCRIBE:
- return NanResponseType::SUBSCRIBE;
- case legacy_hal::NAN_RESPONSE_SUBSCRIBE_CANCEL:
- return NanResponseType::SUBSCRIBE_CANCEL;
- case legacy_hal::NAN_RESPONSE_STATS:
- // Not present in HIDL. Is going to be deprecated in legacy HAL as well.
- CHECK(0);
- case legacy_hal::NAN_RESPONSE_CONFIG:
- return NanResponseType::CONFIG;
- case legacy_hal::NAN_RESPONSE_TCA:
- // Not present in HIDL. Is going to be deprecated in legacy HAL as well.
- CHECK(0);
- case legacy_hal::NAN_RESPONSE_ERROR:
- return NanResponseType::ERROR;
- case legacy_hal::NAN_RESPONSE_BEACON_SDF_PAYLOAD:
- return NanResponseType::BEACON_SDF_PAYLOAD;
- case legacy_hal::NAN_GET_CAPABILITIES:
- return NanResponseType::GET_CAPABILITIES;
- case legacy_hal::NAN_DP_INTERFACE_CREATE:
- return NanResponseType::DP_INTERFACE_CREATE;
- case legacy_hal::NAN_DP_INTERFACE_DELETE:
- return NanResponseType::DP_INTERFACE_DELETE;
- case legacy_hal::NAN_DP_INITIATOR_RESPONSE:
- return NanResponseType::DP_INITIATOR_RESPONSE;
- case legacy_hal::NAN_DP_RESPONDER_RESPONSE:
- return NanResponseType::DP_RESPONDER_RESPONSE;
- case legacy_hal::NAN_DP_END:
- return NanResponseType::DP_END;
- };
- CHECK(false) << "Unknown legacy type: " << type;
+ legacy_hal::NanStatusType type) {
+ // values are identical - may need to do a mapping if they diverge in the future
+ return (NanStatusType) type;
}
bool convertHidlNanEnableRequestToLegacy(
@@ -868,79 +755,123 @@
if (!legacy_request) {
return false;
}
- legacy_request->master_pref = hidl_request.masterPref;
- legacy_request->cluster_low = hidl_request.clusterLow;
- legacy_request->cluster_high = hidl_request.clusterHigh;
- legacy_request->config_support_5g = hidl_request.validSupport5gVal;
- legacy_request->support_5g_val = hidl_request.support5gVal;
- legacy_request->config_sid_beacon = hidl_request.validSidBeaconVal;
- legacy_request->sid_beacon_val = hidl_request.sidBeaconVal;
- legacy_request->config_2dot4g_rssi_close =
- hidl_request.valid2dot4gRssiCloseVal;
- legacy_request->rssi_close_2dot4g_val = hidl_request.rssiClose2dot4gVal;
- legacy_request->config_2dot4g_rssi_middle =
- hidl_request.valid2dot4gRssiMiddleVal;
- legacy_request->rssi_middle_2dot4g_val = hidl_request.rssiMiddle2dot4gVal;
- legacy_request->config_2dot4g_rssi_proximity =
- hidl_request.valid2dot4gRssiProximityVal;
+ memset(legacy_request, 0, sizeof(legacy_hal::NanEnableRequest));
+
+ // TODO: b/34059183 tracks missing configurations in legacy HAL or uknown defaults
+ legacy_request->config_2dot4g_support = 1;
+ legacy_request->support_2dot4g_val = hidl_request.operateInBand[
+ (size_t) NanBandIndex::NAN_BAND_24GHZ];
+ legacy_request->config_support_5g = 1;
+ legacy_request->support_5g_val = hidl_request.operateInBand[(size_t) NanBandIndex::NAN_BAND_5GHZ];
+ legacy_request->config_hop_count_limit = 0; // TODO: don't know default yet
+ legacy_request->hop_count_limit_val = hidl_request.hopCountMax;
+ legacy_request->master_pref = hidl_request.configParams.masterPref;
+ legacy_request->discovery_indication_cfg = 0;
+ legacy_request->discovery_indication_cfg |=
+ hidl_request.configParams.disableDiscoveryAddressChangeIndication ? 0x1 : 0x0;
+ legacy_request->discovery_indication_cfg |=
+ hidl_request.configParams.disableStartedClusterIndication ? 0x2 : 0x0;
+ legacy_request->discovery_indication_cfg |=
+ hidl_request.configParams.disableJoinedClusterIndication ? 0x4 : 0x0;
+ legacy_request->config_sid_beacon = 1;
+ if (hidl_request.configParams.numberOfServiceIdsInBeacon > 127) {
+ return false;
+ }
+ legacy_request->sid_beacon_val = (hidl_request.configParams.includeServiceIdsInBeacon ? 0x1 : 0x0)
+ | (hidl_request.configParams.numberOfServiceIdsInBeacon << 1);
+ legacy_request->config_rssi_window_size = 0; // TODO: don't know default yet
+ legacy_request->rssi_window_size_val = hidl_request.configParams.rssiWindowSize;
+ legacy_request->config_disc_mac_addr_randomization = 1;
+ legacy_request->disc_mac_addr_rand_interval_sec =
+ hidl_request.configParams.macAddressRandomizationIntervalSec;
+ legacy_request->config_responder_auto_response = 1;
+ legacy_request->ranging_auto_response_cfg = hidl_request.configParams.acceptRangingRequests ?
+ legacy_hal::NAN_RANGING_AUTO_RESPONSE_ENABLE : legacy_hal::NAN_RANGING_AUTO_RESPONSE_DISABLE;
+ legacy_request->config_2dot4g_rssi_close = 0; // TODO: don't know default yet
+ legacy_request->rssi_close_2dot4g_val =
+ hidl_request.configParams.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiClose;
+ legacy_request->config_2dot4g_rssi_middle = 0; // TODO: don't know default yet
+ legacy_request->rssi_middle_2dot4g_val =
+ hidl_request.configParams.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiMiddle;
+ legacy_request->config_2dot4g_rssi_proximity = 0; // TODO: don't know default yet
legacy_request->rssi_proximity_2dot4g_val =
- hidl_request.rssiProximity2dot4gVal;
- legacy_request->config_hop_count_limit = hidl_request.validHopCountLimitVal;
- legacy_request->hop_count_limit_val = hidl_request.hopCountLimitVal;
- legacy_request->config_2dot4g_support = hidl_request.valid2dot4gSupportVal;
- legacy_request->support_2dot4g_val = hidl_request.support2dot4gVal;
- legacy_request->config_2dot4g_beacons = hidl_request.valid2dot4gBeaconsVal;
- legacy_request->beacon_2dot4g_val = hidl_request.beacon2dot4gVal;
- legacy_request->config_2dot4g_sdf = hidl_request.valid2dot4gSdfVal;
- legacy_request->sdf_2dot4g_val = hidl_request.sdf2dot4gVal;
- legacy_request->config_5g_beacons = hidl_request.valid5gBeaconsVal;
- legacy_request->beacon_5g_val = hidl_request.beacon5gVal;
- legacy_request->config_5g_sdf = hidl_request.valid5gSdfVal;
- legacy_request->sdf_5g_val = hidl_request.sdf5gVal;
- legacy_request->config_5g_rssi_close = hidl_request.valid5gRssiCloseVal;
- legacy_request->rssi_close_5g_val = hidl_request.rssiClose5gVal;
- legacy_request->config_5g_rssi_middle = hidl_request.valid5gRssiMiddleVal;
- legacy_request->rssi_middle_5g_val = hidl_request.rssiMiddle5gVal;
- legacy_request->config_5g_rssi_close_proximity =
- hidl_request.valid5gRssiCloseProximityVal;
+ hidl_request.configParams.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiProximity;
+ legacy_request->config_scan_params = 0; // TODO: don't know default yet
+ legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_24G_BAND] =
+ hidl_request.configParams.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_24GHZ].dwellTimeMs;
+ legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_24G_BAND] =
+ hidl_request.configParams.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_24GHZ].scanPeriodSec;
+ legacy_request->config_dw.config_2dot4g_dw_band = hidl_request.configParams
+ .bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_24GHZ].validDiscoveryWindowIntervalVal;
+ legacy_request->config_dw.dw_2dot4g_interval_val = hidl_request.configParams
+ .bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_24GHZ].discoveryWindowIntervalVal;
+ legacy_request->config_5g_rssi_close = 0; // TODO: don't know default yet
+ legacy_request->rssi_close_5g_val =
+ hidl_request.configParams.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiClose;
+ legacy_request->config_5g_rssi_middle = 0; // TODO: don't know default yet
+ legacy_request->rssi_middle_5g_val =
+ hidl_request.configParams.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiMiddle;
+ legacy_request->config_5g_rssi_close_proximity = 0; // TODO: don't know default yet
legacy_request->rssi_close_proximity_5g_val =
- hidl_request.rssiCloseProximity5gVal;
- legacy_request->config_rssi_window_size = hidl_request.validRssiWindowSizeVal;
- legacy_request->rssi_window_size_val = hidl_request.rssiWindowSizeVal;
- legacy_request->config_oui = hidl_request.validOuiVal;
- legacy_request->oui_val = hidl_request.ouiVal;
- legacy_request->config_intf_addr = hidl_request.validIntfAddrVal;
- CHECK(hidl_request.intfAddrVal.size() ==
- sizeof(legacy_request->intf_addr_val));
- memcpy(legacy_request->intf_addr_val,
- hidl_request.intfAddrVal.data(),
- hidl_request.intfAddrVal.size());
- legacy_request->config_cluster_attribute_val =
- hidl_request.configClusterAttributeVal;
- legacy_request->config_scan_params = hidl_request.validScanParamsVal;
- if (hidl_request.scanParamsVal.dwellTime.size() >
- sizeof(legacy_request->scan_params_val.dwell_time)) {
- return false;
+ hidl_request.configParams.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiProximity;
+ legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] =
+ hidl_request.configParams.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_5GHZ].dwellTimeMs;
+ legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] =
+ hidl_request.configParams.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_5GHZ].scanPeriodSec;
+ legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_HIGH] =
+ hidl_request.configParams.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_5GHZ].dwellTimeMs;
+ legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_5G_BAND_HIGH] =
+ hidl_request.configParams.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_5GHZ].scanPeriodSec;
+ legacy_request->config_dw.config_5g_dw_band = hidl_request.configParams
+ .bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_5GHZ].validDiscoveryWindowIntervalVal;
+ legacy_request->config_dw.dw_5g_interval_val = hidl_request.configParams
+ .bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_5GHZ].discoveryWindowIntervalVal;
+ if (hidl_request.debugConfigs.validClusterIdVals) {
+ legacy_request->cluster_low = hidl_request.debugConfigs.clusterIdLowVal;
+ legacy_request->cluster_high = hidl_request.debugConfigs.clusterIdHighVal;
+ } else { // need 'else' since not configurable in legacy HAL
+ legacy_request->cluster_low = 0x0000;
+ legacy_request->cluster_high = 0xFFFF;
}
- memcpy(legacy_request->scan_params_val.dwell_time,
- hidl_request.scanParamsVal.dwellTime.data(),
- hidl_request.scanParamsVal.dwellTime.size());
- if (hidl_request.scanParamsVal.scanPeriod.size() >
- sizeof(legacy_request->scan_params_val.scan_period)) {
- return false;
- }
- memcpy(legacy_request->scan_params_val.scan_period,
- hidl_request.scanParamsVal.scanPeriod.data(),
- hidl_request.scanParamsVal.scanPeriod.size());
- legacy_request->config_random_factor_force =
- hidl_request.validRandomFactorForceVal;
- legacy_request->random_factor_force_val = hidl_request.randomFactorForceVal;
- legacy_request->config_hop_count_force = hidl_request.validHopCountLimitVal;
- legacy_request->hop_count_force_val = hidl_request.hopCountLimitVal;
- legacy_request->config_24g_channel = hidl_request.valid24gChannelVal;
- legacy_request->channel_24g_val = hidl_request.channel24gVal;
- legacy_request->config_5g_channel = hidl_request.valid5gChannelVal;
- legacy_request->channel_5g_val = hidl_request.channel5gVal;
+ legacy_request->config_intf_addr = hidl_request.debugConfigs.validIntfAddrVal;
+ memcpy(legacy_request->intf_addr_val, hidl_request.debugConfigs.intfAddrVal.data(), 6);
+ legacy_request->config_oui = hidl_request.debugConfigs.validOuiVal;
+ legacy_request->oui_val = hidl_request.debugConfigs.ouiVal;
+ legacy_request->config_random_factor_force = hidl_request.debugConfigs.validRandomFactorForceVal;
+ legacy_request->random_factor_force_val = hidl_request.debugConfigs.randomFactorForceVal;
+ legacy_request->config_hop_count_force = hidl_request.debugConfigs.validHopCountForceVal;
+ legacy_request->hop_count_force_val = hidl_request.debugConfigs.hopCountForceVal;
+ legacy_request->config_24g_channel = hidl_request.debugConfigs.validDiscoveryChannelVal;
+ legacy_request->channel_24g_val =
+ hidl_request.debugConfigs.discoveryChannelMhzVal[(size_t) NanBandIndex::NAN_BAND_24GHZ];
+ legacy_request->config_5g_channel = hidl_request.debugConfigs.validDiscoveryChannelVal;
+ legacy_request->channel_5g_val = hidl_request.debugConfigs
+ .discoveryChannelMhzVal[(size_t) NanBandIndex::NAN_BAND_5GHZ];
+ legacy_request->config_2dot4g_beacons = hidl_request.debugConfigs.validUseBeaconsInBandVal;
+ legacy_request->beacon_2dot4g_val = hidl_request.debugConfigs
+ .useBeaconsInBandVal[(size_t) NanBandIndex::NAN_BAND_24GHZ];
+ legacy_request->config_5g_beacons = hidl_request.debugConfigs.validUseBeaconsInBandVal;
+ legacy_request->beacon_5g_val = hidl_request.debugConfigs
+ .useBeaconsInBandVal[(size_t) NanBandIndex::NAN_BAND_5GHZ];
+ legacy_request->config_2dot4g_sdf = hidl_request.debugConfigs.validUseSdfInBandVal;
+ legacy_request->sdf_2dot4g_val = hidl_request.debugConfigs
+ .useSdfInBandVal[(size_t) NanBandIndex::NAN_BAND_24GHZ];
+ legacy_request->config_5g_sdf = hidl_request.debugConfigs.validUseSdfInBandVal;
+ legacy_request->sdf_5g_val = hidl_request.debugConfigs
+ .useSdfInBandVal[(size_t) NanBandIndex::NAN_BAND_5GHZ];
+
return true;
}
@@ -950,57 +881,69 @@
if (!legacy_request) {
return false;
}
- legacy_request->publish_id = hidl_request.publishId;
- legacy_request->ttl = hidl_request.ttl;
- legacy_request->period = hidl_request.period;
- legacy_request->publish_type =
- convertHidlNanPublishTypeToLegacy(hidl_request.publishType);
- legacy_request->tx_type = convertHidlNanTxTypeToLegacy(hidl_request.txType);
- legacy_request->publish_count = hidl_request.publishCount;
- if (hidl_request.serviceName.size() > sizeof(legacy_request->service_name)) {
- return false;
- }
- legacy_request->service_name_len = hidl_request.serviceName.size();
- memcpy(legacy_request->service_name,
- hidl_request.serviceName.c_str(),
- hidl_request.serviceName.size());
- legacy_request->publish_match_indicator =
- convertHidlNanMatchAlgToLegacy(hidl_request.publishMatchIndicator);
- if (hidl_request.serviceSpecificInfo.size() >
- sizeof(legacy_request->service_specific_info)) {
- return false;
- }
- legacy_request->service_specific_info_len =
- hidl_request.serviceSpecificInfo.size();
- memcpy(legacy_request->service_specific_info,
- hidl_request.serviceSpecificInfo.data(),
- hidl_request.serviceSpecificInfo.size());
- if (hidl_request.rxMatchFilter.size() >
- sizeof(legacy_request->rx_match_filter)) {
- return false;
- }
- legacy_request->rx_match_filter_len = hidl_request.rxMatchFilter.size();
- memcpy(legacy_request->rx_match_filter,
- hidl_request.rxMatchFilter.data(),
- hidl_request.rxMatchFilter.size());
- if (hidl_request.txMatchFilter.size() >
- sizeof(legacy_request->tx_match_filter)) {
- return false;
- }
- legacy_request->tx_match_filter_len = hidl_request.txMatchFilter.size();
- memcpy(legacy_request->tx_match_filter,
- hidl_request.txMatchFilter.data(),
- hidl_request.txMatchFilter.size());
- legacy_request->rssi_threshold_flag = hidl_request.useRssiThreshold;
- legacy_request->connmap = hidl_request.connmap;
- legacy_request->recv_indication_cfg = hidl_request.recvIndicationCfg;
- return true;
-}
+ memset(&legacy_request, 0, sizeof(legacy_hal::NanPublishRequest));
-bool convertHidlNanPublishCancelRequestToLegacy(
- const NanPublishCancelRequest& hidl_request,
- legacy_hal::NanPublishCancelRequest* legacy_request) {
- legacy_request->publish_id = hidl_request.publishId;
+ legacy_request->publish_id = hidl_request.baseConfigs.sessionId;
+ legacy_request->ttl = hidl_request.baseConfigs.ttlSec;
+ legacy_request->period = hidl_request.baseConfigs.discoveryWindowPeriod;
+ legacy_request->publish_count = hidl_request.baseConfigs.discoveryCount;
+ legacy_request->service_name_len = hidl_request.baseConfigs.serviceName.size();
+ if (legacy_request->service_name_len > NAN_MAX_SERVICE_NAME_LEN) {
+ return false;
+ }
+ memcpy(legacy_request->service_name, hidl_request.baseConfigs.serviceName.c_str(),
+ legacy_request->service_name_len);
+ legacy_request->publish_match_indicator =
+ (legacy_hal::NanMatchAlg) hidl_request.baseConfigs.discoveryMatchIndicator;
+ legacy_request->service_specific_info_len = hidl_request.baseConfigs.serviceSpecificInfo.size();
+ if (legacy_request->service_specific_info_len > NAN_MAX_SERVICE_SPECIFIC_INFO_LEN) {
+ return false;
+ }
+ memcpy(legacy_request->service_specific_info,
+ hidl_request.baseConfigs.serviceSpecificInfo.data(),
+ legacy_request->service_specific_info_len);
+ legacy_request->rx_match_filter_len = hidl_request.baseConfigs.rxMatchFilter.size();
+ if (legacy_request->rx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) {
+ return false;
+ }
+ memcpy(legacy_request->rx_match_filter,
+ hidl_request.baseConfigs.rxMatchFilter.data(),
+ legacy_request->rx_match_filter_len);
+ legacy_request->tx_match_filter_len = hidl_request.baseConfigs.txMatchFilter.size();
+ if (legacy_request->tx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) {
+ return false;
+ }
+ memcpy(legacy_request->tx_match_filter,
+ hidl_request.baseConfigs.txMatchFilter.data(),
+ legacy_request->tx_match_filter_len);
+ legacy_request->rssi_threshold_flag = hidl_request.baseConfigs.useRssiThreshold;
+ legacy_request->recv_indication_cfg = 0;
+ legacy_request->recv_indication_cfg |=
+ hidl_request.baseConfigs.disableDiscoveryTerminationIndication ? 0x1 : 0x0;
+ legacy_request->recv_indication_cfg |=
+ hidl_request.baseConfigs.disableMatchExpirationIndication ? 0x2 : 0x0;
+ legacy_request->recv_indication_cfg |=
+ hidl_request.baseConfigs.disableFollowupReceivedIndication ? 0x4 : 0x0;
+ legacy_request->cipher_type = hidl_request.baseConfigs.supportedCipherTypes;
+ legacy_request->pmk_len = hidl_request.baseConfigs.pmk.size();
+ if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) {
+ return false;
+ }
+ memcpy(legacy_request->pmk,
+ hidl_request.baseConfigs.pmk.data(),
+ legacy_request->pmk_len);
+ legacy_request->sdea_params.security_cfg = hidl_request.baseConfigs.securityEnabledInNdp ?
+ legacy_hal::NAN_DP_CONFIG_SECURITY : legacy_hal::NAN_DP_CONFIG_NO_SECURITY;
+ legacy_request->sdea_params.ranging_state = hidl_request.baseConfigs.rangingRequired ?
+ legacy_hal::NAN_RANGING_ENABLE : legacy_hal::NAN_RANGING_DISABLE;
+ legacy_request->ranging_cfg.ranging_interval_msec = hidl_request.baseConfigs.rangingIntervalMsec;
+ legacy_request->ranging_cfg.config_ranging_indications =
+ hidl_request.baseConfigs.configRangingIndications;
+ legacy_request->ranging_cfg.distance_ingress_cm = hidl_request.baseConfigs.distanceIngressCm;
+ legacy_request->ranging_cfg.distance_egress_cm = hidl_request.baseConfigs.distanceEgressCm;
+ legacy_request->publish_type = (legacy_hal::NanPublishType) hidl_request.publishType;
+ legacy_request->tx_type = (legacy_hal::NanTxType) hidl_request.txType;
+
return true;
}
@@ -1010,225 +953,417 @@
if (!legacy_request) {
return false;
}
- legacy_request->subscribe_id = hidl_request.subscribeId;
- legacy_request->ttl = hidl_request.ttl;
- legacy_request->period = hidl_request.period;
- legacy_request->subscribe_type =
- convertHidlNanSubscribeTypeToLegacy(hidl_request.subscribeType);
- legacy_request->serviceResponseFilter =
- convertHidlNanSrfTypeToLegacy(hidl_request.serviceResponseFilter);
- legacy_request->serviceResponseInclude =
- convertHidlNanSrfIncludeTypeToLegacy(hidl_request.serviceResponseInclude);
- legacy_request->useServiceResponseFilter =
- hidl_request.shouldUseServiceResponseFilter
- ? legacy_hal::NAN_USE_SRF
- : legacy_hal::NAN_DO_NOT_USE_SRF;
- legacy_request->ssiRequiredForMatchIndication =
- hidl_request.isSsiRequiredForMatchIndication
- ? legacy_hal::NAN_SSI_REQUIRED_IN_MATCH_IND
- : legacy_hal::NAN_SSI_NOT_REQUIRED_IN_MATCH_IND;
+ memset(&legacy_request, 0, sizeof(legacy_hal::NanSubscribeRequest));
+
+ legacy_request->subscribe_id = hidl_request.baseConfigs.sessionId;
+ legacy_request->ttl = hidl_request.baseConfigs.ttlSec;
+ legacy_request->period = hidl_request.baseConfigs.discoveryWindowPeriod;
+ legacy_request->subscribe_count = hidl_request.baseConfigs.discoveryCount;
+ legacy_request->service_name_len = hidl_request.baseConfigs.serviceName.size();
+ if (legacy_request->service_name_len > NAN_MAX_SERVICE_NAME_LEN) {
+ return false;
+ }
+ memcpy(legacy_request->service_name, hidl_request.baseConfigs.serviceName.c_str(),
+ legacy_request->service_name_len);
legacy_request->subscribe_match_indicator =
- convertHidlNanMatchAlgToLegacy(hidl_request.subscribeMatchIndicator);
- legacy_request->subscribe_count = hidl_request.subscribeCount;
- if (hidl_request.serviceName.size() > sizeof(legacy_request->service_name)) {
+ (legacy_hal::NanMatchAlg) hidl_request.baseConfigs.discoveryMatchIndicator;
+ legacy_request->service_specific_info_len = hidl_request.baseConfigs.serviceSpecificInfo.size();
+ if (legacy_request->service_specific_info_len > NAN_MAX_SERVICE_SPECIFIC_INFO_LEN) {
return false;
}
- legacy_request->service_name_len = hidl_request.serviceName.size();
- memcpy(legacy_request->service_name,
- hidl_request.serviceName.c_str(),
- hidl_request.serviceName.size());
- if (hidl_request.serviceSpecificInfo.size() >
- sizeof(legacy_request->service_specific_info)) {
- return false;
- }
- legacy_request->service_specific_info_len =
- hidl_request.serviceSpecificInfo.size();
memcpy(legacy_request->service_specific_info,
- hidl_request.serviceSpecificInfo.data(),
- hidl_request.serviceSpecificInfo.size());
- if (hidl_request.rxMatchFilter.size() >
- sizeof(legacy_request->rx_match_filter)) {
+ hidl_request.baseConfigs.serviceSpecificInfo.data(),
+ legacy_request->service_specific_info_len);
+ legacy_request->rx_match_filter_len = hidl_request.baseConfigs.rxMatchFilter.size();
+ if (legacy_request->rx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) {
return false;
}
- legacy_request->rx_match_filter_len = hidl_request.rxMatchFilter.size();
memcpy(legacy_request->rx_match_filter,
- hidl_request.rxMatchFilter.data(),
- hidl_request.rxMatchFilter.size());
- if (hidl_request.txMatchFilter.size() >
- sizeof(legacy_request->tx_match_filter)) {
+ hidl_request.baseConfigs.rxMatchFilter.data(),
+ legacy_request->rx_match_filter_len);
+ legacy_request->tx_match_filter_len = hidl_request.baseConfigs.txMatchFilter.size();
+ if (legacy_request->tx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) {
return false;
}
- legacy_request->tx_match_filter_len = hidl_request.txMatchFilter.size();
memcpy(legacy_request->tx_match_filter,
- hidl_request.txMatchFilter.data(),
- hidl_request.txMatchFilter.size());
- legacy_request->rssi_threshold_flag = hidl_request.useRssiThreshold;
- legacy_request->connmap = hidl_request.connmap;
- if (hidl_request.intfAddr.size() > NAN_MAX_SUBSCRIBE_MAX_ADDRESS) {
+ hidl_request.baseConfigs.txMatchFilter.data(),
+ legacy_request->tx_match_filter_len);
+ legacy_request->rssi_threshold_flag = hidl_request.baseConfigs.useRssiThreshold;
+ legacy_request->recv_indication_cfg = 0;
+ legacy_request->recv_indication_cfg |=
+ hidl_request.baseConfigs.disableDiscoveryTerminationIndication ? 0x1 : 0x0;
+ legacy_request->recv_indication_cfg |=
+ hidl_request.baseConfigs.disableMatchExpirationIndication ? 0x2 : 0x0;
+ legacy_request->recv_indication_cfg |=
+ hidl_request.baseConfigs.disableFollowupReceivedIndication ? 0x4 : 0x0;
+ legacy_request->cipher_type = hidl_request.baseConfigs.supportedCipherTypes;
+ legacy_request->pmk_len = hidl_request.baseConfigs.pmk.size();
+ if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) {
return false;
}
+ memcpy(legacy_request->pmk,
+ hidl_request.baseConfigs.pmk.data(),
+ legacy_request->pmk_len);
+ legacy_request->sdea_params.security_cfg = hidl_request.baseConfigs.securityEnabledInNdp ?
+ legacy_hal::NAN_DP_CONFIG_SECURITY : legacy_hal::NAN_DP_CONFIG_NO_SECURITY;
+ legacy_request->sdea_params.ranging_state = hidl_request.baseConfigs.rangingRequired ?
+ legacy_hal::NAN_RANGING_ENABLE : legacy_hal::NAN_RANGING_DISABLE;
+ legacy_request->ranging_cfg.ranging_interval_msec = hidl_request.baseConfigs.rangingIntervalMsec;
+ legacy_request->ranging_cfg.config_ranging_indications =
+ hidl_request.baseConfigs.configRangingIndications;
+ legacy_request->ranging_cfg.distance_ingress_cm = hidl_request.baseConfigs.distanceIngressCm;
+ legacy_request->ranging_cfg.distance_egress_cm = hidl_request.baseConfigs.distanceEgressCm;
+ legacy_request->subscribe_type = (legacy_hal::NanSubscribeType) hidl_request.subscribeType;
+ legacy_request->serviceResponseFilter = (legacy_hal::NanSRFType) hidl_request.srfType;
+ legacy_request->serviceResponseInclude = hidl_request.srfRespondIfInAddressSet ?
+ legacy_hal::NAN_SRF_INCLUDE_RESPOND : legacy_hal::NAN_SRF_INCLUDE_DO_NOT_RESPOND;
+ legacy_request->useServiceResponseFilter = hidl_request.shouldUseSrf ?
+ legacy_hal::NAN_USE_SRF : legacy_hal::NAN_DO_NOT_USE_SRF;
+ legacy_request->ssiRequiredForMatchIndication = hidl_request.isSsiRequiredForMatch ?
+ legacy_hal::NAN_SSI_REQUIRED_IN_MATCH_IND : legacy_hal::NAN_SSI_NOT_REQUIRED_IN_MATCH_IND;
legacy_request->num_intf_addr_present = hidl_request.intfAddr.size();
- for (uint32_t i = 0; i < hidl_request.intfAddr.size(); i++) {
- CHECK(hidl_request.intfAddr[i].size() ==
- sizeof(legacy_request->intf_addr[i]));
- memcpy(legacy_request->intf_addr[i],
- hidl_request.intfAddr[i].data(),
- hidl_request.intfAddr[i].size());
+ if (legacy_request->num_intf_addr_present > NAN_MAX_SUBSCRIBE_MAX_ADDRESS) {
+ return false;
}
- legacy_request->recv_indication_cfg = hidl_request.recvIndicationCfg;
+ for (int i = 0; i < legacy_request->num_intf_addr_present; i++) {
+ memcpy(legacy_request->intf_addr[i], hidl_request.intfAddr[i].data(), 6);
+ }
+
return true;
}
-bool convertHidlNanSubscribeCancelRequestToLegacy(
- const NanSubscribeCancelRequest& /* hidl_request */,
- legacy_hal::NanSubscribeCancelRequest* /* legacy_request */) {
- return false;
-}
-
bool convertHidlNanTransmitFollowupRequestToLegacy(
- const NanTransmitFollowupRequest& /* hidl_request */,
- legacy_hal::NanTransmitFollowupRequest* /* legacy_request */) {
- return false;
+ const NanTransmitFollowupRequest& hidl_request,
+ legacy_hal::NanTransmitFollowupRequest* legacy_request) {
+ if (!legacy_request) {
+ return false;
+ }
+ memset(&legacy_request, 0, sizeof(legacy_hal::NanTransmitFollowupRequest));
+
+ legacy_request->publish_subscribe_id = hidl_request.discoverySessionId;
+ legacy_request->requestor_instance_id = hidl_request.peerId;
+ memcpy(legacy_request->addr, hidl_request.addr.data(), 6);
+ legacy_request->priority = hidl_request.isHighPriority ?
+ legacy_hal::NAN_TX_PRIORITY_HIGH : legacy_hal::NAN_TX_PRIORITY_NORMAL;
+ legacy_request->dw_or_faw = hidl_request.shouldUseDiscoveryWindow ?
+ legacy_hal::NAN_TRANSMIT_IN_DW : legacy_hal::NAN_TRANSMIT_IN_FAW;
+ legacy_request->service_specific_info_len = hidl_request.message.size();
+ if (legacy_request->service_specific_info_len > NAN_MAX_SERVICE_SPECIFIC_INFO_LEN) {
+ return false;
+ }
+ memcpy(legacy_request->service_specific_info,
+ hidl_request.message.data(),
+ legacy_request->service_specific_info_len);
+ legacy_request->recv_indication_cfg = hidl_request.disableFollowupResultIndication ? 0x1 : 0x0;
+
+ return true;
}
bool convertHidlNanConfigRequestToLegacy(
- const NanConfigRequest& /* hidl_request */,
- legacy_hal::NanConfigRequest* /* legacy_request */) {
- return false;
+ const NanConfigRequest& hidl_request,
+ legacy_hal::NanConfigRequest* legacy_request) {
+ if (!legacy_request) {
+ return false;
+ }
+ memset(&legacy_request, 0, sizeof(legacy_hal::NanConfigRequest));
+
+ // TODO: b/34059183 tracks missing configurations in legacy HAL or uknown defaults
+ legacy_request->master_pref = hidl_request.masterPref;
+ legacy_request->discovery_indication_cfg = 0;
+ legacy_request->discovery_indication_cfg |=
+ hidl_request.disableDiscoveryAddressChangeIndication ? 0x1 : 0x0;
+ legacy_request->discovery_indication_cfg |=
+ hidl_request.disableStartedClusterIndication ? 0x2 : 0x0;
+ legacy_request->discovery_indication_cfg |=
+ hidl_request.disableJoinedClusterIndication ? 0x4 : 0x0;
+ legacy_request->config_sid_beacon = 1;
+ if (hidl_request.numberOfServiceIdsInBeacon > 127) {
+ return false;
+ }
+ legacy_request->sid_beacon = (hidl_request.includeServiceIdsInBeacon ? 0x1 : 0x0)
+ | (hidl_request.numberOfServiceIdsInBeacon << 1);
+ legacy_request->config_rssi_window_size = 0; // TODO: don't know default yet
+ legacy_request->rssi_window_size_val = hidl_request.rssiWindowSize;
+ legacy_request->config_disc_mac_addr_randomization = 1;
+ legacy_request->disc_mac_addr_rand_interval_sec =
+ hidl_request.macAddressRandomizationIntervalSec;
+ legacy_request->config_responder_auto_response = 1;
+ legacy_request->ranging_auto_response_cfg = hidl_request.acceptRangingRequests ?
+ legacy_hal::NAN_RANGING_AUTO_RESPONSE_ENABLE : legacy_hal::NAN_RANGING_AUTO_RESPONSE_DISABLE;
+ /* TODO : missing
+ legacy_request->config_2dot4g_rssi_close = 0; // TODO: don't know default yet
+ legacy_request->rssi_close_2dot4g_val =
+ hidl_request.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiClose;
+ legacy_request->config_2dot4g_rssi_middle = 0; // TODO: don't know default yet
+ legacy_request->rssi_middle_2dot4g_val =
+ hidl_request.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiMiddle;
+ legacy_request->config_2dot4g_rssi_proximity = 0; // TODO: don't know default yet
+ legacy_request->rssi_proximity_2dot4g_val =
+ hidl_request.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiProximity;
+ */
+ legacy_request->config_scan_params = 0; // TODO: don't know default yet
+ legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_24G_BAND] =
+ hidl_request.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_24GHZ].dwellTimeMs;
+ legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_24G_BAND] =
+ hidl_request.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_24GHZ].scanPeriodSec;
+ legacy_request->config_dw.config_2dot4g_dw_band = hidl_request
+ .bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_24GHZ].validDiscoveryWindowIntervalVal;
+ legacy_request->config_dw.dw_2dot4g_interval_val = hidl_request
+ .bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_24GHZ].discoveryWindowIntervalVal;
+ /* TODO: missing
+ legacy_request->config_5g_rssi_close = 0; // TODO: don't know default yet
+ legacy_request->rssi_close_5g_val =
+ hidl_request.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiClose;
+ legacy_request->config_5g_rssi_middle = 0; // TODO: don't know default yet
+ legacy_request->rssi_middle_5g_val =
+ hidl_request.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiMiddle;
+ */
+ legacy_request->config_5g_rssi_close_proximity = 0; // TODO: don't know default yet
+ legacy_request->rssi_close_proximity_5g_val =
+ hidl_request.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiProximity;
+ legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] =
+ hidl_request.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_5GHZ].dwellTimeMs;
+ legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] =
+ hidl_request.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_5GHZ].scanPeriodSec;
+ legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_HIGH] =
+ hidl_request.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_5GHZ].dwellTimeMs;
+ legacy_request->scan_params_val.scan_period[legacy_hal::NAN_CHANNEL_5G_BAND_HIGH] =
+ hidl_request.bandSpecificConfig[
+ (size_t) NanBandIndex::NAN_BAND_5GHZ].scanPeriodSec;
+ legacy_request->config_dw.config_5g_dw_band = hidl_request
+ .bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_5GHZ].validDiscoveryWindowIntervalVal;
+ legacy_request->config_dw.dw_5g_interval_val = hidl_request
+ .bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_5GHZ].discoveryWindowIntervalVal;
+
+ return true;
}
bool convertHidlNanBeaconSdfPayloadRequestToLegacy(
- const NanBeaconSdfPayloadRequest& /* hidl_request */,
- legacy_hal::NanBeaconSdfPayloadRequest* /* legacy_request */) {
- return false;
+ const NanBeaconSdfPayloadRequest& hidl_request,
+ legacy_hal::NanBeaconSdfPayloadRequest* legacy_request) {
+ if (!legacy_request) {
+ return false;
+ }
+ memset(&legacy_request, 0, sizeof(legacy_hal::NanBeaconSdfPayloadRequest));
+
+ legacy_request->vsa.payload_transmit_flag = hidl_request.transmitInNext16dws ? 1 : 0;
+ legacy_request->vsa.tx_in_discovery_beacon = hidl_request.transmitInDiscoveryBeacon;
+ legacy_request->vsa.tx_in_sync_beacon = hidl_request.transmitInSyncBeacon;
+ legacy_request->vsa.tx_in_service_discovery = hidl_request.transmitInServiceDiscoveryFrame;
+ legacy_request->vsa.vendor_oui = hidl_request.vendorOui;
+ legacy_request->vsa.vsa_len = hidl_request.vsa.size();
+ if (legacy_request->vsa.vsa_len > NAN_MAX_VSA_DATA_LEN) {
+ return false;
+ }
+ memcpy(legacy_request->vsa.vsa, hidl_request.vsa.data(), legacy_request->vsa.vsa_len);
+
+ return true;
}
bool convertHidlNanDataPathInitiatorRequestToLegacy(
- const NanDataPathInitiatorRequest& /* hidl_request */,
- legacy_hal::NanDataPathInitiatorRequest* /* legacy_request */) {
- return false;
+ const NanInitiateDataPathRequest& hidl_request,
+ legacy_hal::NanDataPathInitiatorRequest* legacy_request) {
+ if (!legacy_request) {
+ return false;
+ }
+ memset(&legacy_request, 0, sizeof(legacy_hal::NanDataPathInitiatorRequest));
+
+ legacy_request->requestor_instance_id = hidl_request.peerId;
+ memcpy(legacy_request->peer_disc_mac_addr, hidl_request.peerDiscMacAddr.data(), 6);
+ legacy_request->channel_request_type =
+ (legacy_hal::NanDataPathChannelCfg) hidl_request.channelRequestType;
+ legacy_request->channel = hidl_request.channel;
+ strcpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str());
+ legacy_request->ndp_cfg.security_cfg = hidl_request.securityRequired ?
+ legacy_hal::NAN_DP_CONFIG_SECURITY : legacy_hal::NAN_DP_CONFIG_NO_SECURITY;
+ legacy_request->app_info.ndp_app_info_len = hidl_request.appInfo.size();
+ if (legacy_request->app_info.ndp_app_info_len > NAN_DP_MAX_APP_INFO_LEN) {
+ return false;
+ }
+ memcpy(legacy_request->app_info.ndp_app_info, hidl_request.appInfo.data(),
+ legacy_request->app_info.ndp_app_info_len);
+ legacy_request->cipher_type = hidl_request.supportedCipherTypes;
+ legacy_request->pmk_len = hidl_request.pmk.size();
+ if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) {
+ return false;
+ }
+ memcpy(legacy_request->pmk, hidl_request.pmk.data(), legacy_request->pmk_len);
+
+ return true;
}
bool convertHidlNanDataPathIndicationResponseToLegacy(
- const NanDataPathIndicationResponse& /* hidl_response */,
- legacy_hal::NanDataPathIndicationResponse* /* legacy_response */) {
- return false;
-}
+ const NanRespondToDataPathIndicationRequest& hidl_request,
+ legacy_hal::NanDataPathIndicationResponse* legacy_request) {
+ if (!legacy_request) {
+ return false;
+ }
+ memset(&legacy_request, 0, sizeof(legacy_hal::NanDataPathIndicationResponse));
-bool convertHidlNanDataPathEndRequestToLegacy(
- const NanDataPathEndRequest& /* hidl_request */,
- legacy_hal::NanDataPathEndRequest* /* legacy_request */) {
- return false;
+ legacy_request->rsp_code = hidl_request.acceptRequest ?
+ legacy_hal::NAN_DP_REQUEST_ACCEPT : legacy_hal::NAN_DP_REQUEST_REJECT;
+ legacy_request->ndp_instance_id = hidl_request.ndpInstanceId;
+ strcpy(legacy_request->ndp_iface, hidl_request.ifaceName.c_str());
+ legacy_request->ndp_cfg.security_cfg = hidl_request.securityRequired ?
+ legacy_hal::NAN_DP_CONFIG_SECURITY : legacy_hal::NAN_DP_CONFIG_NO_SECURITY;
+ legacy_request->app_info.ndp_app_info_len = hidl_request.appInfo.size();
+ if (legacy_request->app_info.ndp_app_info_len > NAN_DP_MAX_APP_INFO_LEN) {
+ return false;
+ }
+ memcpy(legacy_request->app_info.ndp_app_info, hidl_request.appInfo.data(),
+ legacy_request->app_info.ndp_app_info_len);
+ legacy_request->cipher_type = hidl_request.supportedCipherTypes;
+ legacy_request->pmk_len = hidl_request.pmk.size();
+ if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) {
+ return false;
+ }
+ memcpy(legacy_request->pmk, hidl_request.pmk.data(), legacy_request->pmk_len);
+
+ return true;
}
bool convertLegacyNanResponseHeaderToHidl(
const legacy_hal::NanResponseMsg& legacy_response,
- NanResponseMsgHeader* hidl_response) {
- if (!hidl_response) {
+ WifiNanStatus* wifiNanStatus) {
+ if (!wifiNanStatus) {
return false;
}
- hidl_response->status =
- convertLegacyNanStatusTypeToHidl(legacy_response.status);
- hidl_response->value = legacy_response.value;
- hidl_response->responseType =
- convertLegacyNanResponseTypeToHidl(legacy_response.response_type);
+ wifiNanStatus->status = convertLegacyNanStatusTypeToHidl(legacy_response.status);
+ wifiNanStatus->description = legacy_response.nan_error;
+
return true;
}
-bool convertLegacyNanPublishResponseToHidl(
- const legacy_hal::NanPublishResponse& /* legacy_response */,
- NanPublishResponse* /* hidl_response */) {
- return false;
-}
-
-bool convertLegacyNanSubscribeResponseToHidl(
- const legacy_hal::NanSubscribeResponse& /* legacy_response */,
- NanSubscribeResponse* /* hidl_response */) {
- return false;
-}
-
-bool convertLegacyNanDataPathResponseToHidl(
- const legacy_hal::NanDataPathRequestResponse& /* legacy_response */,
- NanDataPathResponse* /* hidl_response */) {
- return false;
-}
-
bool convertLegacyNanCapabilitiesResponseToHidl(
- const legacy_hal::NanCapabilities& /* legacy_response */,
- NanCapabilitiesResponse* /* hidl_response */) {
- return false;
-}
+ const legacy_hal::NanCapabilities& legacy_response,
+ NanCapabilities* hidl_response) {
+ if (!hidl_response) {
+ return false;
+ }
+ hidl_response->maxConcurrentClusters = legacy_response.max_concurrent_nan_clusters;
+ hidl_response->maxPublishes = legacy_response.max_publishes;
+ hidl_response->maxSubscribes = legacy_response.max_subscribes;
+ hidl_response->maxServiceNameLen = legacy_response.max_service_name_len;
+ hidl_response->maxMatchFilterLen = legacy_response.max_match_filter_len;
+ hidl_response->maxTotalMatchFilterLen = legacy_response.max_total_match_filter_len;
+ hidl_response->maxServiceSpecificInfoLen = legacy_response.max_service_specific_info_len;
+ hidl_response->maxVsaDataLen = legacy_response.max_vsa_data_len;
+ hidl_response->maxNdiInterfaces = legacy_response.max_ndi_interfaces;
+ hidl_response->maxNdpSessions = legacy_response.max_ndp_sessions;
+ hidl_response->maxAppInfoLen = legacy_response.max_app_info_len;
+ hidl_response->maxQueuedTransmitFollowupMsgs = legacy_response.max_queued_transmit_followup_msgs;
+ // TODO: b/34059183 to add to underlying HAL
+ hidl_response->maxSubscribeInterfaceAddresses = NAN_MAX_SUBSCRIBE_MAX_ADDRESS;
+ hidl_response->supportedCipherSuites = legacy_response.cipher_suites_supported;
-bool convertLegacyNanPublishTerminatedIndToHidl(
- const legacy_hal::NanPublishTerminatedInd& /* legacy_ind */,
- NanPublishTerminatedInd* /* hidl_ind */) {
- return false;
+ return true;
}
bool convertLegacyNanMatchIndToHidl(
- const legacy_hal::NanMatchInd& /* legacy_ind */,
- NanMatchInd* /* hidl_ind */) {
- return false;
-}
+ const legacy_hal::NanMatchInd& legacy_ind,
+ NanMatchInd* hidl_ind) {
+ if (!hidl_ind) {
+ return false;
+ }
+ hidl_ind->discoverySessionId = legacy_ind.publish_subscribe_id;
+ hidl_ind->peerId = legacy_ind.requestor_instance_id;
+ hidl_ind->addr = hidl_array<uint8_t, 6>(legacy_ind.addr);
+ hidl_ind->serviceSpecificInfo = std::vector<uint8_t>(legacy_ind.service_specific_info,
+ legacy_ind.service_specific_info + legacy_ind.service_specific_info_len);
+ hidl_ind->matchFilter = std::vector<uint8_t>(legacy_ind.sdf_match_filter,
+ legacy_ind.sdf_match_filter + legacy_ind.sdf_match_filter_len);
+ hidl_ind->matchOccuredInBeaconFlag = legacy_ind.match_occured_flag == 1;
+ hidl_ind->outOfResourceFlag = legacy_ind.out_of_resource_flag == 1;
+ hidl_ind->rssiValue = legacy_ind.rssi_value;
+ hidl_ind->peerSupportedCipherTypes = legacy_ind.peer_cipher_type;
+ hidl_ind->peerRequiresSecurityEnabledInNdp =
+ legacy_ind.peer_sdea_params.security_cfg == legacy_hal::NAN_DP_CONFIG_SECURITY;
+ hidl_ind->peerRequiresRanging =
+ legacy_ind.peer_sdea_params.ranging_state == legacy_hal::NAN_RANGING_ENABLE;
+ hidl_ind->rangingMeasurementInCm = legacy_ind.range_result.range_measurement_cm;
+ hidl_ind->rangingIndicationType = legacy_ind.range_result.ranging_event_type;
-bool convertLegacyNanMatchExpiredIndToHidl(
- const legacy_hal::NanMatchExpiredInd& /* legacy_ind */,
- NanMatchExpiredInd* /* hidl_ind */) {
- return false;
-}
-
-bool convertLegacyNanSubscribeTerminatedIndToHidl(
- const legacy_hal::NanSubscribeTerminatedInd& /* legacy_ind */,
- NanSubscribeTerminatedInd* /* hidl_ind */) {
- return false;
+ return true;
}
bool convertLegacyNanFollowupIndToHidl(
- const legacy_hal::NanFollowupInd& /* legacy_ind */,
- NanFollowupInd* /* hidl_ind */) {
- return false;
-}
+ const legacy_hal::NanFollowupInd& legacy_ind,
+ NanFollowupReceivedInd* hidl_ind) {
+ if (!hidl_ind) {
+ return false;
+ }
+ hidl_ind->discoverySessionId = legacy_ind.publish_subscribe_id;
+ hidl_ind->peerId = legacy_ind.requestor_instance_id;
+ hidl_ind->addr = hidl_array<uint8_t, 6>(legacy_ind.addr);
+ hidl_ind->receivedInFaw = legacy_ind.dw_or_faw == 1;
+ hidl_ind->message = std::vector<uint8_t>(legacy_ind.service_specific_info,
+ legacy_ind.service_specific_info + legacy_ind.service_specific_info_len);
-bool convertLegacyNanDiscEngEventIndToHidl(
- const legacy_hal::NanDiscEngEventInd& /* legacy_ind */,
- NanDiscEngEventInd* /* hidl_ind */) {
- return false;
-}
-
-bool convertLegacyNanDisabledIndToHidl(
- const legacy_hal::NanDisabledInd& /* legacy_ind */,
- NanDisabledInd* /* hidl_ind */) {
- return false;
+ return true;
}
bool convertLegacyNanBeaconSdfPayloadIndToHidl(
- const legacy_hal::NanBeaconSdfPayloadInd& /* legacy_ind */,
- NanBeaconSdfPayloadInd* /* hidl_ind */) {
- return false;
+ const legacy_hal::NanBeaconSdfPayloadInd& legacy_ind,
+ NanBeaconSdfPayloadInd* hidl_ind) {
+ if (!hidl_ind) {
+ return false;
+ }
+ hidl_ind->addr = hidl_array<uint8_t, 6>(legacy_ind.addr);
+ hidl_ind->isVsaReceived = legacy_ind.is_vsa_received == 1;
+ hidl_ind->vsaReceivedOnFrames = legacy_ind.vsa.vsa_received_on;
+ hidl_ind->vsaVendorOui = legacy_ind.vsa.vendor_oui;
+ hidl_ind->vsa = std::vector<uint8_t>(legacy_ind.vsa.vsa,
+ legacy_ind.vsa.vsa + legacy_ind.vsa.attr_len);
+ hidl_ind->isBeaconSdfPayloadReceived = legacy_ind.is_beacon_sdf_payload_received == 1;
+ hidl_ind->beaconSdfPayloadData = std::vector<uint8_t>(legacy_ind.data.frame_data,
+ legacy_ind.data.frame_data + legacy_ind.data.frame_len);
+
+ return true;
}
bool convertLegacyNanDataPathRequestIndToHidl(
- const legacy_hal::NanDataPathRequestInd& /* legacy_ind */,
- NanDataPathRequestInd* /* hidl_ind */) {
- return false;
+ const legacy_hal::NanDataPathRequestInd& legacy_ind,
+ NanDataPathRequestInd* hidl_ind) {
+ if (!hidl_ind) {
+ return false;
+ }
+ hidl_ind->discoverySessionId = legacy_ind.service_instance_id;
+ hidl_ind->peerDiscMacAddr = hidl_array<uint8_t, 6>(legacy_ind.peer_disc_mac_addr);
+ hidl_ind->ndpInstanceId = legacy_ind.ndp_instance_id;
+ hidl_ind->securityRequired =
+ legacy_ind.ndp_cfg.security_cfg == legacy_hal::NAN_DP_CONFIG_SECURITY;
+ hidl_ind->appInfo = std::vector<uint8_t>(legacy_ind.app_info.ndp_app_info,
+ legacy_ind.app_info.ndp_app_info + legacy_ind.app_info.ndp_app_info_len);
+
+ return true;
}
bool convertLegacyNanDataPathConfirmIndToHidl(
- const legacy_hal::NanDataPathConfirmInd& /* legacy_ind */,
- NanDataPathConfirmInd* /* hidl_ind */) {
- return false;
-}
+ const legacy_hal::NanDataPathConfirmInd& legacy_ind,
+ NanDataPathConfirmInd* hidl_ind) {
+ if (!hidl_ind) {
+ return false;
+ }
+ hidl_ind->ndpInstanceId = legacy_ind.ndp_instance_id;
+ hidl_ind->dataPathSetupSuccess = legacy_ind.rsp_code == legacy_hal::NAN_DP_REQUEST_ACCEPT;
+ hidl_ind->peerNdiMacAddr = hidl_array<uint8_t, 6>(legacy_ind.peer_ndi_mac_addr);
+ hidl_ind->appInfo = std::vector<uint8_t>(legacy_ind.app_info.ndp_app_info,
+ legacy_ind.app_info.ndp_app_info + legacy_ind.app_info.ndp_app_info_len);
+ hidl_ind->status.status = convertLegacyNanStatusTypeToHidl(legacy_ind.reason_code);
+ hidl_ind->status.description = ""; // TODO: b/34059183
-bool convertLegacyNanDataPathEndIndToHidl(
- const legacy_hal::NanDataPathEndInd& /* legacy_ind */,
- NanDataPathEndInd* /* hidl_ind */) {
- return false;
-}
-
-bool convertLegacyNanTransmitFollowupIndToHidl(
- const legacy_hal::NanTransmitFollowupInd& /* legacy_ind */,
- NanTransmitFollowupInd* /* hidl_ind */) {
- return false;
+ return true;
}
legacy_hal::wifi_rtt_type convertHidlRttTypeToLegacy(RttType type) {
diff --git a/wifi/1.0/default/hidl_struct_util.h b/wifi/1.0/default/hidl_struct_util.h
index 9086666..14bc77d 100644
--- a/wifi/1.0/default/hidl_struct_util.h
+++ b/wifi/1.0/default/hidl_struct_util.h
@@ -94,87 +94,50 @@
std::vector<WifiDebugRxPacketFateReport>* hidl_fates);
// NAN iface conversion methods.
+NanStatusType convertLegacyNanStatusTypeToHidl(legacy_hal::NanStatusType type);
bool convertHidlNanEnableRequestToLegacy(
const NanEnableRequest& hidl_request,
legacy_hal::NanEnableRequest* legacy_request);
-bool convertHidlNanPublishRequestToLegacy(
- const NanPublishRequest& hidl_request,
- legacy_hal::NanPublishRequest* legacy_request);
-bool convertHidlNanPublishCancelRequestToLegacy(
- const NanPublishCancelRequest& hidl_request,
- legacy_hal::NanPublishCancelRequest* legacy_request);
-bool convertHidlNanSubscribeRequestToLegacy(
- const NanSubscribeRequest& hidl_request,
- legacy_hal::NanSubscribeRequest* legacy_request);
-bool convertHidlNanSubscribeCancelRequestToLegacy(
- const NanSubscribeCancelRequest& hidl_request,
- legacy_hal::NanSubscribeCancelRequest* legacy_request);
-bool convertHidlNanTransmitFollowupRequestToLegacy(
- const NanTransmitFollowupRequest& hidl_request,
- legacy_hal::NanTransmitFollowupRequest* legacy_request);
bool convertHidlNanConfigRequestToLegacy(
const NanConfigRequest& hidl_request,
legacy_hal::NanConfigRequest* legacy_request);
+bool convertHidlNanPublishRequestToLegacy(
+ const NanPublishRequest& hidl_request,
+ legacy_hal::NanPublishRequest* legacy_request);
+bool convertHidlNanSubscribeRequestToLegacy(
+ const NanSubscribeRequest& hidl_request,
+ legacy_hal::NanSubscribeRequest* legacy_request);
+bool convertHidlNanTransmitFollowupRequestToLegacy(
+ const NanTransmitFollowupRequest& hidl_request,
+ legacy_hal::NanTransmitFollowupRequest* legacy_request);
bool convertHidlNanBeaconSdfPayloadRequestToLegacy(
const NanBeaconSdfPayloadRequest& hidl_request,
legacy_hal::NanBeaconSdfPayloadRequest* legacy_request);
bool convertHidlNanDataPathInitiatorRequestToLegacy(
- const NanDataPathInitiatorRequest& hidl_request,
+ const NanInitiateDataPathRequest& hidl_request,
legacy_hal::NanDataPathInitiatorRequest* legacy_request);
bool convertHidlNanDataPathIndicationResponseToLegacy(
- const NanDataPathIndicationResponse& hidl_response,
+ const NanRespondToDataPathIndicationRequest& hidl_response,
legacy_hal::NanDataPathIndicationResponse* legacy_response);
-bool convertHidlNanDataPathEndRequestToLegacy(
- const NanDataPathEndRequest& hidl_request,
- legacy_hal::NanDataPathEndRequest* legacy_request);
bool convertLegacyNanResponseHeaderToHidl(
const legacy_hal::NanResponseMsg& legacy_response,
- NanResponseMsgHeader* hidl_response);
-bool convertLegacyNanPublishResponseToHidl(
- const legacy_hal::NanPublishResponse& legacy_response,
- NanPublishResponse* hidl_response);
-bool convertLegacyNanSubscribeResponseToHidl(
- const legacy_hal::NanSubscribeResponse& legacy_response,
- NanSubscribeResponse* hidl_response);
-bool convertLegacyNanDataPathResponseToHidl(
- const legacy_hal::NanDataPathRequestResponse& legacy_response,
- NanDataPathResponse* hidl_response);
+ WifiNanStatus* wifiNanStatus);
bool convertLegacyNanCapabilitiesResponseToHidl(
const legacy_hal::NanCapabilities& legacy_response,
- NanCapabilitiesResponse* hidl_response);
-bool convertLegacyNanPublishTerminatedIndToHidl(
- const legacy_hal::NanPublishTerminatedInd& legacy_ind,
- NanPublishTerminatedInd* hidl_ind);
+ NanCapabilities* hidl_response);
bool convertLegacyNanMatchIndToHidl(const legacy_hal::NanMatchInd& legacy_ind,
NanMatchInd* hidl_ind);
-bool convertLegacyNanMatchExpiredIndToHidl(
- const legacy_hal::NanMatchExpiredInd& legacy_ind,
- NanMatchExpiredInd* hidl_ind);
-bool convertLegacyNanSubscribeTerminatedIndToHidl(
- const legacy_hal::NanSubscribeTerminatedInd& legacy_ind,
- NanSubscribeTerminatedInd* hidl_ind);
bool convertLegacyNanFollowupIndToHidl(
- const legacy_hal::NanFollowupInd& legacy_ind, NanFollowupInd* hidl_ind);
-bool convertLegacyNanDiscEngEventIndToHidl(
- const legacy_hal::NanDiscEngEventInd& legacy_ind,
- NanDiscEngEventInd* hidl_ind);
-bool convertLegacyNanDisabledIndToHidl(
- const legacy_hal::NanDisabledInd& legacy_ind, NanDisabledInd* hidl_ind);
-bool convertLegacyNanBeaconSdfPayloadIndToHidl(
- const legacy_hal::NanBeaconSdfPayloadInd& legacy_ind,
- NanBeaconSdfPayloadInd* hidl_ind);
+ const legacy_hal::NanFollowupInd& legacy_ind, NanFollowupReceivedInd* hidl_ind);
bool convertLegacyNanDataPathRequestIndToHidl(
const legacy_hal::NanDataPathRequestInd& legacy_ind,
NanDataPathRequestInd* hidl_ind);
bool convertLegacyNanDataPathConfirmIndToHidl(
const legacy_hal::NanDataPathConfirmInd& legacy_ind,
NanDataPathConfirmInd* hidl_ind);
-bool convertLegacyNanDataPathEndIndToHidl(
- const legacy_hal::NanDataPathEndInd& legacy_ind,
- NanDataPathEndInd* hidl_ind);
-bool convertLegacyNanTransmitFollowupIndToHidl(
- const legacy_hal::NanTransmitFollowupInd& legacy_ind,
- NanTransmitFollowupInd* hidl_ind);
+bool convertLegacyNanBeaconSdfPayloadIndToHidl(
+ const legacy_hal::NanBeaconSdfPayloadInd& legacy_ind,
+ NanBeaconSdfPayloadInd* hidl_ind);
// RTT controller conversion methods.
bool convertHidlVectorOfRttConfigToLegacy(
diff --git a/wifi/1.0/default/wifi_nan_iface.cpp b/wifi/1.0/default/wifi_nan_iface.cpp
index 8d5cbc9..5ac6fa8 100644
--- a/wifi/1.0/default/wifi_nan_iface.cpp
+++ b/wifi/1.0/default/wifi_nan_iface.cpp
@@ -36,35 +36,378 @@
// of the object. Whenever the mode changes legacy HAL will remove
// all of these callbacks.
legacy_hal::NanCallbackHandlers callback_handlers;
+ android::wp<WifiNanIface> weak_ptr_this(this);
// Callback for response.
- callback_handlers.on_notify_response = [&](
+ callback_handlers.on_notify_response = [weak_ptr_this](
legacy_hal::transaction_id id, const legacy_hal::NanResponseMsg& msg) {
- NanResponseMsgHeader hidl_header;
+ const auto shared_ptr_this = weak_ptr_this.promote();
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ WifiNanStatus wifiNanStatus;
if (!hidl_struct_util::convertLegacyNanResponseHeaderToHidl(msg,
- &hidl_header)) {
+ &wifiNanStatus)) {
LOG(ERROR) << "Failed to convert nan response header";
return;
}
- // TODO: This is a union in the legacy HAL. Need to convert to appropriate
- // callback based on type.
- // Assuming |NanPublishResponseMsg| type here.
- NanPublishResponse hidl_body;
- if (!hidl_struct_util::convertLegacyNanPublishResponseToHidl(
- msg.body.publish_response, &hidl_body)) {
- LOG(ERROR) << "Failed to convert nan publish response";
- return;
+
+ switch (msg.response_type) {
+ case legacy_hal::NAN_RESPONSE_ENABLED: {
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->notifyEnableResponse(id, wifiNanStatus).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
}
- NanPublishResponseMsg hidl_msg;
- hidl_msg.header = hidl_header;
- hidl_msg.body = hidl_body;
- for (const auto& callback : event_callbacks_) {
- if (!callback->notifyPublishResponse(id, hidl_msg).isOk()) {
- LOG(ERROR) << "Failed to invoke the callback";
- }
+ case legacy_hal::NAN_RESPONSE_DISABLED: {
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->notifyDisableResponse(id, wifiNanStatus).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ }
+ case legacy_hal::NAN_RESPONSE_PUBLISH: {
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->notifyStartPublishResponse(id, wifiNanStatus,
+ msg.body.publish_response.publish_id).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ }
+ case legacy_hal::NAN_RESPONSE_PUBLISH_CANCEL: {
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->notifyStopPublishResponse(id, wifiNanStatus).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ }
+ case legacy_hal::NAN_RESPONSE_TRANSMIT_FOLLOWUP: {
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->notifyTransmitFollowupResponse(id, wifiNanStatus).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ }
+ case legacy_hal::NAN_RESPONSE_SUBSCRIBE: {
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->notifyStartSubscribeResponse(id, wifiNanStatus,
+ msg.body.subscribe_response.subscribe_id).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ }
+ case legacy_hal::NAN_RESPONSE_SUBSCRIBE_CANCEL: {
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->notifyStopSubscribeResponse(id, wifiNanStatus).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ }
+ case legacy_hal::NAN_RESPONSE_CONFIG: {
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->notifyConfigResponse(id, wifiNanStatus).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ }
+ case legacy_hal::NAN_RESPONSE_BEACON_SDF_PAYLOAD: {
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->notifyBeaconSdfPayloadResponse(id, wifiNanStatus).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ }
+ case legacy_hal::NAN_GET_CAPABILITIES: {
+ NanCapabilities hidl_struct;
+ if (!hidl_struct_util::convertLegacyNanCapabilitiesResponseToHidl(
+ msg.body.nan_capabilities, &hidl_struct)) {
+ LOG(ERROR) << "Failed to convert nan capabilities response";
+ return;
+ }
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->notifyCapabilitiesResponse(id, wifiNanStatus,
+ hidl_struct).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ }
+ case legacy_hal::NAN_DP_INTERFACE_CREATE: {
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->notifyCreateDataInterfaceResponse(id, wifiNanStatus).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ }
+ case legacy_hal::NAN_DP_INTERFACE_DELETE: {
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->notifyDeleteDataInterfaceResponse(id, wifiNanStatus).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ }
+ case legacy_hal::NAN_DP_INITIATOR_RESPONSE: {
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->notifyInitiateDataPathResponse(id, wifiNanStatus).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ }
+ case legacy_hal::NAN_DP_RESPONDER_RESPONSE: {
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->notifyRespondToDataPathIndicationResponse(id, wifiNanStatus,
+ msg.body.data_request_response.ndp_instance_id).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ }
+ case legacy_hal::NAN_DP_END: {
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->notifyTerminateDataPathResponse(id, wifiNanStatus).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ }
+ case legacy_hal::NAN_RESPONSE_TCA:
+ /* fall through */
+ case legacy_hal::NAN_RESPONSE_STATS:
+ /* fall through */
+ case legacy_hal::NAN_RESPONSE_ERROR:
+ /* fall through */
+ default:
+ LOG(ERROR) << "Unknown or unhandled response type: " << msg.response_type;
+ return;
}
};
- // TODO: Register the remaining callbacks.
+
+ callback_handlers.on_event_disc_eng_event = [weak_ptr_this](
+ const legacy_hal::NanDiscEngEventInd& msg) {
+ const auto shared_ptr_this = weak_ptr_this.promote();
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ NanClusterEventInd hidl_struct;
+ // event types defined identically - hence can be cast
+ hidl_struct.eventType = (NanClusterEventType) msg.event_type;
+ hidl_struct.addr = msg.data.mac_addr.addr;
+
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->eventClusterEvent(hidl_struct).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ };
+
+ callback_handlers.on_event_disabled = [weak_ptr_this](
+ const legacy_hal::NanDisabledInd& msg) {
+ const auto shared_ptr_this = weak_ptr_this.promote();
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ WifiNanStatus status;
+ status.status = hidl_struct_util::convertLegacyNanStatusTypeToHidl(msg.reason);
+ status.description = msg.nan_reason;
+
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->eventDisabled(status).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ };
+
+ callback_handlers.on_event_publish_terminated = [weak_ptr_this](
+ const legacy_hal::NanPublishTerminatedInd& msg) {
+ const auto shared_ptr_this = weak_ptr_this.promote();
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ WifiNanStatus status;
+ status.status = hidl_struct_util::convertLegacyNanStatusTypeToHidl(msg.reason);
+ status.description = msg.nan_reason;
+
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->eventPublishTerminated(msg.publish_id, status).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ };
+
+ callback_handlers.on_event_subscribe_terminated = [weak_ptr_this](
+ const legacy_hal::NanSubscribeTerminatedInd& msg) {
+ const auto shared_ptr_this = weak_ptr_this.promote();
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ WifiNanStatus status;
+ status.status = hidl_struct_util::convertLegacyNanStatusTypeToHidl(msg.reason);
+ status.description = msg.nan_reason;
+
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->eventSubscribeTerminated(msg.subscribe_id, status).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ };
+
+ callback_handlers.on_event_match = [weak_ptr_this](
+ const legacy_hal::NanMatchInd& msg) {
+ const auto shared_ptr_this = weak_ptr_this.promote();
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ NanMatchInd hidl_struct;
+ if (!hidl_struct_util::convertLegacyNanMatchIndToHidl(
+ msg, &hidl_struct)) {
+ LOG(ERROR) << "Failed to convert nan capabilities response";
+ return;
+ }
+
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->eventMatch(hidl_struct).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ };
+
+ callback_handlers.on_event_match_expired = [weak_ptr_this](
+ const legacy_hal::NanMatchExpiredInd& msg) {
+ const auto shared_ptr_this = weak_ptr_this.promote();
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->eventMatchExpired(msg.publish_subscribe_id,
+ msg.requestor_instance_id).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ };
+
+ callback_handlers.on_event_followup = [weak_ptr_this](
+ const legacy_hal::NanFollowupInd& msg) {
+ const auto shared_ptr_this = weak_ptr_this.promote();
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ NanFollowupReceivedInd hidl_struct;
+ if (!hidl_struct_util::convertLegacyNanFollowupIndToHidl(
+ msg, &hidl_struct)) {
+ LOG(ERROR) << "Failed to convert nan capabilities response";
+ return;
+ }
+
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->eventFollowupReceived(hidl_struct).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ };
+
+ callback_handlers.on_event_transmit_follow_up = [weak_ptr_this](
+ const legacy_hal::NanTransmitFollowupInd& msg) {
+ const auto shared_ptr_this = weak_ptr_this.promote();
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ WifiNanStatus status;
+ status.status = hidl_struct_util::convertLegacyNanStatusTypeToHidl(msg.reason);
+ status.description = msg.nan_reason;
+
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->eventTransmitFollowup(msg.id, status).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ };
+
+ callback_handlers.on_event_data_path_request = [weak_ptr_this](
+ const legacy_hal::NanDataPathRequestInd& msg) {
+ const auto shared_ptr_this = weak_ptr_this.promote();
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ NanDataPathRequestInd hidl_struct;
+ if (!hidl_struct_util::convertLegacyNanDataPathRequestIndToHidl(
+ msg, &hidl_struct)) {
+ LOG(ERROR) << "Failed to convert nan capabilities response";
+ return;
+ }
+
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->eventDataPathRequest(hidl_struct).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ };
+
+ callback_handlers.on_event_data_path_confirm = [weak_ptr_this](
+ const legacy_hal::NanDataPathConfirmInd& msg) {
+ const auto shared_ptr_this = weak_ptr_this.promote();
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ NanDataPathConfirmInd hidl_struct;
+ if (!hidl_struct_util::convertLegacyNanDataPathConfirmIndToHidl(
+ msg, &hidl_struct)) {
+ LOG(ERROR) << "Failed to convert nan capabilities response";
+ return;
+ }
+
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->eventDataPathConfirm(hidl_struct).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ };
+
+ callback_handlers.on_event_data_path_end = [weak_ptr_this](
+ const legacy_hal::NanDataPathEndInd& msg) {
+ const auto shared_ptr_this = weak_ptr_this.promote();
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ for (int i = 0; i < msg.num_ndp_instances; ++i) {
+ if (!callback->eventDataPathTerminated(msg.ndp_instance_id[i]).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ }
+ };
+
+ callback_handlers.on_event_beacon_sdf_payload = [weak_ptr_this](
+ const legacy_hal::NanBeaconSdfPayloadInd& msg) {
+ const auto shared_ptr_this = weak_ptr_this.promote();
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ NanBeaconSdfPayloadInd hidl_struct;
+ if (!hidl_struct_util::convertLegacyNanBeaconSdfPayloadIndToHidl(
+ msg, &hidl_struct)) {
+ LOG(ERROR) << "Failed to convert nan capabilities response";
+ return;
+ }
+
+ for (const auto& callback : shared_ptr_this->event_callbacks_) {
+ if (!callback->eventBeaconSdfPayload(hidl_struct).isOk()) {
+ LOG(ERROR) << "Failed to invoke the callback";
+ }
+ }
+ };
+
legacy_hal::wifi_error legacy_status =
legacy_hal_.lock()->nanRegisterCallbackHandlers(callback_handlers);
if (legacy_status != legacy_hal::WIFI_SUCCESS) {
@@ -90,6 +433,13 @@
hidl_status_cb);
}
+Return<void> WifiNanIface::getType(getType_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiNanIface::getTypeInternal,
+ hidl_status_cb);
+}
+
Return<void> WifiNanIface::registerEventCallback(
const sp<IWifiNanIfaceEventCallback>& callback,
registerEventCallback_cb hidl_status_cb) {
@@ -100,7 +450,16 @@
callback);
}
-Return<void> WifiNanIface::enableRequest(uint32_t cmd_id,
+Return<void> WifiNanIface::getCapabilitiesRequest(uint16_t cmd_id,
+ getCapabilitiesRequest_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiNanIface::getCapabilitiesRequestInternal,
+ hidl_status_cb,
+ cmd_id);
+}
+
+Return<void> WifiNanIface::enableRequest(uint16_t cmd_id,
const NanEnableRequest& msg,
enableRequest_cb hidl_status_cb) {
return validateAndCall(this,
@@ -111,75 +470,7 @@
msg);
}
-Return<void> WifiNanIface::disableRequest(uint32_t cmd_id,
- disableRequest_cb hidl_status_cb) {
- return validateAndCall(this,
- WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
- &WifiNanIface::disableRequestInternal,
- hidl_status_cb,
- cmd_id);
-}
-
-Return<void> WifiNanIface::publishRequest(uint32_t cmd_id,
- const NanPublishRequest& msg,
- publishRequest_cb hidl_status_cb) {
- return validateAndCall(this,
- WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
- &WifiNanIface::publishRequestInternal,
- hidl_status_cb,
- cmd_id,
- msg);
-}
-
-Return<void> WifiNanIface::publishCancelRequest(
- uint32_t cmd_id,
- const NanPublishCancelRequest& msg,
- publishCancelRequest_cb hidl_status_cb) {
- return validateAndCall(this,
- WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
- &WifiNanIface::publishCancelRequestInternal,
- hidl_status_cb,
- cmd_id,
- msg);
-}
-
-Return<void> WifiNanIface::subscribeRequest(
- uint32_t cmd_id,
- const NanSubscribeRequest& msg,
- subscribeRequest_cb hidl_status_cb) {
- return validateAndCall(this,
- WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
- &WifiNanIface::subscribeRequestInternal,
- hidl_status_cb,
- cmd_id,
- msg);
-}
-
-Return<void> WifiNanIface::subscribeCancelRequest(
- uint32_t cmd_id,
- const NanSubscribeCancelRequest& msg,
- subscribeCancelRequest_cb hidl_status_cb) {
- return validateAndCall(this,
- WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
- &WifiNanIface::subscribeCancelRequestInternal,
- hidl_status_cb,
- cmd_id,
- msg);
-}
-
-Return<void> WifiNanIface::transmitFollowupRequest(
- uint32_t cmd_id,
- const NanTransmitFollowupRequest& msg,
- transmitFollowupRequest_cb hidl_status_cb) {
- return validateAndCall(this,
- WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
- &WifiNanIface::transmitFollowupRequestInternal,
- hidl_status_cb,
- cmd_id,
- msg);
-}
-
-Return<void> WifiNanIface::configRequest(uint32_t cmd_id,
+Return<void> WifiNanIface::configRequest(uint16_t cmd_id,
const NanConfigRequest& msg,
configRequest_cb hidl_status_cb) {
return validateAndCall(this,
@@ -190,8 +481,134 @@
msg);
}
+Return<void> WifiNanIface::disableRequest(uint16_t cmd_id,
+ disableRequest_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiNanIface::disableRequestInternal,
+ hidl_status_cb,
+ cmd_id);
+}
+
+Return<void> WifiNanIface::startPublishRequest(uint16_t cmd_id,
+ const NanPublishRequest& msg,
+ startPublishRequest_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiNanIface::startPublishRequestInternal,
+ hidl_status_cb,
+ cmd_id,
+ msg);
+}
+
+Return<void> WifiNanIface::stopPublishRequest(
+ uint16_t cmd_id,
+ uint16_t sessionId,
+ stopPublishRequest_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiNanIface::stopPublishRequestInternal,
+ hidl_status_cb,
+ cmd_id,
+ sessionId);
+}
+
+Return<void> WifiNanIface::startSubscribeRequest(
+ uint16_t cmd_id,
+ const NanSubscribeRequest& msg,
+ startSubscribeRequest_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiNanIface::startSubscribeRequestInternal,
+ hidl_status_cb,
+ cmd_id,
+ msg);
+}
+
+Return<void> WifiNanIface::stopSubscribeRequest(
+ uint16_t cmd_id,
+ uint16_t sessionId,
+ stopSubscribeRequest_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiNanIface::stopSubscribeRequestInternal,
+ hidl_status_cb,
+ cmd_id,
+ sessionId);
+}
+
+Return<void> WifiNanIface::transmitFollowupRequest(
+ uint16_t cmd_id,
+ const NanTransmitFollowupRequest& msg,
+ transmitFollowupRequest_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiNanIface::transmitFollowupRequestInternal,
+ hidl_status_cb,
+ cmd_id,
+ msg);
+}
+
+Return<void> WifiNanIface::createDataInterfaceRequest(
+ uint16_t cmd_id,
+ const hidl_string& iface_name,
+ createDataInterfaceRequest_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiNanIface::createDataInterfaceRequestInternal,
+ hidl_status_cb,
+ cmd_id,
+ iface_name);
+}
+
+Return<void> WifiNanIface::deleteDataInterfaceRequest(
+ uint16_t cmd_id,
+ const hidl_string& iface_name,
+ deleteDataInterfaceRequest_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiNanIface::deleteDataInterfaceRequestInternal,
+ hidl_status_cb,
+ cmd_id,
+ iface_name);
+}
+
+Return<void> WifiNanIface::initiateDataPathRequest(
+ uint16_t cmd_id,
+ const NanInitiateDataPathRequest& msg,
+ initiateDataPathRequest_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiNanIface::initiateDataPathRequestInternal,
+ hidl_status_cb,
+ cmd_id,
+ msg);
+}
+
+Return<void> WifiNanIface::respondToDataPathIndicationRequest(
+ uint16_t cmd_id,
+ const NanRespondToDataPathIndicationRequest& msg,
+ respondToDataPathIndicationRequest_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiNanIface::respondToDataPathIndicationRequestInternal,
+ hidl_status_cb,
+ cmd_id,
+ msg);
+}
+
+Return<void> WifiNanIface::terminateDataPathRequest(uint16_t cmd_id, uint32_t ndpInstanceId,
+ terminateDataPathRequest_cb hidl_status_cb) {
+ return validateAndCall(this,
+ WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiNanIface::terminateDataPathRequestInternal,
+ hidl_status_cb,
+ cmd_id,
+ ndpInstanceId);
+}
+
Return<void> WifiNanIface::beaconSdfPayloadRequest(
- uint32_t cmd_id,
+ uint16_t cmd_id,
const NanBeaconSdfPayloadRequest& msg,
beaconSdfPayloadRequest_cb hidl_status_cb) {
return validateAndCall(this,
@@ -202,88 +619,6 @@
msg);
}
-Return<void> WifiNanIface::getVersion(getVersion_cb hidl_status_cb) {
- return validateAndCall(this,
- WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
- &WifiNanIface::getVersionInternal,
- hidl_status_cb);
-}
-
-Return<void> WifiNanIface::getCapabilities(uint32_t cmd_id,
- getCapabilities_cb hidl_status_cb) {
- return validateAndCall(this,
- WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
- &WifiNanIface::getCapabilitiesInternal,
- hidl_status_cb,
- cmd_id);
-}
-
-Return<void> WifiNanIface::dataInterfaceCreate(
- uint32_t cmd_id,
- const hidl_string& iface_name,
- dataInterfaceCreate_cb hidl_status_cb) {
- return validateAndCall(this,
- WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
- &WifiNanIface::dataInterfaceCreateInternal,
- hidl_status_cb,
- cmd_id,
- iface_name);
-}
-
-Return<void> WifiNanIface::dataInterfaceDelete(
- uint32_t cmd_id,
- const hidl_string& iface_name,
- dataInterfaceDelete_cb hidl_status_cb) {
- return validateAndCall(this,
- WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
- &WifiNanIface::dataInterfaceDeleteInternal,
- hidl_status_cb,
- cmd_id,
- iface_name);
-}
-
-Return<void> WifiNanIface::dataRequestInitiator(
- uint32_t cmd_id,
- const NanDataPathInitiatorRequest& msg,
- dataRequestInitiator_cb hidl_status_cb) {
- return validateAndCall(this,
- WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
- &WifiNanIface::dataRequestInitiatorInternal,
- hidl_status_cb,
- cmd_id,
- msg);
-}
-
-Return<void> WifiNanIface::dataIndicationResponse(
- uint32_t cmd_id,
- const NanDataPathIndicationResponse& msg,
- dataIndicationResponse_cb hidl_status_cb) {
- return validateAndCall(this,
- WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
- &WifiNanIface::dataIndicationResponseInternal,
- hidl_status_cb,
- cmd_id,
- msg);
-}
-
-Return<void> WifiNanIface::dataEnd(uint32_t cmd_id,
- const NanDataPathEndRequest& msg,
- dataEnd_cb hidl_status_cb) {
- return validateAndCall(this,
- WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
- &WifiNanIface::dataEndInternal,
- hidl_status_cb,
- cmd_id,
- msg);
-}
-
-Return<void> WifiNanIface::getType(getType_cb hidl_status_cb) {
- return validateAndCall(this,
- WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
- &WifiNanIface::getTypeInternal,
- hidl_status_cb);
-}
-
std::pair<WifiStatus, std::string> WifiNanIface::getNameInternal() {
return {createWifiStatus(WifiStatusCode::SUCCESS), ifname_};
}
@@ -294,16 +629,24 @@
WifiStatus WifiNanIface::registerEventCallbackInternal(
const sp<IWifiNanIfaceEventCallback>& callback) {
- // TODO(b/31632518): remove the callback when the client is destroyed
+ // TODO(b/31632518): remove the callback when the client is destroyed and/or
+ // make sure that the same callback is only registered once (i.e. detect duplicates)
+ // OR: consider having a single listener - not clear why multiple listeners (managers) are
+ // necessary, nor how they would coordinate (at least command IDs).
event_callbacks_.emplace_back(callback);
return createWifiStatus(WifiStatusCode::SUCCESS);
}
-WifiStatus WifiNanIface::enableRequestInternal(uint32_t cmd_id,
+WifiStatus WifiNanIface::getCapabilitiesRequestInternal(uint16_t cmd_id) {
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->nanGetCapabilities(cmd_id);
+ return createWifiStatusFromLegacyError(legacy_status);
+}
+
+WifiStatus WifiNanIface::enableRequestInternal(uint16_t cmd_id,
const NanEnableRequest& msg) {
legacy_hal::NanEnableRequest legacy_msg;
- if (!hidl_struct_util::convertHidlNanEnableRequestToLegacy(msg,
- &legacy_msg)) {
+ if (!hidl_struct_util::convertHidlNanEnableRequestToLegacy(msg, &legacy_msg)) {
return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
}
legacy_hal::wifi_error legacy_status =
@@ -311,14 +654,26 @@
return createWifiStatusFromLegacyError(legacy_status);
}
-WifiStatus WifiNanIface::disableRequestInternal(uint32_t cmd_id) {
+WifiStatus WifiNanIface::configRequestInternal(
+ uint16_t cmd_id, const NanConfigRequest& msg) {
+ legacy_hal::NanConfigRequest legacy_msg;
+ if (!hidl_struct_util::convertHidlNanConfigRequestToLegacy(msg,
+ &legacy_msg)) {
+ return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
+ }
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->nanConfigRequest(cmd_id, legacy_msg);
+ return createWifiStatusFromLegacyError(legacy_status);
+}
+
+WifiStatus WifiNanIface::disableRequestInternal(uint16_t cmd_id) {
legacy_hal::wifi_error legacy_status =
legacy_hal_.lock()->nanDisableRequest(cmd_id);
return createWifiStatusFromLegacyError(legacy_status);
}
-WifiStatus WifiNanIface::publishRequestInternal(uint32_t cmd_id,
- const NanPublishRequest& msg) {
+WifiStatus WifiNanIface::startPublishRequestInternal(uint16_t cmd_id,
+ const NanPublishRequest& msg) {
legacy_hal::NanPublishRequest legacy_msg;
if (!hidl_struct_util::convertHidlNanPublishRequestToLegacy(msg,
&legacy_msg)) {
@@ -329,20 +684,17 @@
return createWifiStatusFromLegacyError(legacy_status);
}
-WifiStatus WifiNanIface::publishCancelRequestInternal(
- uint32_t cmd_id, const NanPublishCancelRequest& msg) {
+WifiStatus WifiNanIface::stopPublishRequestInternal(
+ uint16_t cmd_id, uint16_t sessionId) {
legacy_hal::NanPublishCancelRequest legacy_msg;
- if (!hidl_struct_util::convertHidlNanPublishCancelRequestToLegacy(
- msg, &legacy_msg)) {
- return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
- }
+ legacy_msg.publish_id = sessionId;
legacy_hal::wifi_error legacy_status =
legacy_hal_.lock()->nanPublishCancelRequest(cmd_id, legacy_msg);
return createWifiStatusFromLegacyError(legacy_status);
}
-WifiStatus WifiNanIface::subscribeRequestInternal(
- uint32_t cmd_id, const NanSubscribeRequest& msg) {
+WifiStatus WifiNanIface::startSubscribeRequestInternal(
+ uint16_t cmd_id, const NanSubscribeRequest& msg) {
legacy_hal::NanSubscribeRequest legacy_msg;
if (!hidl_struct_util::convertHidlNanSubscribeRequestToLegacy(msg,
&legacy_msg)) {
@@ -353,59 +705,81 @@
return createWifiStatusFromLegacyError(legacy_status);
}
-WifiStatus WifiNanIface::subscribeCancelRequestInternal(
- uint32_t /* cmd_id */, const NanSubscribeCancelRequest& /* msg */) {
- // TODO implement
- return createWifiStatus(WifiStatusCode::SUCCESS);
+WifiStatus WifiNanIface::stopSubscribeRequestInternal(
+ uint16_t cmd_id, uint16_t sessionId) {
+ legacy_hal::NanSubscribeCancelRequest legacy_msg;
+ legacy_msg.subscribe_id = sessionId;
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->nanSubscribeCancelRequest(cmd_id, legacy_msg);
+ return createWifiStatusFromLegacyError(legacy_status);
}
+
WifiStatus WifiNanIface::transmitFollowupRequestInternal(
- uint32_t /* cmd_id */, const NanTransmitFollowupRequest& /* msg */) {
- // TODO implement
- return createWifiStatus(WifiStatusCode::SUCCESS);
+ uint16_t cmd_id, const NanTransmitFollowupRequest& msg) {
+ legacy_hal::NanTransmitFollowupRequest legacy_msg;
+ if (!hidl_struct_util::convertHidlNanTransmitFollowupRequestToLegacy(msg, &legacy_msg)) {
+ return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
+ }
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->nanTransmitFollowupRequest(cmd_id, legacy_msg);
+ return createWifiStatusFromLegacyError(legacy_status);
}
-WifiStatus WifiNanIface::configRequestInternal(
- uint32_t /* cmd_id */, const NanConfigRequest& /* msg */) {
- // TODO implement
- return createWifiStatus(WifiStatusCode::SUCCESS);
+
+WifiStatus WifiNanIface::createDataInterfaceRequestInternal(
+ uint16_t cmd_id, const std::string& iface_name) {
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->nanDataInterfaceCreate(cmd_id, iface_name);
+ return createWifiStatusFromLegacyError(legacy_status);
+}
+WifiStatus WifiNanIface::deleteDataInterfaceRequestInternal(
+ uint16_t cmd_id, const std::string& iface_name) {
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->nanDataInterfaceDelete(cmd_id, iface_name);
+ return createWifiStatusFromLegacyError(legacy_status);
+}
+WifiStatus WifiNanIface::initiateDataPathRequestInternal(
+ uint16_t cmd_id, const NanInitiateDataPathRequest& msg) {
+ legacy_hal::NanDataPathInitiatorRequest legacy_msg;
+ if (!hidl_struct_util::convertHidlNanDataPathInitiatorRequestToLegacy(msg, &legacy_msg)) {
+ return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
+ }
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->nanDataRequestInitiator(cmd_id, legacy_msg);
+ return createWifiStatusFromLegacyError(legacy_status);
+}
+WifiStatus WifiNanIface::respondToDataPathIndicationRequestInternal(
+ uint16_t cmd_id, const NanRespondToDataPathIndicationRequest& msg) {
+ legacy_hal::NanDataPathIndicationResponse legacy_msg;
+ if (!hidl_struct_util::convertHidlNanDataPathIndicationResponseToLegacy(msg, &legacy_msg)) {
+ return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
+ }
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->nanDataIndicationResponse(cmd_id, legacy_msg);
+ return createWifiStatusFromLegacyError(legacy_status);
+}
+WifiStatus WifiNanIface::terminateDataPathRequestInternal(
+ uint16_t cmd_id, uint32_t ndpInstanceId) {
+ legacy_hal::NanDataPathEndRequest* legacy_msg = (legacy_hal::NanDataPathEndRequest*)malloc(
+ sizeof(legacy_hal::NanDataPathEndRequest) + sizeof(uint32_t));
+ legacy_msg->num_ndp_instances = 1;
+ legacy_msg->ndp_instance_id[0] = ndpInstanceId;
+
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->nanDataEnd(cmd_id, *legacy_msg);
+ free(legacy_msg);
+ return createWifiStatusFromLegacyError(legacy_status);
}
WifiStatus WifiNanIface::beaconSdfPayloadRequestInternal(
- uint32_t /* cmd_id */, const NanBeaconSdfPayloadRequest& /* msg */) {
- // TODO implement
- return createWifiStatus(WifiStatusCode::SUCCESS);
+ uint16_t cmd_id, const NanBeaconSdfPayloadRequest& msg) {
+ legacy_hal::NanBeaconSdfPayloadRequest legacy_msg;
+ if (!hidl_struct_util::convertHidlNanBeaconSdfPayloadRequestToLegacy(msg, &legacy_msg)) {
+ return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
+ }
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->nanBeaconSdfPayloadRequest(cmd_id, legacy_msg);
+ return createWifiStatusFromLegacyError(legacy_status);
}
-std::pair<WifiStatus, NanVersion> WifiNanIface::getVersionInternal() {
- // TODO implement
- return {createWifiStatus(WifiStatusCode::SUCCESS), 0};
-}
-WifiStatus WifiNanIface::getCapabilitiesInternal(uint32_t /* cmd_id */) {
- // TODO implement
- return createWifiStatus(WifiStatusCode::SUCCESS);
-}
-WifiStatus WifiNanIface::dataInterfaceCreateInternal(
- uint32_t /* cmd_id */, const std::string& /* iface_name */) {
- // TODO implement
- return createWifiStatus(WifiStatusCode::SUCCESS);
-}
-WifiStatus WifiNanIface::dataInterfaceDeleteInternal(
- uint32_t /* cmd_id */, const std::string& /* iface_name */) {
- // TODO implement
- return createWifiStatus(WifiStatusCode::SUCCESS);
-}
-WifiStatus WifiNanIface::dataRequestInitiatorInternal(
- uint32_t /* cmd_id */, const NanDataPathInitiatorRequest& /* msg */) {
- // TODO implement
- return createWifiStatus(WifiStatusCode::SUCCESS);
-}
-WifiStatus WifiNanIface::dataIndicationResponseInternal(
- uint32_t /* cmd_id */, const NanDataPathIndicationResponse& /* msg */) {
- // TODO implement
- return createWifiStatus(WifiStatusCode::SUCCESS);
-}
-WifiStatus WifiNanIface::dataEndInternal(
- uint32_t /* cmd_id */, const NanDataPathEndRequest& /* msg */) {
- // TODO implement
- return createWifiStatus(WifiStatusCode::SUCCESS);
-}
+
} // namespace implementation
} // namespace V1_0
} // namespace wifi
diff --git a/wifi/1.0/default/wifi_nan_iface.h b/wifi/1.0/default/wifi_nan_iface.h
index 4f89b31..4fae3df 100644
--- a/wifi/1.0/default/wifi_nan_iface.h
+++ b/wifi/1.0/default/wifi_nan_iface.h
@@ -46,58 +46,50 @@
Return<void> registerEventCallback(
const sp<IWifiNanIfaceEventCallback>& callback,
registerEventCallback_cb hidl_status_cb) override;
- Return<void> enableRequest(uint32_t cmd_id,
+ Return<void> getCapabilitiesRequest(uint16_t cmd_id,
+ getCapabilitiesRequest_cb hidl_status_cb) override;
+ Return<void> enableRequest(uint16_t cmd_id,
const NanEnableRequest& msg,
enableRequest_cb hidl_status_cb) override;
- Return<void> disableRequest(uint32_t cmd_id,
- disableRequest_cb hidl_status_cb) override;
- Return<void> publishRequest(uint32_t cmd_id,
- const NanPublishRequest& msg,
- publishRequest_cb hidl_status_cb) override;
- Return<void> publishCancelRequest(
- uint32_t cmd_id,
- const NanPublishCancelRequest& msg,
- publishCancelRequest_cb hidl_status_cb) override;
- Return<void> subscribeRequest(uint32_t cmd_id,
- const NanSubscribeRequest& msg,
- subscribeRequest_cb hidl_status_cb) override;
- Return<void> subscribeCancelRequest(
- uint32_t cmd_id,
- const NanSubscribeCancelRequest& msg,
- subscribeCancelRequest_cb hidl_status_cb) override;
- Return<void> transmitFollowupRequest(
- uint32_t cmd_id,
- const NanTransmitFollowupRequest& msg,
- transmitFollowupRequest_cb hidl_status_cb) override;
- Return<void> configRequest(uint32_t cmd_id,
+ Return<void> configRequest(uint16_t cmd_id,
const NanConfigRequest& msg,
configRequest_cb hidl_status_cb) override;
- Return<void> beaconSdfPayloadRequest(
- uint32_t cmd_id,
- const NanBeaconSdfPayloadRequest& msg,
- beaconSdfPayloadRequest_cb hidl_status_cb) override;
- Return<void> getVersion(getVersion_cb hidl_status_cb) override;
- Return<void> getCapabilities(uint32_t cmd_id,
- getCapabilities_cb hidl_status_cb) override;
- Return<void> dataInterfaceCreate(
- uint32_t cmd_id,
- const hidl_string& iface_name,
- dataInterfaceCreate_cb hidl_status_cb) override;
- Return<void> dataInterfaceDelete(
- uint32_t cmd_id,
- const hidl_string& iface_name,
- dataInterfaceDelete_cb hidl_status_cb) override;
- Return<void> dataRequestInitiator(
- uint32_t cmd_id,
- const NanDataPathInitiatorRequest& msg,
- dataRequestInitiator_cb hidl_status_cb) override;
- Return<void> dataIndicationResponse(
- uint32_t cmd_id,
- const NanDataPathIndicationResponse& msg,
- dataIndicationResponse_cb hidl_status_cb) override;
- Return<void> dataEnd(uint32_t cmd_id,
- const NanDataPathEndRequest& msg,
- dataEnd_cb hidl_status_cb) override;
+ Return<void> disableRequest(uint16_t cmd_id,
+ disableRequest_cb hidl_status_cb) override;
+ Return<void> startPublishRequest(uint16_t cmd_id,
+ const NanPublishRequest& msg,
+ startPublishRequest_cb hidl_status_cb) override;
+ Return<void> stopPublishRequest(uint16_t cmd_id,
+ uint16_t sessionId,
+ stopPublishRequest_cb hidl_status_cb) override;
+ Return<void> startSubscribeRequest(uint16_t cmd_id,
+ const NanSubscribeRequest& msg,
+ startSubscribeRequest_cb hidl_status_cb) override;
+ Return<void> stopSubscribeRequest(uint16_t cmd_id,
+ uint16_t sessionId,
+ stopSubscribeRequest_cb hidl_status_cb) override;
+ Return<void> transmitFollowupRequest(uint16_t cmd_id,
+ const NanTransmitFollowupRequest& msg,
+ transmitFollowupRequest_cb hidl_status_cb) override;
+ Return<void> createDataInterfaceRequest(uint16_t cmd_id,
+ const hidl_string& iface_name,
+ createDataInterfaceRequest_cb hidl_status_cb) override;
+ Return<void> deleteDataInterfaceRequest(uint16_t cmd_id,
+ const hidl_string& iface_name,
+ deleteDataInterfaceRequest_cb hidl_status_cb) override;
+ Return<void> initiateDataPathRequest(uint16_t cmd_id,
+ const NanInitiateDataPathRequest& msg,
+ initiateDataPathRequest_cb hidl_status_cb) override;
+ Return<void> respondToDataPathIndicationRequest(
+ uint16_t cmd_id,
+ const NanRespondToDataPathIndicationRequest& msg,
+ respondToDataPathIndicationRequest_cb hidl_status_cb) override;
+ Return<void> terminateDataPathRequest(uint16_t cmd_id,
+ uint32_t ndpInstanceId,
+ terminateDataPathRequest_cb hidl_status_cb) override;
+ Return<void> beaconSdfPayloadRequest(uint16_t cmd_id,
+ const NanBeaconSdfPayloadRequest& msg,
+ beaconSdfPayloadRequest_cb hidl_status_cb) override;
private:
// Corresponding worker functions for the HIDL methods.
@@ -105,34 +97,32 @@
std::pair<WifiStatus, IfaceType> getTypeInternal();
WifiStatus registerEventCallbackInternal(
const sp<IWifiNanIfaceEventCallback>& callback);
- WifiStatus enableRequestInternal(uint32_t cmd_id,
+ WifiStatus getCapabilitiesRequestInternal(uint16_t cmd_id);
+ WifiStatus enableRequestInternal(uint16_t cmd_id,
const NanEnableRequest& msg);
- WifiStatus disableRequestInternal(uint32_t cmd_id);
- WifiStatus publishRequestInternal(uint32_t cmd_id,
- const NanPublishRequest& msg);
- WifiStatus publishCancelRequestInternal(uint32_t cmd_id,
- const NanPublishCancelRequest& msg);
- WifiStatus subscribeRequestInternal(uint32_t cmd_id,
- const NanSubscribeRequest& msg);
- WifiStatus subscribeCancelRequestInternal(
- uint32_t cmd_id, const NanSubscribeCancelRequest& msg);
- WifiStatus transmitFollowupRequestInternal(
- uint32_t cmd_id, const NanTransmitFollowupRequest& msg);
- WifiStatus configRequestInternal(uint32_t cmd_id,
+ WifiStatus configRequestInternal(uint16_t cmd_id,
const NanConfigRequest& msg);
+ WifiStatus disableRequestInternal(uint16_t cmd_id);
+ WifiStatus startPublishRequestInternal(uint16_t cmd_id,
+ const NanPublishRequest& msg);
+ WifiStatus stopPublishRequestInternal(uint16_t cmd_id, uint16_t sessionId);
+ WifiStatus startSubscribeRequestInternal(uint16_t cmd_id,
+ const NanSubscribeRequest& msg);
+ WifiStatus stopSubscribeRequestInternal(uint16_t cmd_id, uint16_t sessionId);
+ WifiStatus transmitFollowupRequestInternal(
+ uint16_t cmd_id, const NanTransmitFollowupRequest& msg);
+ WifiStatus createDataInterfaceRequestInternal(uint16_t cmd_id,
+ const std::string& iface_name);
+ WifiStatus deleteDataInterfaceRequestInternal(uint16_t cmd_id,
+ const std::string& iface_name);
+ WifiStatus initiateDataPathRequestInternal(
+ uint16_t cmd_id, const NanInitiateDataPathRequest& msg);
+ WifiStatus respondToDataPathIndicationRequestInternal(
+ uint16_t cmd_id, const NanRespondToDataPathIndicationRequest& msg);
+ WifiStatus terminateDataPathRequestInternal(
+ uint16_t cmd_id, uint32_t ndpInstanceId);
WifiStatus beaconSdfPayloadRequestInternal(
- uint32_t cmd_id, const NanBeaconSdfPayloadRequest& msg);
- std::pair<WifiStatus, NanVersion> getVersionInternal();
- WifiStatus getCapabilitiesInternal(uint32_t cmd_id);
- WifiStatus dataInterfaceCreateInternal(uint32_t cmd_id,
- const std::string& iface_name);
- WifiStatus dataInterfaceDeleteInternal(uint32_t cmd_id,
- const std::string& iface_name);
- WifiStatus dataRequestInitiatorInternal(
- uint32_t cmd_id, const NanDataPathInitiatorRequest& msg);
- WifiStatus dataIndicationResponseInternal(
- uint32_t cmd_id, const NanDataPathIndicationResponse& msg);
- WifiStatus dataEndInternal(uint32_t cmd_id, const NanDataPathEndRequest& msg);
+ uint16_t cmd_id, const NanBeaconSdfPayloadRequest& msg);
std::string ifname_;
std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal_;
diff --git a/wifi/1.0/types.hal b/wifi/1.0/types.hal
index 76c89e3..1e86be4 100644
--- a/wifi/1.0/types.hal
+++ b/wifi/1.0/types.hal
@@ -563,148 +563,77 @@
* NAN specific types.
* TODO(b/32159498): Move to a separate nan_types.hal.
*/
+
/**
- * Various max sizes used in the NAN interface.
+ * A unique short handle provided by the client to identify individual invocations of
+ * certain API's like |IWifiNanIface.*|.
*/
-enum NanMaxSize : uint32_t {
- SOCIAL_CHANNELS = 3,
- SERVICE_NAME_LEN = 255,
- MATCH_FILTER_LEN = 255,
- SERVICE_SPECIFIC_INFO_LEN = 1024,
- VSA_DATA_LEN = 1024,
- MESH_DATA_LEN = 32,
- INFRA_DATA_LEN = 32,
- CLUSTER_ATTRIBUTE_LEN = 255,
- SUBSCRIBE_MAX_ADDRESS = 42,
- FAM_CHANNELS = 32,
- POSTDISCOVERY_LEN = 5,
- FRAME_DATA_LEN = 504,
- DP_APP_INFO_LEN = 512,
+typedef uint16_t CommandIdShort;
+
+/**
+ * NAN API response codes used in request notifications and events.
+ */
+enum NanStatusType : uint32_t {
+ SUCCESS = 0,
+ /* NAN Discovery Engine/Host driver failures */
+ INTERNAL_FAILURE = 1,
+ /* NAN OTA failures */
+ PROTOCOL_FAILURE = 2,
+ /* The publish/subscribe discovery session id is invalid */
+ INVALID_SESSION_ID = 3,
+ /* Out of resources to fufill request */
+ NO_RESOURCES_AVAILABLE = 4,
+ /* Invalid arguments passed */
+ INVALID_ARGS = 5,
+ /* Invalid peer id */
+ INVALID_PEER_ID = 6,
+ /* Invalid NAN data-path (ndp) id */
+ INVALID_NDP_ID = 7,
+ /* Attempting to enable NAN when not available, e.g. wifi is disabled */
+ NAN_NOT_ALLOWED = 8,
+ /* Over the air ACK not received */
+ NO_OTA_ACK = 9,
+ /* Attempting to enable NAN when already enabled */
+ ALREADY_ENABLED = 10,
+ /* Can't queue tx followup message foor transmission */
+ FOLLOWUP_TX_QUEUE_FULL = 11,
+ /* Unsupported concurrency of NAN and another feature - NAN disabled */
+ UNSUPPORTED_CONCURRENCY_NAN_DISABLED = 12
};
/**
- * NAN protocol Version info.
+ * The discovery bands supported by NAN.
*/
-typedef int32_t NanVersion;
-
-/**
- * NAN data path identifiers.
- */
-typedef uint32_t NanDataPathId;
-
-/**
- * Data request Initiator/Responder app/service related info.
- */
-struct NanDataPathAppInfo {
- /**
- * Max length: |MAX_DP_APP_INFO_LEN|.
- */
- vec<uint8_t> ndpAppInfo;
+enum NanBandIndex : uint32_t {
+ NAN_BAND_24GHZ = 0,
+ NAN_BAND_5GHZ
};
/**
- * Configuration params of Data request Initiator/Responder.
+ * The status information returned in NAN notifications.
*/
-struct NanDataPathCfg {
+struct WifiNanStatus {
/**
- * Indicates whether to use Security/No Security.
+ * Status of the command request.
*/
- bool useSecurity;
+ NanStatusType status;
/**
- * Indicating whether to use QOS/No QOS.
+ * Further description of the issue causing a failure.
*/
- bool useQos;
+ string description;
};
/**
- * Indicates the availability interval duration associated with the
- * Availability Intervals Bitmap field
+ * NAN Match indication type.
*/
-enum NanAvailDuration : uint32_t {
- DURATION_16MS = 0,
- DURATION_32MS = 1,
- DURATION_64MS = 2,
+enum NanMatchAlg : uint32_t {
+ MATCH_ONCE = 0,
+ MATCH_CONTINUOUS,
+ MATCH_NEVER,
};
/**
- * Possible connection types in Post NAN Discovery attributes.
- */
-enum NanConnectionType : uint32_t {
- WLAN_INFRA = 0,
- P2P_OPER = 1,
- WLAN_IBSS = 2,
- WLAN_MESH = 3,
- FURTHER_SERVICE_AVAILABILITY = 4,
- WLAN_RANGING = 5,
-};
-
-/**
- * Possible device roles in Post NAN Discovery attributes.
- */
-enum NanDeviceRole : uint32_t {
- WLAN_INFRA_AP = 0,
- WLAN_INFRA_STA = 1,
- P2P_OPER_GO = 2,
- P2P_OPER_DEV = 3,
- P2P_OPER_CLI = 4,
-};
-
-/**
- * Data request Responder's response.
- */
-enum NanDataPathResponseCode : uint32_t {
- ACCEPT = 0,
- REJECT,
-};
-
-/**
- * Further availability per channel information.
- */
-struct NanFurtherAvailabilityChannel {
- /**
- * Defined above.
- */
- NanAvailDuration entryControl;
- /**
- * 1 byte field indicating the frequency band the NAN Device
- * must be available as defined in IEEE Std. 802.11-2012
- * Annex E Table E-4 Global Operating Classes
- */
- uint8_t classVal;
- /**
- * 1 byte field indicating the channel the NAN Device
- * must be available.
- */
- uint8_t channel;
- /**
- * Map Id - 4 bit field which identifies the Further
- * availability map attribute.
- */
- uint8_t mapid;
- /**
- * Divides the time between the beginnings of consecutive "Discovery
- * Windows" of a given NAN cluster into consecutive time intervals
- * of equal durations. The time interval duration is specified by
- * the |entryControl| field.
- * A device that sets the i-th bit of the Availability
- * Intervals Bitmap to 1 shall be present during the corresponding
- * i-th time interval in the operation channel indicated by the
- * Operating Class and Channel Number fields in the same Availability Entry.
- * A device that sets the i-th bit of the Availability Intervals Bitmap to
- * 0 may be present during the corresponding i-th time interval in the operation
- * channel indicated by the Operating Class and Channel Number fields in the same
- * Availability Entry.
- * The size of the Bitmap is dependent upon the Availability Interval Duration
- * Chosen in the Entry Control Field. The size can be either 1, 2 or 4 bytes long
- * - Duration field is equal to 0, only AIB[0] is valid
- * - Duration field is equal to 1, only AIB [0] and AIB [1] is valid
- * - Duration field is equal to 2, AIB [0], AIB [1], AIB [2] and AIB [3] are valid
- */
- uint32_t availIntervalBitmap;
-};
-
-/**
- * NAN Publish Types.
+ * NAN publish discovery session types.
*/
enum NanPublishType : uint32_t {
UNSOLICITED = 0,
@@ -713,15 +642,8 @@
};
/**
- * NAN Transmit Priorities.
- */
-enum NanTxPriority : uint32_t {
- NORMAL = 0,
- HIGH,
-};
-
-/**
- * NAN Transmit Types.
+ * NAN transmit type used in |NanPublishType.SOLICITED| or |NanPublishType.UNSOLICITED_SOLICITED|
+ * publish discovery sessions.
*/
enum NanTxType : uint32_t {
BROADCAST = 0,
@@ -729,7 +651,7 @@
};
/**
- * NAN Subscribe Type.
+ * NAN subscribe discovery session ypes.
*/
enum NanSubscribeType : uint32_t {
PASSIVE = 0,
@@ -745,31 +667,6 @@
};
/**
- * NAN Service Response Filter Include Bit.
- */
-enum NanSrfIncludeType : uint32_t {
- DO_NOT_RESPOND = 0,
- RESPOND,
-};
-
-/**
- * NAN Match indication type.
- */
-enum NanMatchAlg : uint32_t {
- MATCH_ONCE = 0,
- MATCH_CONTINUOUS,
- MATCH_NEVER,
-};
-
-/**
- * NAN Transmit Window Type.
- */
-enum NanTransmitWindowType : uint32_t {
- DW = 0,
- FAW,
-};
-
-/**
* NAN DP channel config options.
*/
enum NanDataPathChannelCfg : uint32_t {
@@ -779,575 +676,415 @@
};
/**
- * Host can send Vendor specific attributes which the Discovery Engine can
- * enclose in Beacons and/or Service Discovery frames transmitted.
- * Below structure is used to populate that.
- * TODO(b/32207606): This can be moved to vendor extension.
+ * NAN band-specific configuration.
*/
-struct NanTransmitVendorSpecificAttribute {
+struct NanBandSpecificConfig {
/**
- * 0 = transmit only in the next discovery window
- * 1 = transmit in next 16 discovery window
+ * RSSI values controlling clustering behavior per spec.
*/
- uint8_t payloadTransmitFlag;
+ uint8_t rssiClose;
+ uint8_t rssiMiddle;
/**
- * Below flags must determine in which all frames
- * the vendor specific attributes must be included
+ * RSSI value determining whether discovery is near (used if enabled in discovery).
*/
- uint8_t txInDiscoveryBeacon;
- uint8_t txInSyncBeacon;
- uint8_t txInServiceDiscovery;
+ uint8_t rssiProximity;
/**
- * Organizationally Unique Identifier.
- */
- uint32_t vendorOui;
- /**
- * Vendor specific attribute to be transmitted.
- * Max length: |MAX_VSA_DATA_LEN|.
- */
- vec<uint8_t> vsa;
-};
-
-/**
- * Host can set the Periodic scan parameters for each of the
- * 3(6, 44, 149) Social channels. Only these channels are allowed
- * any other channels are rejected
- */
- enum NanChannelIndex : uint32_t {
- CHANNEL_24G_BAND = 0,
- CHANNEL_5G_BAND_LOW,
- CHANNEL_5G_BAND_HIGH,
-};
-
-/**
- * Structure to set the Social Channel Scan parameters
- * passed as part of EnableRequest/ConfigRequest.
- */
-struct NanSocialChannelScanParams {
- /**
- * Dwell time of each social channel in milliseconds
- * ChannelIndex corresponds to the respective channel
+ * Dwell time of each discovery channel in milliseconds.
* If time set to 0 then the FW default time must be used.
- * Max length: |MAX_SOCIAL_CHANNELS|.
- * dwellTime[i] refers to the dwell time of the i'th social channel.
*/
- vec<uint8_t> dwellTime;
+ uint8_t dwellTimeMs;
/**
- * Scan period of each social channel in seconds
- * ChannelIndex corresponds to the respective channel
+ * Scan period of each discovery channel in seconds.
* If time set to 0 then the FW default time must be used.
- * Max length: |MAX_SOCIAL_CHANNELS|.
- * scanPeriod[i] refers to the scan period of the i'th social channel.
*/
- vec<uint16_t> scanPeriod;
+ uint16_t scanPeriodSec;
+ /**
+ * Specifies the interval for Sync beacons and SDF's.
+ * Valid values of DW Interval are: 1, 2, 3, 4 and 5 corresponding to 1, 2, 4, 8, and 16 DWs.
+ * Value of 0:
+ * - reserved in 2.4GHz band
+ * - no wakeup at all in 5GHz band
+ * The publish/subscribe period values don't override the device level configurations if
+ * specified (if 'valid' is true).
+ */
+ bool validDiscoveryWindowIntervalVal;
+ uint8_t discoveryWindowIntervalVal;
};
/**
- * Enable Request Message Structure
- * The EnableReq message in structs the Discovery Engine to enter an operational state
+ * Configuration parameters
*/
-struct NanEnableRequest {
+struct NanDebugConfig {
/**
- * Mandatory parameters below.
+ * The low and high values of the cluster ID: standard values are 0x0000 - 0xFFFF.
+ * A clusterLow == clusterHigh indicates a request to join or create a cluster with that ID.
+ * Used if 'valid' is true.
*/
- uint8_t masterPref;
+ bool validClusterIdVals;
+ uint16_t clusterIdLowVal;
+ uint16_t clusterIdHighVal;
/**
- * A cluster_low value matching cluster_high indicates a request to join
- * a cluster with that value. If the requested cluster is not found the
- * device must start its own cluster.
- */
- uint16_t clusterLow;
- uint16_t clusterHigh;
- /**
- * Optional configuration of Enable request.
- * Each of the optional parameters have configure flag which
- * determine whether configuration is to be passed or not.
- */
- bool validSupport5gVal;
- uint8_t support5gVal;
- /**
- * BIT 0 is used to specify to include Service IDs in Sync/Discovery beacons
- * 0 - Do not include SIDs in any beacons
- * 1 - Include SIDs in all beacons.
- * Rest 7 bits are count field which allows control over the number of SIDs
- * included in the Beacon. 0 means to include as many SIDs that fit into
- * the maximum allow Beacon frame size
- */
- bool validSidBeaconVal;
- uint8_t sidBeaconVal;
- /**
- * The rssi values below must be specified without sign.
- * For eg: -70dBm must be specified as 70.
- */
- bool valid2dot4gRssiCloseVal;
- uint8_t rssiClose2dot4gVal;
- bool valid2dot4gRssiMiddleVal;
- uint8_t rssiMiddle2dot4gVal;
- bool valid2dot4gRssiProximityVal;
- uint8_t rssiProximity2dot4gVal;
- bool validHopCountLimitVal;
- uint8_t hopCountLimitVal;
- /**
- * Defines 2.4G channel access support
- */
- bool valid2dot4gSupportVal;
- bool support2dot4gVal;
- /**
- * Defines 2.4G channels must be used for sync/discovery beacons
- */
- bool valid2dot4gBeaconsVal;
- bool beacon2dot4gVal;
- /**
- * Defines 2.4G channels must be used for Service Discovery frames
- */
- bool valid2dot4gSdfVal;
- bool sdf2dot4gVal;
- /**
- * Defines 5G channels must be used for sync/discovery beacons
- */
- bool valid5gBeaconsVal;
- bool beacon5gVal;
- /**
- * Defines 5G channels must be used for Service Discovery frames
- */
- bool valid5gSdfVal;
- bool sdf5gVal;
- /**
- * 1 byte value which defines the RSSI in
- * dBm for a close by Peer in 5 Ghz channels.
- * The rssi values must be specified without sign.
- * For eg: -70dBm must be specified as 70.
- */
- bool valid5gRssiCloseVal;
- uint8_t rssiClose5gVal;
- /**
- * 1 byte value which defines the RSSI value in
- * dBm for a close by Peer in 5 Ghz channels.
- * The rssi values must be specified without sign.
- * For eg: -70dBm must be specified as 70.
- */
- bool valid5gRssiMiddleVal;
- uint8_t rssiMiddle5gVal;
- /**
- * 1 byte value which defines the RSSI filter
- * threshold. Any Service Descriptors received above this
- * value that are configured for RSSI filtering must be dropped.
- * The rssi values must be specified without sign.
- * For eg: -70dBm must be specified as 70.
- */
- bool valid5gRssiCloseProximityVal;
- uint8_t rssiCloseProximity5gVal;
- /**
- * 1 byte quantity which defines the window size over
- * which the “average RSSI” must be calculated over.
- */
- bool validRssiWindowSizeVal;
- uint8_t rssiWindowSizeVal;
- /**
- * The 24 bit Organizationally Unique ID + the 8 bit Network Id.
- */
- uint8_t validOuiVal;
- uint32_t ouiVal;
- /**
- * NAN Interface Address, If not configured the Discovery Engine
- * must generate a 6 byte Random MAC.
+ * NAN management interface address, If specified ('valid' is true) then overrides any other
+ * configuration (specifically the default randomization).
*/
bool validIntfAddrVal;
MacAddress intfAddrVal;
/**
- * If set to true, the Discovery Engine must enclose the Cluster
- * Attribute only sent in Beacons in a Vendor Specific Attribute
- * and transmit in a Service Descriptor Frame.
+ * The 24 bit Organizationally Unique ID + the 8 bit Network Id. Used if 'valid' is true.
*/
- bool configClusterAttributeVal;
+ bool validOuiVal;
+ uint32_t ouiVal;
/**
- * The periodicity in seconds between full scan’s to find any new
- * clusters available in the area. A Full scan must not be done
- * more than every 10 seconds and must not be done less than every
- * 30 seconds.
- */
- bool validScanParamsVal;
- NanSocialChannelScanParams scanParamsVal;
- /**
- * 1 byte quantity which forces the Random Factor to a particular
- * value for all transmitted Sync/Discovery beacons
+ * Force the Random Factor to the specified value for all transmitted Sync/Discovery beacons
+ * if the 'valid' flag is true.
*/
bool validRandomFactorForceVal;
uint8_t randomFactorForceVal;
/**
- * 1 byte quantity which forces the HC for all transmitted Sync and
- * Discovery Beacon NO matter the real HC being received over the
- * air.
+ * Forces the hop-count for all transmitted Sync and Discovery Beacons NO matter the real
+ * hop-count being received over the air. Used if the 'valid' flag is true.
*/
bool validHopCountForceVal;
uint8_t hopCountForceVal;
/**
- * Channel frequency in MHz to enable on.
+ * Frequency in MHz to of the discovery channel in the specified band. Indexed by |NanBandIndex|.
*/
- bool valid24gChannelVal;
- WifiChannelInMhz channel24gVal;
- bool valid5gChannelVal;
- WifiChannelInMhz channel5gVal;
+ bool validDiscoveryChannelVal;
+ vec<WifiChannelInMhz> discoveryChannelMhzVal;
+ /**
+ * Specifies whether sync/discovery beacons are transmitted in the specified band. Indexed by
+ * |NanBandIndex|.
+ */
+ bool validUseBeaconsInBandVal;
+ vec<bool> useBeaconsInBandVal;
+ /**
+ * Specified whether SDF (service discovery frames) are transmitted in the specified band. Indexed
+ * by |NanBandIndex|.
+ */
+ bool validUseSdfInBandVal;
+ vec<bool> useSdfInBandVal;
};
+/**
+ * Configuration parameters of NAN: used when enabling and re-configuring a NAN cluster.
+ */
+struct NanConfigRequest {
+ /**
+ * Master preference of this device.
+ */
+ uint8_t masterPref;
+ /**
+ * Controls whether or not the |IWifiNanIfaceEventCallback.eventClusterEvent| will be delivered
+ * for DISCOVERY_MAC_ADDRESS_CHANGED.
+ */
+ bool disableDiscoveryAddressChangeIndication;
+ /**
+ * Controls whether or not the |IWifiNanIfaceEventCallback.eventClusterEvent| will be delivered
+ * for STARTED_CLUSTER.
+ */
+ bool disableStartedClusterIndication;
+ /**
+ * Controls whether or not the |IWifiNanIfaceEventCallback.eventClusterEvent| will be delivered
+ * for JOINED_CLUSTER.
+ */
+ bool disableJoinedClusterIndication;
+ /**
+ * Control whether service IDs are included in Sync/Discovery beacons.
+ */
+ bool includeServiceIdsInBeacon;
+ /**
+ * If |includeServiceIdInBeacon| is true then specifies the number of service IDs to include
+ * in the Sync/Discovery beacons:
+ * Value = 0: include as many service IDs as will fit into the maximum allowed beacon frame size.
+ * Value must fit within 7 bits - i.e. <= 127.
+ */
+ uint8_t numberOfServiceIdsInBeacon;
+ /**
+ * Number of samples used to calculate RSSI.
+ */
+ uint16_t rssiWindowSize;
+ /**
+ * Specifies the interval in seconds that the NAN management interface MAC address is randomized.
+ * A value of 0 is used to disable the MAC address randomization
+ */
+ uint32_t macAddressRandomizationIntervalSec;
+ /**
+ * Accept (if true) or not (if false) ranging requests from peers - whether in the context of
+ * discovery or otherwise.
+ */
+ bool acceptRangingRequests;
+ /**
+ * Additional configuration provided per band: indexed by |NanBandIndex|.
+ */
+ vec<NanBandSpecificConfig> bandSpecificConfig;
+};
/**
- * Publish Msg Structure
- * Message is used to request the DE to publish the Service Name
- * using the parameters passed into the "Discovery Window".
+ * Enable requests for NAN: start-up configuration.
+ */
+struct NanEnableRequest {
+ /**
+ * Enable operation in a specific band: indexed by |NanBandIndex|.
+ */
+ vec<bool> operateInBand;
+ /**
+ * Specify extent of cluster by specifying the max hop count.
+ */
+ uint8_t hopCountMax;
+ /**
+ * Configurations of NAN cluster operation. Can also be modified at run-time using
+ * |configRequest|.
+ */
+ NanConfigRequest configParams;
+ /**
+ * Non-standard configurations of NAN cluster operation - useful for debugging opeations.
+ */
+ NanDebugConfig debugConfigs;
+};
+
+/**
+ * Configurations of NAN discovery sessions: common to publish and subscribe discovery.
+ */
+struct NanDiscoveryCommonConfig {
+ /**
+ * The ID of the discovery session being configured. A value of 0 specifies a request to create
+ * a new discovery session.
+ */
+ uint16_t sessionId;
+ /**
+ * The lifetime of the discovery session in seconds. A value of 0 means run forever or until
+ * canceled.
+ */
+ uint16_t ttlSec;
+ /**
+ * Indicates the interval between two Discovery Windows in which the device supporting the
+ * service is awake to transmit or receive the Service Discovery frames.
+ * Valid values of Awake DW Interval are: 1, 2, 4, 8 and 16. A value of 0 will default to 1.
+ */
+ uint16_t discoveryWindowPeriod;
+ /**
+ * Number of other-air-air operations (i.e. active transmissions), 0 means forever or until
+ * canceled.
+ */
+ uint8_t discoveryCount;
+ /**
+ * UTF-8 encoded string identifying the service.
+ * Max length: |NanCapabilities.maxServiceNameLen|.
+ */
+ string serviceName;
+ /**
+ * Specifies the matching indication to host: once, continuous, or never.
+ */
+ NanMatchAlg discoveryMatchIndicator;
+ /**
+ * Arbitrary information communicated as part of discovery.
+ * Max length: |NanCapabilities.maxServiceSpecificInfoLen|.
+ */
+ vec<uint8_t> serviceSpecificInfo;
+ /**
+ * Ordered sequence of <length, value> pairs (length uses 1 byte) which specify further match
+ * criteria (beyond the service name).
+ * Publisher: used in SOLICITED or SOLICITED_UNSOLICITED sessions.
+ * Subscriber: used in ACTIVE or PASSIVE sessions.
+ * Max length: |NanCapabilities.maxMatchFilterLen|.
+ */
+ vec<uint8_t> rxMatchFilter;
+ /**
+ * Ordered sequence of <length, value> pairs (length uses 1 byte) which specify further match
+ * criteria (beyond the service name).
+ * Publisher: used if provided.
+ * Subscriber: used in ACTIVE sessions.
+ * Max length: |NanCapabilities.maxMatchFilterLen|.
+ */
+ vec<uint8_t> txMatchFilter;
+ /**
+ * Specifies whether or not the discovery session uses the |rssiProximity| value (configured
+ * in enable/configure requests) to filter out matched discovered peers.
+ */
+ bool useRssiThreshold;
+ /**
+ * Controls whether or not the |IWifiNanIfaceEventCallback.eventPublishTerminated| (for publish
+ * discovery sessions) or |IWifiNanIfaceEventCallback.eventSubscribeTerminated| (for subscribe
+ * discovery sessions) will be delivered.
+ */
+ bool disableDiscoveryTerminationIndication;
+ /**
+ * Controls whether or not the |IWifiNanIfaceEventCallback.eventMatchExpired| will be delivered.
+ */
+ bool disableMatchExpirationIndication;
+ /**
+ * Controls whether or not the |IWifiNanIfaceEventCallback.eventFollowupReceived| will be
+ * delivered.
+ */
+ bool disableFollowupReceivedIndication;
+ /**
+ * Cipher types supported in data-paths constructed in the context of this discovery session. The
+ * |NanCipherSuiteType| bit fields are used to set this value.
+ */
+ uint32_t supportedCipherTypes;
+ /**
+ * Optional PMK for data-paths constructed in the context of this discovery session. A PMK could
+ * also be provided during the actual construction of the data-path (which allows unique PMKs for
+ * each data-path).
+ * Max length: 32
+ */
+ vec<uint8_t> pmk;
+ /**
+ * Specifies whether or not security is enabled in any data-path (NDP) constructed in the context
+ * of this discovery session.
+ */
+ bool securityEnabledInNdp;
+ /**
+ * Specifies whether or not there is a ranging requirement in this discovery session.
+ * Note that ranging is only performed if all other match criteria with the peer are met.
+ */
+ bool rangingRequired;
+ /**
+ * Interval in msec between two ranging measurements.
+ * If the Awake DW interval in Enable/Config is larger than the ranging interval - priority is
+ * given to Awake DW interval.
+ */
+ uint32_t rangingIntervalMsec;
+ /**
+ * The type of ranging indication feedback to be provided by discovery session matches. Use
+ * bit-fields from |NanRangingIndication|.
+ */
+ uint32_t configRangingIndications;
+ /**
+ * The ingress and egress distance in cm. If ranging is eanbled (|rangingEnabled| is true) then
+ * \configRangingIndications\ is used to determine whether ingress and/or egress (or neither)
+ * are used to determine whether a match has occurred.
+ */
+ uint32_t distanceIngressCm;
+ uint32_t distanceEgressCm;
+};
+
+/**
+ * Cipher suite flags - to be used as a bitmask.
+ */
+enum NanCipherSuiteType : uint32_t {
+ SHARED_KEY_128_MASK = 1 << 0,
+ SHARED_KEY_256_MASK = 1 << 1
+};
+
+/**
+ * Ranging in the context of discovery sessions indication controls - to be used as a bitmask.
+ */
+enum NanRangingIndication : uint32_t {
+ CONTINUOUS_INDICATION_MASK = 1 << 0,
+ INGRESS_MET_MASK = 1 << 1,
+ EGRESS_MET_MASK = 1 << 2
+};
+
+/**
+ * Publish request: specifies a publish discovery operation.
*/
struct NanPublishRequest {
/**
- * Id 0 means new publish, any other id is existing publish.
+ * Common configuration of discovery sessions.
*/
- uint16_t publishId;
+ NanDiscoveryCommonConfig baseConfigs;
/**
- * How many seconds to run for. 0 means forever until canceled.
- */
- uint16_t ttl;
- /**
- * Periodicity of OTA unsolicited publish. Specified in increments of 500 ms.
- */
- uint16_t period;
- /**
- * 0= unsolicited, solicited = 1, 2= both.
+ * The type of the publish discovery session.
*/
NanPublishType publishType;
/**
- * 0 = broadcast, 1= unicast if solicited publish.
+ * For publishType of |NanPublishType.SOLICITED| or |NanPublishType.UNSOLICITED_SOLICITED|
+ * specifies the type of transmission used for responding to the probing subscribe discovery
+ * peer.
*/
NanTxType txType;
- /**
- * Number of OTA Publish, 0 means forever until canceled.
- */
- uint8_t publishCount;
- /**
- * UTF-8 encoded string identifying the service.
- * Max length: |MAX_SERVICE_NAME_LEN|.
- */
- string serviceName;
- /**
- * Field which specifies how the matching indication to host is controlled.
- * 0 - Match and Indicate Once
- * 1 - Match and Indicate continuous
- * 2 - Match and Indicate never. This means don't indicate the match to
- * the host.
- * 3 - Reserved
- */
- NanMatchAlg publishMatchIndicator;
- /**
- * Sequence of values NAN Device that has invoked a Subscribe method
- * corresponding to this Publish method.
- * Max length: |MAX_SERVICE_SPECIFIC_INFO_LEN|.
- */
- vec<uint8_t> serviceSpecificInfo;
- /**
- * Ordered sequence of <length, value> pairs which specify further response conditions
- * beyond the service name used to filter subscribe messages to respond to.
- * This is only needed when the PT is set to SOLICITED or SOLICITED_UNSOLICITED.
- * Max length: |MAX_MATCH_FILTER_LEN|.
- */
- vec<uint8_t> rxMatchFilter;
- /**
- * Ordered sequence of <length, value> pairs to be included in the Discovery Frame.
- * If present it is always sent in a Discovery Frame
- * Max length: |MAX_MATCH_FILTER_LEN|.
- */
- vec<uint8_t> txMatchFilter;
- /**
- * Flag which specifies that the Publish must use the configured RSSI
- * threshold and the received RSSI in order to filter requests
- * false – ignore the configured RSSI threshold when running a Service
- * Descriptor attribute or Service ID List Attribute through the DE matching logic.
- * true – use the configured RSSI threshold when running a Service
- * Descriptor attribute or Service ID List Attribute through the DE matching logic.
- */
- bool useRssiThreshold;
- /**
- * 8-bit bitmap which allows the Host to associate this publish
- * with a particular Post-NAN Connectivity attribute
- * which has been sent down in a ConfigureRequest/EnableRequest
- * message. If the DE fails to find a configured Post-NAN
- * connectivity attributes referenced by the bitmap,
- * the DE must return an error code to the Host.
- * If the Publish is configured to use a Post-NAN Connectivity
- * attribute and the Host does not refresh the Post-NAN Connectivity
- * attribute the Publish must be canceled and the Host must be sent
- * a PublishTerminatedIndication message.
- */
- uint8_t connmap;
- /**
- * Set/Enable corresponding bits to disable any indications that follow a publish.
- * BIT0 - Disable publish termination indication.
- * BIT1 - Disable match expired indication.
- * BIT2 - Disable followUp indication received (OTA).
- */
- uint8_t recvIndicationCfg;
};
/**
- * Publish Cancel Msg Structure.
- * The PublishServiceCancelReq Message is used to request the DE to stop publishing
- * the Service Name identified by the Publish Id in the message.
- */
-struct NanPublishCancelRequest {
- uint16_t publishId;
-};
-
-/**
- * NAN Subscribe Structure.
- * The SubscribeServiceReq message is sent to the Discovery Engine
- * whenever the Upper layers would like to listen for a Service Name
+ * Subscribe request: specifies a subscribe discovery operation.
*/
struct NanSubscribeRequest {
/**
- * Id 0 means new subscribe, non zero is existing subscribe.
+ * Common configuration of discovery sessions.
*/
- uint16_t subscribeId;
+ NanDiscoveryCommonConfig baseConfigs;
/**
- * How many seconds to run for. 0 means forever until canceled.
- */
- uint16_t ttl;
- /**
- * Periodicity of OTA Active Subscribe. Units in increments of 500 ms,
- * 0 = attempt every DW.
- */
- uint16_t period;
- /**
- * Flag which specifies how the Subscribe request shall be processed.
- * 0 - PASSIVE , 1- ACTIVE.
+ * The type of the subscribe discovery session.
*/
NanSubscribeType subscribeType;
/**
- * Flag which specifies on Active Subscribes how the Service Response Filter
+ * For Active subscribe discovery sessions specify how the Service Response Filter (SRF)
* attribute is populated.
- * 0 - Bloom Filter, 1 - MAC Addr.
*/
- NanSrfType serviceResponseFilter;
+ NanSrfType srfType;
/**
- * Flag which specifies how the Service Response Filter Include bit is
- * populated.
- * 0=Do not respond if in the Address Set, 1= Respond.
+ * Configure the requested response of the Service Response Filter (SRF).
*/
- NanSrfIncludeType serviceResponseInclude;
+ bool srfRespondIfInAddressSet;
/**
- * Flag which specifies if the Service Response Filter must be used when
- * creating Subscribes.
- * 0=Do not send the Service Response Filter,1= send.
+ * Control whether the Service Response Filter (SRF) is transmitted OTA.
*/
- bool shouldUseServiceResponseFilter;
+ bool shouldUseSrf;
/**
- * Flag which specifies if the Service Specific Info is needed in
- * the Publish message before creating the MatchIndication.
- * 0=Not needed, 1= Required.
+ * Control whether the Service Specific Info (SSI) is needed in the Publish message to trigger
+ * service discovery (a match).
*/
- bool isSsiRequiredForMatchIndication;
- /**
- * Field which specifies how the matching indication to host is controlled.
- * 0 - Match and Indicate Once
- * 1 - Match and Indicate continuous
- * 2 - Match and Indicate never. This means don't indicate the match to the
- * host.
- * 3 - Reserved
- */
- NanMatchAlg subscribeMatchIndicator;
- /**
- * The number of Subscribe Matches which must occur
- * before the Subscribe request is automatically terminated.
- * If this value is 0 this field is not used by the DE.
- */
- uint8_t subscribeCount;
- /**
- * UTF-8 encoded string identifying the service.
- * Max length: |MAX_SERVICE_NAME_LEN|.
- */
- string serviceName;
- /**
- * Sequence of values which further specify the published service beyond the
- * service name.
- * Max length: |MAX_SERVICE_SPECIFIC_INFO_LEN|.
- */
- vec<uint8_t> serviceSpecificInfo;
- /**
- * Ordered sequence of <length, value> pairs used to filter out received
- * publish discovery messages.
- * This can be sent both for a Passive or an Active Subscribe
- * Max length: |MAX_MATCH_FILTER_LEN|.
- */
- vec<uint8_t> rxMatchFilter;
- /**
- * Ordered sequence of <length, value> pairs included in the
- * Discovery Frame when an Active Subscribe is used.
- * Max length: |MAX_MATCH_FILTER_LEN|.
- */
- vec<uint8_t> txMatchFilter;
- /**
- * Flag which specifies that the Publish must use the configured RSSI
- * threshold and the received RSSI in order to filter requests
- * false – ignore the configured RSSI threshold when running a Service
- * Descriptor attribute or Service ID List Attribute through the DE matching logic.
- * true – use the configured RSSI threshold when running a Service
- * Descriptor attribute or Service ID List Attribute through the DE matching logic.
- */
- bool useRssiThreshold;
- /**
- * 8-bit bitmap which allows the Host to associate this Active
- * Subscribe with a particular Post-NAN Connectivity attribute
- * which has been sent down in a ConfigureRequest/EnableRequest
- * message. If the DE fails to find a configured Post-NAN
- * connectivity attributes referenced by the bitmap,
- * the DE must return an error code to the Host.
- * If the Subscribe is configured to use a Post-NAN Connectivity
- * attribute and the Host does not refresh the Post-NAN Connectivity
- * attribute the Subscribe must be canceled and the Host must be sent
- * a SubscribeTerminatedIndication message.
- */
- uint8_t connmap;
+ bool isSsiRequiredForMatch;
/**
* NAN Interface Address, conforming to the format as described in
* 8.2.4.3.2 of IEEE Std. 802.11-2012.
- * Max length: |MAX_SUBSCRIBE_MAX_ADDRESS|.
+ * Max length: |NanCapabilities.maxSubscribeInterfaceAddresses|.
*/
vec<MacAddress> intfAddr;
- /**
- * Set/Enable corresponding bits to disable indications that follow a
- * subscribe.
- * BIT0 - Disable subscribe termination indication.
- * BIT1 - Disable match expired indication.
- * BIT2 - Disable followUp indication received (OTA).
- */
- uint8_t recvIndicationCfg;
};
/**
- * NAN Subscribe Cancel Structure
- * The SubscribeCancelReq Message is used to request the DE to stop looking
- * for the Service Name.
- */
-struct NanSubscribeCancelRequest {
- uint16_t subscribeId;
-};
-
-/**
- * Transmit follow up Structure.
- * The TransmitFollowupReq message is sent to the DE to allow the sending of
- * the Service_Specific_Info to a particular MAC address.
+ * Transmit follow up message request.
*/
struct NanTransmitFollowupRequest {
/**
- * Publish or Subscribe Id of an earlier Publish/Subscribe.
+ * ID of an active publish or subscribe discovery session. Follow-up message is transmitted in the
+ * context of the discovery session.
*/
- uint16_t publishSubscribeId;
+ uint16_t discoverySessionId;
/**
- * This Id is the Requestor Instance that is passed as
- * part of earlier MatchInd/FollowupInd message.
+ * ID of the peer. Obtained as part of an earlier |eventMatch| or |eventFollowupReceived|.
*/
- uint32_t requestorInstanceId;
+ uint32_t peerId;
/**
- * Unicast address.
+ * MAC address of the peer. Obtained as part of an earlier |eventMatch| or
+ * |eventFollowupReceived|.
*/
MacAddress addr;
/**
- * Priority of the request 2=high.
+ * Should the follow-up message be transmitted with a high priority.
*/
- NanTxPriority priority;
+ bool isHighPriority;
/**
- * Flag which the DE uses to decide if received in a DW or a FAW
- * 0= send in a DW, 1=send in FAW.
+ * Should the follow-up message be transmitted in a discovery window (true) or a further
+ * availability window (false).
*/
- NanTransmitWindowType dwOrFaw;
+ bool shouldUseDiscoveryWindow;
/**
- * Sequence of values which further specify the published service beyond
- * the service name.
- * Max length: |MAX_SERVICE_SPECIFIC_INFO_LEN|.
+ * Message as a byte sequence.
+ * Max length: |NanCapabilities.maxServiceSpecificInfoLen|.
*/
- vec<uint8_t> serviceSpecificInfo;
+ vec<uint8_t> message;
/**
- * Set/Enable corresponding bits to disable responses after followUp.
- * BIT0 - Disable followUp response from FW.
+ * Disable |eventTransmitFollowup| - i.e. do not get indication on whether the follow-up
+ * was transmitted and received successfully.
*/
- uint8_t recvIndicationCfg;
+ bool disableFollowupResultIndication;
};
/**
- * Config Structure.
- * The ConfigurationReq message is sent by the Host to the
- * Discovery Engine in order to configure the Discovery Engine during runtime.
+ * Data Path Initiator requesting a data-path.
*/
-struct NanConfigRequest {
- bool validSidBeaconVal;
- uint8_t sidBeacon;
- bool validRssiProximityVal;
- uint8_t rssiProximity;
- bool validMasterPrefVal;
- uint8_t masterPref;
+struct NanInitiateDataPathRequest {
/**
- * 1 byte value which defines the RSSI filter threshold.
- * Any Service Descriptors received above this value
- * that are configured for RSSI filtering must be dropped.
- * The rssi values must be specified without sign.
- * For eg: -70dBm must be specified as 70.
+ * ID of the peer. Obtained as part of an earlier |eventMatch| or |eventFollowupReceived|.
*/
- bool valid5gRssiCloseProximityVal;
- uint8_t rssiCloseProximity5gVal;
+ uint32_t peerId;
/**
- * 2 byte quantity which defines the window size over
- * which the “average RSSI” must be calculated over.
+ * NAN management interface MAC address of the peer.
*/
- bool validRssiWindowSizeVal;
- uint16_t rssiWindowSizeVal;
- /**
- * If set to 1, the Discovery Engine must enclose the Cluster
- * Attribute only sent in Beacons in a Vendor Specific Attribute
- * and transmit in a Service Descriptor Frame.
- */
- bool configClusterAttributeVal;
- /**
- * The periodicity in seconds between full scan’s to find any new
- * clusters available in the area. A Full scan must not be done
- * more than every 10 seconds and must not be done less than every
- * 30 seconds.
- */
- bool validScanParamsVal;
- NanSocialChannelScanParams scanParamsVal;
- /**
- * 1 byte quantity which forces the Random Factor to a particular
- * value for all transmitted Sync/Discovery beacons
- */
- bool validRandomFactorForceVal;
- uint8_t randomFactorForceVal;
- /**
- * 1 byte quantity which forces the HC for all transmitted Sync and
- * Discovery Beacon NO matter the real HC being received over the
- * air.
- */
- bool validHopCountForceVal;
- uint8_t hopCountForceVal;
-};
-
-/**
- * Beacon Sdf Payload Structure
- * The Discovery Engine can be configured to publish vendor specific attributes as part of
- * beacon or service discovery frame transmitted as part of this request..
- */
-struct NanBeaconSdfPayloadRequest {
- /**
- * VendorAttribute must have the Vendor Specific Attribute which the
- * vendor wants to publish as part of Discovery or Sync or Service discovery frame
- */
- NanTransmitVendorSpecificAttribute vsa;
-};
-
-/**
- * Data Path Initiator requesting a data session.
- */
-struct NanDataPathInitiatorRequest {
- /**
- * Unique Instance Id identifying the Responder's service.
- * This is same as publish_id notified on the subscribe side
- * in a publish/subscribe scenario
- */
- uint32_t serviceInstanceId;
+ MacAddress peerDiscMacAddr;
/**
* Config flag for channel request.
*/
@@ -1357,486 +1094,312 @@
*/
WifiChannelInMhz channel;
/**
- * Discovery MAC addr of the publisher/peer.
+ * NAN data interface name on which this data-path session is to be started.
+ * This must be an interface created using |createDataInterfaceRequest|.
*/
- MacAddress peerDiscMacAddr;
+ string ifaceName;
/**
- * Interface name on which this NDP session is to be started.
- * This must be the same interface name provided during interface
- * create.
+ * Specifies whether or not security is required for the data-path being created.
*/
- string ndpIface;
+ bool securityRequired;
/**
- * Initiator/Responder Security/QoS configuration.
+ * Arbitrary token transmitted as part of the data-path negotiation (not encrypted).
+ * Max length: |NanCapabilities.maxAppInfoLen|.
*/
- NanDataPathCfg ndpCfg;
+ vec<uint8_t> appInfo;
/**
- * App/Service information of the Initiator.
+ * Cipher types supported in data-paths constructed in the context of this discovery session. The
+ * |NanCipherSuiteType| bit fields are used to set this value.
*/
- NanDataPathAppInfo appInfo;
+ uint32_t supportedCipherTypes;
+ /**
+ * PMK of the data-path being requested (if |securityRequired| is true).
+ * Max length: 32
+ */
+ vec<uint8_t> pmk;
};
/**
- * Data struct Nanto initiate a data response on the responder side
- * for an indication received with a data request.
+ * Response to a data-path request from a peer.
*/
-struct NanDataPathIndicationResponse {
+struct NanRespondToDataPathIndicationRequest {
/**
- * Unique token Id generated on the initiator/responder
- * side used for a NDP session between two NAN devices.
+ * Accept (true) or reject (false) the request.
*/
- NanDataPathId ndpInstanceId;
+ bool acceptRequest;
/**
- * Interface name on which this NDP session is to be started.
- * This must be the same interface name provided during interface
- * create.
+ * ID of the data-path (NDP) for which we're responding - obtained as part of the request in
+ * |NanDataPathRequestInd|.
*/
- string ndpIface;
+ uint32_t ndpInstanceId;
/**
- * Initiator/Responder Security/QoS configuration.
+ * NAN data interface name on which this data-path session is to be started.
+ * This must be an interface created using |createDataInterfaceRequest|.
*/
- NanDataPathCfg ndpCfg;
+ string ifaceName;
/**
- * App/Service information of the responder.
+ * Specifies whether or not security is required for the data-path being created.
*/
- NanDataPathAppInfo appInfo;
+ bool securityRequired;
/**
- * Response Code indicating ACCEPT/REJECT/DEFER
+ * Arbitrary token transmitted as part of the data-path negotiation (not encrypted).
+ * Max length: |NanCapabilities.maxAppInfoLen|.
*/
- NanDataPathResponseCode rspCode;
+ vec<uint8_t> appInfo;
+ /**
+ * Cipher types supported in data-paths constructed in the context of this discovery session. The
+ * |NanCipherSuiteType| bit fields are used to set this value.
+ */
+ uint32_t supportedCipherTypes;
+ /**
+ * PMK of the data-path being requested (if |securityRequired| is true).
+ * Max length: 32
+ */
+ vec<uint8_t> pmk;
};
/**
- * NDP termination info.
+ * Specifies vendor-specific information fields to be included in NAN management frames.
*/
-struct NanDataPathEndRequest {
- uint8_t numNdpInstances;
+struct NanBeaconSdfPayloadRequest {
/**
- * Unique token Id generated on the initiator/responder side
- * used for a NDP session between two NAN devices
+ * If true information is transmitted in next 16 DWs, else only in the next (1) DW.
*/
- vec<NanDataPathId> ndpInstanceIds;
-};
-
-/**
- * Definition of various ResponseType
- */
-enum NanResponseType : uint32_t {
- ENABLED = 0,
- DISABLED = 1,
- PUBLISH = 2,
- PUBLISH_CANCEL = 3,
- TRANSMIT_FOLLOWUP = 4,
- SUBSCRIBE = 5,
- SUBSCRIBE_CANCEL = 6,
- CONFIG = 8,
- ERROR = 10,
- BEACON_SDF_PAYLOAD = 11,
- GET_CAPABILITIES = 12,
- DP_INTERFACE_CREATE = 13,
- DP_INTERFACE_DELETE = 14,
- DP_INITIATOR_RESPONSE = 15,
- DP_RESPONDER_RESPONSE = 16,
- DP_END = 17,
-};
-
-/**
- * Various NAN Protocol Response code
- */
-enum NanStatusType : uint32_t {
- /* NAN Protocol Response Codes */
- SUCCESS = 0,
- TIMEOUT = 1,
- DE_FAILURE = 2,
- INVALID_MSG_VERSION = 3,
- INVALID_MSG_LEN = 4,
- INVALID_MSG_ID = 5,
- INVALID_HANDLE = 6,
- NO_SPACE_AVAILABLE = 7,
- INVALID_PUBLISH_TYPE = 8,
- INVALID_TX_TYPE = 9,
- INVALID_MATCH_ALGORITHM = 10,
- DISABLE_IN_PROGRESS = 11,
- INVALID_TLV_LEN = 12,
- INVALID_TLV_TYPE = 13,
- MISSING_TLV_TYPE = 14,
- INVALID_TOTAL_TLVS_LEN = 15,
- INVALID_MATCH_HANDLE = 16,
- INVALID_TLV_VALUE = 17,
- INVALID_TX_PRIORITY = 18,
- INVALID_CONNECTION_MAP = 19,
- NOT_ALLOWED = 22,
- NO_OTA_ACK = 23,
- TX_FAIL = 24,
- ALREADY_ENABLED = 25,
- FOLLOWUP_QUEUE_FULL = 26,
-
- /* NAN Configuration Response codes */
- INVALID_RSSI_CLOSE_VALUE = 4096,
- INVALID_RSSI_MIDDLE_VALUE = 4097,
- INVALID_HOP_COUNT_LIMIT = 4098,
- INVALID_MASTER_PREFERENCE_VALUE = 4099,
- INVALID_LOW_CLUSTER_ID_VALUE = 4100,
- INVALID_HIGH_CLUSTER_ID_VALUE = 4101,
- INVALID_BACKGROUND_SCAN_PERIOD = 4102,
- INVALID_RSSI_PROXIMITY_VALUE = 4103,
- INVALID_SCAN_CHANNEL = 4104,
- INVALID_POST_CONNECTIVITY_CAPABILITIES_BITMAP = 4105,
- INVALID_FURTHER_AVAILABILITY_MAP_NUMCHAN_VALUE = 4106,
- INVALID_FURTHER_AVAILABILITY_MAP_DURATION_VALUE = 4107,
- INVALID_FURTHER_AVAILABILITY_MAP_CLASS_VALUE = 4108,
- INVALID_FURTHER_AVAILABILITY_MAP_CHANNEL_VALUE = 4109,
- INVALID_FURTHER_AVAILABILITY_MAP_AVAILABILITY_INTERVAL_BITMAP_VALUE = 4110,
- INVALID_FURTHER_AVAILABILITY_MAP_MAP_ID = 4111,
- INVALID_POST_DISCOVERY_CONN_TYPE_VALUE = 4112,
- INVALID_POST_DISCOVERY_DEVICE_ROLE_VALUE = 4113,
- INVALID_POST_DISCOVERY_DURATION_VALUE = 4114,
- INVALID_POST_DISCOVERY_BITMAP_VALUE = 4115,
- MISSING_FUTHER_AVAILABILITY_MAP = 4116,
- INVALID_BAND_CONFIG_FLAGS = 4117,
- INVALID_RANDOM_FACTOR_UPDATE_TIME_VALUE = 4118,
- INVALID_ONGOING_SCAN_PERIOD = 4119,
- INVALID_DW_INTERVAL_VALUE = 4120,
- INVALID_DB_INTERVAL_VALUE = 4121,
-
- /* 4122-8191 RESERVED */
- TERMINATED_REASON_INVALID = 8192,
- TERMINATED_REASON_TIMEOUT = 8193,
- TERMINATED_REASON_USER_REQUEST = 8194,
- TERMINATED_REASON_FAILURE = 8195,
- TERMINATED_REASON_COUNT_REACHED = 8196,
- TERMINATED_REASON_DE_SHUTDOWN = 8197,
- TERMINATED_REASON_DISABLE_IN_PROGRESS = 8198,
- TERMINATED_REASON_POST_DISC_ATTR_EXPIRED = 8199,
- TERMINATED_REASON_POST_DISC_LEN_EXCEEDED = 8200,
- TERMINATED_REASON_FURTHER_AVAIL_MAP_EMPTY = 8201,
-
- /* 9000-9500 NDP Status type */
- NDP_UNSUPPORTED_CONCURRENCY = 9000,
- NDP_DATA_IFACE_CREATE_FAILED = 9001,
- NDP_DATA_IFACE_DELETE_FAILED = 9002,
- NDP_DATA_INITIATOR_REQUEST_FAILED = 9003,
- NDP_DATA_RESPONDER_REQUEST_FAILED = 9004,
- NDP_INVALID_SERVICE_INSTANCE_ID = 9005,
- NDP_INVALID_NDP_INSTANCE_ID = 9006,
- NDP_INVALID_RESPONSE_CODE = 9007,
- NDP_INVALID_APP_INFO_LEN = 9008,
-
- /* OTA failures and timeouts during negotiation */
- NDP_MGMT_FRAME_REQUEST_FAILED = 9009,
- NDP_MGMT_FRAME_RESPONSE_FAILED = 9010,
- NDP_MGMT_FRAME_CONFIRM_FAILED = 9011,
- NDP_END_FAILED = 9012,
- NDP_MGMT_FRAME_END_REQUEST_FAILED = 9013,
-
- /* 9500 onwards vendor specific error codes */
- NDP_VENDOR_SPECIFIC_ERROR = 9500,
-};
-
-/**
- * NAN Response message header
- */
-struct NanResponseMsgHeader {
+ bool transmitInNext16dws;
/**
- * Contains the result code.
+ * Specify the management frames in which the vendor-specific information is included.
*/
- NanStatusType status;
+ bool transmitInDiscoveryBeacon;
+ bool transmitInSyncBeacon;
+ bool transmitInServiceDiscoveryFrame;
/**
- * For error returns the value is returned which was in error.
- * TODO(b/32207606): Find all the error values.
- */
- uint32_t value;
- /**
- * ResponseType Definitions.
- */
- NanResponseType responseType;
-};
-
-/**
- * Publish Response Message structure.
- */
-struct NanPublishResponse {
- uint16_t publishId;
-};
-
-/**
- * NAN Publish Response Messages.
- */
-struct NanPublishResponseMsg {
- NanResponseMsgHeader header;
- NanPublishResponse body;
-};
-
-
-/**
- * Subscribe Response Message structure.
- */
-struct NanSubscribeResponse {
- uint16_t subscribeId;
-};
-
-/**
- * NAN Subscribe Response Messages.
- */
-struct NanSubscribeResponseMsg {
- NanResponseMsgHeader header;
- NanSubscribeResponse body;
-};
-
-/**
- * Response returned for Initiators Data request.
- */
-struct NanDataPathResponse {
- /**
- * Unique token Id generated on the initiator
- * side used for a NDP session between two NAN devices
- */
- NanDataPathId ndpInstanceId;
-};
-
-/**
- * NAN Data Path Response Messages.
- */
-struct NanDataPathResponseMsg {
- NanResponseMsgHeader header;
- NanDataPathResponse body;
-};
-
-/**
- * NDP Capabilites response.
- */
-struct NanCapabilitiesResponse {
- uint32_t maxConcurrentClusters;
- uint32_t maxPublishes;
- uint32_t maxSubscribes;
- uint32_t maxServiceNameLen;
- uint32_t maxMatchFilterLen;
- uint32_t maxTotalMatchFilterLen;
- uint32_t maxServiceSpecificInfoLen;
- uint32_t maxVsaDataLen;
- uint32_t maxMeshDataLen;
- uint32_t maxNdiInterfaces;
- uint32_t maxNdpSessions;
- uint32_t maxAppInfoLen;
- uint32_t maxQueuedTransmitFollowupMsgs;
-};
-
-/**
- * NAN Capabilities Response Messages.
- */
-struct NanCapabilitiesResponseMsg {
- NanResponseMsgHeader header;
- NanCapabilitiesResponse body;
-};
-
-/**
- * Publish Terminated Message structure.
- * The PublishTerminatedInd message is sent by the DE whenever a Publish
- * terminates from a user-specified timeout or a unrecoverable error in the DE.
- */
-struct NanPublishTerminatedInd {
- /**
- * Id returned during the initial Publish.
- */
- uint16_t publishId;
- NanStatusType reason;
-};
-
-/**
- * Match Indication Message structure.
- * The MatchInd message is sent once per responding MAC address whenever
- * the Discovery Engine detects a match for a previous SubscribeServiceReq
- * or PublishServiceReq.
- */
-struct NanMatchInd {
- /**
- * Publish or Subscribe Id of an earlier Publish/Subscribe.
- */
- uint16_t publishSubscribeId;
- /**
- * A 32 bit Requestor Instance Id which is sent to the Application.
- * This Id must be sent in any subsequent UnmatchInd/FollowupInd
- * messages.
- */
- uint32_t requestorInstanceId;
- MacAddress addr;
- /**
- * Sequence of octets which were received in a Discovery Frame matching the
- * Subscribe Request.
- * Max length: |MAX_SERVICE_SPECIFIC_INFO_LEN|.
- */
- vec<uint8_t> serviceSpecificInfo;
- /**
- * Ordered sequence of <length, value> pairs received in the Discovery Frame
- * matching the Subscribe Request.
- * Max length: |MAX_MATCH_FILTER_LEN|.
- */
- vec<uint8_t> sdfMatchFilter;
- /**
- * Flag to indicate if the Match occurred in a Beacon Frame or in a
- * Service Discovery Frame.
- */
- bool matchOccuredFlag;
- /**
- * Flag to indicate FW is out of resource and that it can no longer
- * track this Service Name. The Host still need to send the received
- * Match_Handle but duplicate MatchInd messages may be received on
- * this Handle until the resource frees up.
- */
- bool outOfResourceFlag;
- /**
- * If RSSI filtering was configured in SubscribeRequest then this
- * field must contain the received RSSI value. 0 if not.
- * All rssi values must be specified without sign.
- * For eg: -70dBm must be specified as 70.
- */
- uint8_t rssiValue;
-};
-
-/**
- * MatchExpired Indication Message structure.
- * The MatchExpiredInd message is sent whenever the Discovery Engine detects that
- * a previously Matched Service has been gone for too long. If the previous
- * MatchInd message for this Publish/Subscribe Id had the out_of_resource_flag
- * set then this message must not be received
- */
-struct NanMatchExpiredInd {
- /**
- * Publish or Subscribe Id of an earlier Publish/Subscribe.
- */
- uint16_t publishSubscribeId;
- /**
- * 32 bit value sent by the DE in a previous
- * MatchInd/FollowupInd to the application.
- */
- uint32_t requestorInstanceId;
-};
-
-/**
- * Subscribe Terminated Message structure.
- * The SubscribeTerminatedInd message is sent by the DE whenever a
- * Subscribe terminates from a user-specified timeout or a unrecoverable error in the DE.
- */
-struct NanSubscribeTerminatedInd {
- /**
- * Id returned during initial Subscribe.
- */
- uint16_t subscribeId;
- NanStatusType reason;
-};
-
-/**
- * Followup Indication Message structure.
- * The FollowupInd message is sent by the DE to the Host whenever it receives a
- * Followup message from another peer.
- */
-struct NanFollowupInd {
- /**
- * Publish or Subscribe Id of an earlier Publish/Subscribe.
- */
- uint16_t publishSubscribeId;
- /**
- * A 32 bit Requestor instance Id which is sent to the Application.
- * This Id must be used in subsequent UnmatchInd/FollowupInd messages.
- */
- uint32_t requestorInstanceId;
- MacAddress addr;
- /**
- * Flag which the DE uses to decide if received in a DW or a FAW
- * 0= send in a DW, 1=send in FAW.
- */
- NanTransmitWindowType dwOrFaw;
- /**
- * Sequence of values which further specify the published service beyond
- * the service name
- * Max length: |MAX_SERVICE_SPECIFIC_INFO_LEN|.
- */
- vec<uint8_t> serviceSpecificInfo;
-};
-
-/**
- * NAN Protocol Event ID Codes.
- */
-enum NanDiscEngEventType : uint32_t {
- /**
- * Event data notifying the Mac address of the Discovery engine.
- * which is reported as one of the Discovery engine event
- */
- DISC_MAC_ADDR = 0,
- /**
- * Event data notifying the Cluster address of the cluster
- * which is reported as one of the Discovery engine events.
- */
- STARTED_CLUSTER,
- JOINED_CLUSTER,
-};
-
-/**
- * Discovery Engine Event Indication Message structure.
- * The Discovery Engine can inform the Host when significant events occur
- * The data following the EventId is dependent upon the EventId type.
- * In other words, each new event defined must carry a different
- * structure of information back to the host.
- */
-struct NanDiscEngEventInd {
- /**
- * NAN Protocol Event Codes.
- */
- NanDiscEngEventType eventType;
- /**
- * Mac Address associated with the corresponding event.
- */
- MacAddress addr;
-};
-
-/**
- * NAN Disabled Indication Message structure.
- * The DisableInd message indicates to the upper layers that the Discovery
- * Engine has flushed all state and has been shutdown. When this message is
- * received the DE is guaranteed to have left the NAN cluster it was part of
- * and must have terminated any in progress Publishes or Subscribes.
- */
-struct NanDisabledInd {
- NanStatusType reason;
-};
-
-/**
- * Mask to determine on which frames attribute was received.
- */
-enum NanVsaRxFrameMask: uint32_t {
- DISCOVERY_BEACON_MASK = 1 << 0,
- SYNC_BEACON_MASK = 1 << 1,
- SERVICE_DISCOVERY_MASK = 1 << 2
-};
-
-struct NanReceiveVendorSpecificAttribute {
- /**
- * Frames on which this vendor specific attribute
- * was received. Mask |NanVsaRxFrameMask| defined above.
- */
- uint8_t vsaReceivedOn;
- /**
- * Organizationally Unique Identifier.
+ * Organizationally Unique Identifier (OUI).
*/
uint32_t vendorOui;
/**
- * Vendor specific attribute.
- * Max length: |MAX_VSA_DATA_LEN|.
+ * Vendor specific attribute to be transmitted.
+ * Max length: |NanCapabilities.maxVsaDataLen|.
*/
vec<uint8_t> vsa;
};
/**
- * NAN Beacon SDF Payload Received Message structure.
- * Discovery engine sends the details of received Beacon or
- * Service Discovery Frames as part of this structure.
+ * NDP Capabilities response.
*/
-struct NanBeaconSdfPayloadReceive {
+struct NanCapabilities {
/**
- * Frame data.
- * Max length: |MAX_FRAME_DATA_LEN|.
+ * Maximum number of clusters which the device can join concurrently.
*/
- vec<uint8_t> frameData;
+ uint32_t maxConcurrentClusters;
+ /**
+ * Maximum number of concurrent publish discovery sessions.
+ */
+ uint32_t maxPublishes;
+ /**
+ * Maximum number of concurrent subscribe discovery sessions.
+ */
+ uint32_t maxSubscribes;
+ /**
+ * Maximum length (in bytes) of service name.
+ */
+ uint32_t maxServiceNameLen;
+ /**
+ * Maximum length (in bytes) of individual match filters.
+ */
+ uint32_t maxMatchFilterLen;
+ /**
+ * Maximum length (in bytes) of aggregate match filters.
+ */
+ uint32_t maxTotalMatchFilterLen;
+ /**
+ * Maximum length (in bytes) of the service specific info length or message length in follow-ups.
+ */
+ uint32_t maxServiceSpecificInfoLen;
+ /**
+ * Maximum length (in bytes) of vendor-specific (VSA) data.
+ */
+ uint32_t maxVsaDataLen;
+ /**
+ * Maximum number of data interfaces which can be created concurrently on the device.
+ */
+ uint32_t maxNdiInterfaces;
+ /**
+ * Maximum number of data paths which can be created concurrently on each individual
+ * data interface.
+ */
+ uint32_t maxNdpSessions;
+ /**
+ * Maximum length (in bytes) of application info field (used in data-path negotiations).
+ */
+ uint32_t maxAppInfoLen;
+ /**
+ * Maximum number of transmitted followup messages which can be queued by the firmware.
+ */
+ uint32_t maxQueuedTransmitFollowupMsgs;
+ /**
+ * Maximum number MAC interface addresses which can be specified to a subscribe discovery session.
+ */
+ uint32_t maxSubscribeInterfaceAddresses; // TODO: (hard-code to 42) get from HAL
+ /**
+ * The set of supported Cipher suites. The |NanCipherSuiteType| bit fields are used.
+ */
+ uint32_t supportedCipherSuites;
+};
+
+/**
+ * Match indication structure
+ */
+struct NanMatchInd {
+ /**
+ * Publish or subscribe discovery session ID of an existing discovery session.
+ */
+ uint16_t discoverySessionId;
+ /**
+ * A unique ID of the peer. Can be subsequently used in |transmitFollowupRequest|.
+ */
+ uint32_t peerId;
+ /**
+ * The NAN Discovery (management) MAC address of the peer.
+ */
+ MacAddress addr;
+ /**
+ * The arbitrary information contained in the |serviceSpecificInfo| of the peer's discovery
+ * session.
+ * Max length: |NanCapabilities.maxServiceSpecificInfoLen|.
+ */
+ vec<uint8_t> serviceSpecificInfo;
+ /**
+ * Ordered sequence of <length, value> pairs (length uses 1 byte) of the peer's discovery session
+ * match filter.
+ * Max length: |NanCapabilities.maxMatchFilterLen|.
+ */
+ vec<uint8_t> matchFilter;
+ /**
+ * Indicates the type of discovery: Beacon if true, Service Discovery Frames (SDF) if false.
+ */
+ bool matchOccuredInBeaconFlag;
+ /**
+ * Flag to indicate FW is out of resource and that it can no longer
+ * track this Service Name.
+ */
+ bool outOfResourceFlag;
+ /**
+ * If RSSI filtering was configured in discovery session setup then this
+ * field must contain the received RSSI value. It will contain 0 if RSSI filtering was not
+ * configured.
+ * RSSI values are returned without sign, e.g. -70dBm will be returned as 70.
+ */
+ uint8_t rssiValue;
+ /**
+ * Cipher types supported by the peer for data-paths constructed in the context of this discovery
+ * session. The |NanCipherSuiteType| bit fields are used to set this value.
+ */
+ uint32_t peerSupportedCipherTypes;
+ /**
+ * Indicates whether or not the peer requires security enabled in any data-path (NDP) constructed
+ * in the context of this discovery session.
+ */
+ bool peerRequiresSecurityEnabledInNdp;
+ /**
+ * Indicates whether or not the peer requires (and hence allows) ranging in this discovery
+ * session.
+ * Note that ranging is only performed if all other match criteria with the peer are met.
+ */
+ bool peerRequiresRanging;
+ /**
+ * Ranging indication supersedes the NanMatchAlg specification.
+ * Ex: If NanMatchAlg is MATCH_ONCE, but ranging indications is continuous then continuous
+ * match notifications will be received (with ranging information).
+ * Ranging indication data is provided if Ranging required is enabled in the discovery
+ * specification and:
+ * 1) continuous ranging specified.
+ * 2) ingress/egress specified and:
+ * - notify once for ingress >= ingress_distance and egress <= egress_distance,
+ * - same for ingress_egress_both
+ * If the Awake DW intervals are larger than the ranging intervals then priority is given to the
+ * device DW intervals.
+ *
+ * If ranging was required and executed contains the distance to the peer in CM. The
+ * |rangingIndicationType| field specifies the event which triggered ranging.
+ */
+ uint32_t rangingMeasurementInCm;
+ /**
+ * The ranging event(s) which triggered the ranging. Uses bit-fields from |NanRangingIndication|.
+ * E.g. can indicate that continuous ranging is required, or else that an ingress event occurred.
+ */
+ uint32_t rangingIndicationType;
+};
+
+/**
+ * Followup message received from peer indication structure.
+ */
+struct NanFollowupReceivedInd {
+ /**
+ * Discovery session (publish or subscribe) ID of a previously created discovery session. The
+ * message is received in the context of this discovery session.
+ */
+ uint16_t discoverySessionId;
+ /**
+ * A unique ID of the peer. Can be subsequently used in |transmitFollowupRequest|.
+ */
+ uint32_t peerId;
+ /**
+ * The NAN Discovery (management) MAC address of the peer.
+ */
+ MacAddress addr;
+ /**
+ * Indicates whether received in a further availability window (FAW) if true, or in a discovery
+ * window (DW) if false.
+ */
+ bool receivedInFaw;
+ /**
+ * Received message as a byte sequence.
+ * Max length: |NanCapabilities.maxServiceSpecificInfoLen|.
+ */
+ vec<uint8_t> message;
+};
+
+/**
+ * Event types for a cluster event indication.
+ */
+enum NanClusterEventType : uint32_t {
+ /**
+ * Management/discovery interface MAC address has changed (e.g. due to randomization or at
+ * startup).
+ */
+ DISCOVERY_MAC_ADDRESS_CHANGED = 0,
+ /**
+ * A new cluster has been formed by this device.
+ */
+ STARTED_CLUSTER,
+ /**
+ * This device has joined an existing cluster.
+ */
+ JOINED_CLUSTER,
+};
+
+/**
+ * Cluster event indication structure: triggered on events impacting how this device is
+ * visible to peers - cluster forming, joining a new cluster, or changing of the MAC address.
+ */
+struct NanClusterEventInd {
+ /**
+ * Event type causing the cluster event indication to be triggered.
+ */
+ NanClusterEventType eventType;
+ /**
+ * MAC Address associated with the corresponding event.
+ */
+ MacAddress addr;
+};
+
+/**
+ * Mask to determine on which frames the vendor-specific attribute (VSA) was received on.
+ */
+enum NanVsaRxFrameMask: uint32_t {
+ DISCOVERY_BEACON_MASK = 1 << 0,
+ SYNC_BEACON_MASK = 1 << 1,
+ SERVICE_DISCOVERY_MASK = 1 << 2
};
/**
@@ -1851,98 +1414,91 @@
*/
MacAddress addr;
/**
- * NAN Receive Vendor Specific Attribute.
+ * A flag indicating whether a vendor-specific attribute (VSA) has been received.
*/
bool isVsaReceived;
- NanReceiveVendorSpecificAttribute vsa;
/**
- * NAN Beacon or SDF Payload Received.
+ * Frames on which this vendor specific attribute was received.
+ * Mask |NanVsaRxFrameMask| defined above.
+ */
+ uint8_t vsaReceivedOnFrames;
+ /**
+ * Organizationally Unique Identifier (OUI) of the vendor-specific attribute.
+ */
+ uint32_t vsaVendorOui;
+ /**
+ * Contents of the vendor specific attribute.
+ * Max length: |NanCapabilities.maxVsaDataLen|.
+ */
+ vec<uint8_t> vsa;
+ /**
+ * A flag indicating whether a NAN beacon or SDF payload has been received.
*/
bool isBeaconSdfPayloadReceived;
- NanBeaconSdfPayloadReceive data;
+ /**
+ * The contents of the NAN beacon or SDF payload.
+ */
+ vec<uint8_t> beaconSdfPayloadData;
};
/**
* NAN Data path request Indication Message structure.
- * Event indication received on the responder side when a Nan Data request or
- * NDP session is initiated on the Initiator side.
+ * Event indication received by an intended Responder when a Nan Data request initiated by an
+ * Initiator.
*/
struct NanDataPathRequestInd {
/**
- * Unique Instance Id corresponding to a service/session.
- * This is similar to the publish_id generated on the
- * publisher side.
+ * ID of an active publish or subscribe discovery session - the data-path request is in the
+ * context of this discovery session.
*/
- uint16_t serviceInstanceId;
+ uint16_t discoverySessionId;
/**
- * Discovery MAC addr of the peer/initiator.
+ * MAC address of the Initiator peer. This is the MAC address of the peer's management/discovery
+ * NAN interface.
*/
MacAddress peerDiscMacAddr;
/**
- * Unique token Id generated on the initiator/responder side
- * used for a NDP session between two NAN devices.
+ * ID of the data-path - used to identify the data-path in further negotiation/APIs.
*/
- NanDataPathId ndpInstanceId;
+ uint32_t ndpInstanceId;
/**
- * Initiator/Responder Security/QoS configuration.
+ * Specifies whether or not security is required by the peer for the data-path being created.
*/
- NanDataPathCfg ndpCfg;
+ bool securityRequired;
/**
- * App/Service information of the initiator.
+ * Arbitrary token transmitted by the peer as part of the data-path negotiation (not encrypted).
+ * Max length: |NanCapabilities.maxAppInfoLen|.
*/
- NanDataPathAppInfo appInfo;
+ vec<uint8_t> appInfo;
};
/**
- * NAN Data path confirmation Indication Message structure.
- * Event indication of data confirm is received on both
- * initiator and responder side confirming a NDP session.
+ * NAN Data path confirmation Indication structure.
+ * Event indication is received on both initiator and responder side when negotiation for a
+ * data-path finish: on success or failure.
*/
struct NanDataPathConfirmInd {
/**
- * Unique token Id generated on the initiator/responder side
- * used for a NDP session between two NAN devices
+ * ID of the data-path.
*/
- NanDataPathId ndpInstanceId;
+ uint32_t ndpInstanceId;
/**
- * NDI mac address of the peer.
- * (required to derive target ipv6 address)
+ * Indicates whether the data-path setup succeeded (true) or failed (false).
+ */
+ bool dataPathSetupSuccess;
+ /**
+ * MAC address of the peer's data-interface (not it's management/discovery interface).
*/
MacAddress peerNdiMacAddr;
/**
- * App/Service information of Initiator/Responder.
+ * Arbitrary token transmitted by the peer as part of the data-path negotiation (not encrypted).
+ * Max length: |NanCapabilities.maxAppInfoLen|.
*/
- NanDataPathAppInfo appInfo;
+ vec<uint8_t> appInfo;
/**
- * Response code indicating ACCEPT/REJECT/DEFER.
+ * Failure reason if |dataPathSetupSuccess| is false.
*/
- NanDataPathResponseCode rspCode;
- /**
- * Reason code indicating the cause for REJECT.
- */
- NanStatusType reasonCode;
-};
-
-/**
- * NAN Data path end Indication Message structure.
- * Event indication received on the initiator/responder side terminating
- * a NDP session
- */
-struct NanDataPathEndInd {
- /**
- * Unique token Id generated on the initiator/responder side
- * used for a NDP session between two NAN devices
- */
- vec<NanDataPathId> ndpInstanceIds;
-};
-
-/**
- * NAN Transmit followup Indication Message structure.
- * Event Indication notifying the transmit followup in progress.
- */
-struct NanTransmitFollowupInd {
- CommandId cmdId;
- NanStatusType reason;
+ WifiNanStatus status;
};
/**