From b7ec0384dad91a8fd803e3cc63b580aa510e5707 Mon Sep 17 00:00:00 2001 From: Nate Jiang Date: Tue, 28 Nov 2023 15:16:30 -0800 Subject: [PATCH] Add discovery session in the bootstrapping request and respond Bug: 292462023 Test: atest SingleDeviceTest Change-Id: I8ec57f5f2af14ccb546c452b82c62652c43f0d4e --- .../hardware/wifi/NanBootstrappingRequest.aidl | 2 ++ .../hardware/wifi/NanBootstrappingResponse.aidl | 1 + .../hardware/wifi/NanBootstrappingRequest.aidl | 12 ++++++++++++ .../hardware/wifi/NanBootstrappingResponse.aidl | 7 +++++++ wifi/aidl/default/aidl_struct_util.cpp | 3 +++ 5 files changed, 25 insertions(+) diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingRequest.aidl index dd0a5ede2f..b5f78b06b5 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingRequest.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingRequest.aidl @@ -38,4 +38,6 @@ parcelable NanBootstrappingRequest { byte[6] peerDiscMacAddr; android.hardware.wifi.NanBootstrappingMethod requestBootstrappingMethod; byte[] cookie; + boolean isComeback; + byte discoverySessionId; } diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingResponse.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingResponse.aidl index 6dd9b2603a..7b17493d88 100644 --- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingResponse.aidl +++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingResponse.aidl @@ -36,4 +36,5 @@ package android.hardware.wifi; parcelable NanBootstrappingResponse { int bootstrappingInstanceId; boolean acceptRequest; + byte discoverySessionId; } diff --git a/wifi/aidl/android/hardware/wifi/NanBootstrappingRequest.aidl b/wifi/aidl/android/hardware/wifi/NanBootstrappingRequest.aidl index 4b74cd9e20..e23bd23607 100644 --- a/wifi/aidl/android/hardware/wifi/NanBootstrappingRequest.aidl +++ b/wifi/aidl/android/hardware/wifi/NanBootstrappingRequest.aidl @@ -45,4 +45,16 @@ parcelable NanBootstrappingRequest { * Cookie received from previous |NanBootstrappingConfirmInd| for comeback request. */ byte[] cookie; + + /** + * Identify if it is a request for come back response + */ + boolean isComeback; + + /** + * ID of an active publish or subscribe discovery session. Follow-up message is transmitted in + * the context of the discovery session. NAN Spec: Service Descriptor Attribute (SDA) / Instance + * ID + */ + byte discoverySessionId; } diff --git a/wifi/aidl/android/hardware/wifi/NanBootstrappingResponse.aidl b/wifi/aidl/android/hardware/wifi/NanBootstrappingResponse.aidl index dbe892316e..a2ee0e60e1 100644 --- a/wifi/aidl/android/hardware/wifi/NanBootstrappingResponse.aidl +++ b/wifi/aidl/android/hardware/wifi/NanBootstrappingResponse.aidl @@ -29,4 +29,11 @@ parcelable NanBootstrappingResponse { * True if accept the request, false otherwise. */ boolean acceptRequest; + + /** + * ID of an active publish or subscribe discovery session. Follow-up message is transmitted in + * the context of the discovery session. NAN Spec: Service Descriptor Attribute (SDA) / Instance + * ID + */ + byte discoverySessionId; } diff --git a/wifi/aidl/default/aidl_struct_util.cpp b/wifi/aidl/default/aidl_struct_util.cpp index 99420bd2bc..a5b40909e6 100644 --- a/wifi/aidl/default/aidl_struct_util.cpp +++ b/wifi/aidl/default/aidl_struct_util.cpp @@ -3202,6 +3202,8 @@ bool convertAidlNanBootstrappingInitiatorRequestToLegacy( legacy_request->cookie_length = aidl_request.cookie.size(); memcpy(legacy_request->cookie, aidl_request.cookie.data(), legacy_request->cookie_length); + legacy_request->publish_subscribe_id = static_cast(aidl_request.discoverySessionId); + legacy_request->comeback = aidl_request.isComeback ? 0x1 : 0x0; return true; } @@ -3219,6 +3221,7 @@ bool convertAidlNanBootstrappingIndicationResponseToLegacy( legacy_request->service_instance_id = aidl_request.bootstrappingInstanceId; legacy_request->rsp_code = aidl_request.acceptRequest ? NAN_BOOTSTRAPPING_REQUEST_ACCEPT : NAN_BOOTSTRAPPING_REQUEST_REJECT; + legacy_request->publish_subscribe_id = static_cast(aidl_request.discoverySessionId); return true; }