Loading wifi/1.2/Android.bp +4 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ hidl_interface { "IWifi.hal", "IWifiChip.hal", "IWifiNanIface.hal", "IWifiNanIfaceEventCallback.hal", ], interfaces: [ "android.hardware.wifi@1.0", Loading @@ -19,6 +20,9 @@ hidl_interface { ], types: [ "NanConfigRequestSupplemental", "NanDataPathChannelInfo", "NanDataPathConfirmInd", "NanDataPathScheduleUpdateInd", ], gen_java: true, } Loading wifi/1.2/IWifiNanIface.hal +19 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import @1.0::IWifiNanIface; import @1.0::NanConfigRequest; import @1.0::NanEnableRequest; import @1.0::WifiStatus; import IWifiNanIfaceEventCallback; /** * Interface used to represent a single NAN (Neighbour Aware Network) iface. Loading @@ -29,6 +30,24 @@ import @1.0::WifiStatus; * Networking (NAN) Technical Specification". */ interface IWifiNanIface extends @1.0::IWifiNanIface { /** * Requests notifications of significant events on this iface. Multiple calls * to this must register multiple callbacks each of which must receive all * events. * * Note: supersedes the @1.0::IWifiNanIface.registerEventCallback() method which is deprecated * as of HAL version 1.2. * * @param callback An instance of the |IWifiNanIfaceEventCallback| HIDL interface * object. * @return status WifiStatus of the operation. * Possible status codes: * |WifiStatusCode.SUCCESS|, * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID| */ registerEventCallback_1_2(IWifiNanIfaceEventCallback callback) 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 Loading wifi/1.2/IWifiNanIfaceEventCallback.hal 0 → 100644 +46 −0 Original line number Diff line number Diff line /* * Copyright 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.hardware.wifi@1.2; import @1.0::IWifiNanIfaceEventCallback; /** * NAN Response and Asynchronous Event Callbacks. * * References to "NAN Spec" are to the Wi-Fi Alliance "Wi-Fi Neighbor Awareness * Networking (NAN) Technical Specification". */ interface IWifiNanIfaceEventCallback extends @1.0::IWifiNanIfaceEventCallback { /** * Asynchronous callback indicating a data-path (NDP) setup has been completed: received by * both Initiator and Responder. * * Note: supersedes the @1.0::IWifiNanIfaceEventCallback.eventDataPathConfirm() method which is * deprecated as of HAL version 1.2. * * @param event: NanDataPathConfirmInd containing event details. */ oneway eventDataPathConfirm_1_2(NanDataPathConfirmInd event); /** * Asynchronous callback indicating a data-path (NDP) schedule has been updated (e.g. channels * have been changed). * * @param event: NanDataPathScheduleUpdateInd containing event details. */ oneway eventDataPathScheduleUpdate(NanDataPathScheduleUpdateInd event); }; No newline at end of file wifi/1.2/default/hidl_struct_util.cpp +64 −6 Original line number Diff line number Diff line Loading @@ -1956,6 +1956,22 @@ bool convertLegacyNanDataPathRequestIndToHidl( return true; } bool convertLegacyNdpChannelInfoToHidl( const legacy_hal::NanChannelInfo& legacy_struct, NanDataPathChannelInfo* hidl_struct) { if (!hidl_struct) { LOG(ERROR) << "convertLegacyNdpChannelInfoToHidl: hidl_struct is null"; return false; } *hidl_struct = {}; hidl_struct->channelFreq = legacy_struct.channel; hidl_struct->channelBandwidth = legacy_struct.bandwidth; hidl_struct->numSpatialStreams = legacy_struct.nss; return true; } bool convertLegacyNanDataPathConfirmIndToHidl( const legacy_hal::NanDataPathConfirmInd& legacy_ind, NanDataPathConfirmInd* hidl_ind) { Loading @@ -1966,18 +1982,60 @@ bool convertLegacyNanDataPathConfirmIndToHidl( } *hidl_ind = {}; hidl_ind->ndpInstanceId = legacy_ind.ndp_instance_id; hidl_ind->dataPathSetupSuccess = hidl_ind->V1_0.ndpInstanceId = legacy_ind.ndp_instance_id; hidl_ind->V1_0.dataPathSetupSuccess = legacy_ind.rsp_code == legacy_hal::NAN_DP_REQUEST_ACCEPT; hidl_ind->peerNdiMacAddr = hidl_ind->V1_0.peerNdiMacAddr = hidl_array<uint8_t, 6>(legacy_ind.peer_ndi_mac_addr); hidl_ind->appInfo = hidl_ind->V1_0.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 = hidl_ind->V1_0.status.status = convertLegacyNanStatusTypeToHidl(legacy_ind.reason_code); hidl_ind->status.description = ""; // TODO: b/34059183 hidl_ind->V1_0.status.description = ""; // TODO: b/34059183 std::vector<NanDataPathChannelInfo> channelInfo; for (unsigned int i = 0; i < legacy_ind.num_channels; ++i) { NanDataPathChannelInfo hidl_struct; if (!convertLegacyNdpChannelInfoToHidl(legacy_ind.channel_info[i], &hidl_struct)) { return false; } channelInfo.push_back(hidl_struct); } hidl_ind->channelInfo = channelInfo; return true; } bool convertLegacyNanDataPathScheduleUpdateIndToHidl( const legacy_hal::NanDataPathScheduleUpdateInd& legacy_ind, NanDataPathScheduleUpdateInd* hidl_ind) { if (!hidl_ind) { LOG(ERROR) << "convertLegacyNanDataPathScheduleUpdateIndToHidl: " "hidl_ind is null"; return false; } *hidl_ind = {}; hidl_ind->peerDiscoveryAddress = hidl_array<uint8_t, 6>(legacy_ind.peer_mac_addr); std::vector<NanDataPathChannelInfo> channelInfo; for (unsigned int i = 0; i < legacy_ind.num_channels; ++i) { NanDataPathChannelInfo hidl_struct; if (!convertLegacyNdpChannelInfoToHidl(legacy_ind.channel_info[i], &hidl_struct)) { return false; } channelInfo.push_back(hidl_struct); } hidl_ind->channelInfo = channelInfo; std::vector<uint32_t> ndpInstanceIds; for (unsigned int i = 0; i < legacy_ind.num_ndp_instances; ++i) { ndpInstanceIds.push_back(legacy_ind.ndp_instance_id[i]); } hidl_ind->ndpInstanceIds = ndpInstanceIds; return true; } Loading wifi/1.2/default/hidl_struct_util.h +3 −0 Original line number Diff line number Diff line Loading @@ -147,6 +147,9 @@ bool convertLegacyNanDataPathRequestIndToHidl( bool convertLegacyNanDataPathConfirmIndToHidl( const legacy_hal::NanDataPathConfirmInd& legacy_ind, NanDataPathConfirmInd* hidl_ind); bool convertLegacyNanDataPathScheduleUpdateIndToHidl( const legacy_hal::NanDataPathScheduleUpdateInd& legacy_ind, NanDataPathScheduleUpdateInd* hidl_ind); // RTT controller conversion methods. bool convertHidlVectorOfRttConfigToLegacy( Loading Loading
wifi/1.2/Android.bp +4 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ hidl_interface { "IWifi.hal", "IWifiChip.hal", "IWifiNanIface.hal", "IWifiNanIfaceEventCallback.hal", ], interfaces: [ "android.hardware.wifi@1.0", Loading @@ -19,6 +20,9 @@ hidl_interface { ], types: [ "NanConfigRequestSupplemental", "NanDataPathChannelInfo", "NanDataPathConfirmInd", "NanDataPathScheduleUpdateInd", ], gen_java: true, } Loading
wifi/1.2/IWifiNanIface.hal +19 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import @1.0::IWifiNanIface; import @1.0::NanConfigRequest; import @1.0::NanEnableRequest; import @1.0::WifiStatus; import IWifiNanIfaceEventCallback; /** * Interface used to represent a single NAN (Neighbour Aware Network) iface. Loading @@ -29,6 +30,24 @@ import @1.0::WifiStatus; * Networking (NAN) Technical Specification". */ interface IWifiNanIface extends @1.0::IWifiNanIface { /** * Requests notifications of significant events on this iface. Multiple calls * to this must register multiple callbacks each of which must receive all * events. * * Note: supersedes the @1.0::IWifiNanIface.registerEventCallback() method which is deprecated * as of HAL version 1.2. * * @param callback An instance of the |IWifiNanIfaceEventCallback| HIDL interface * object. * @return status WifiStatus of the operation. * Possible status codes: * |WifiStatusCode.SUCCESS|, * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID| */ registerEventCallback_1_2(IWifiNanIfaceEventCallback callback) 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 Loading
wifi/1.2/IWifiNanIfaceEventCallback.hal 0 → 100644 +46 −0 Original line number Diff line number Diff line /* * Copyright 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.hardware.wifi@1.2; import @1.0::IWifiNanIfaceEventCallback; /** * NAN Response and Asynchronous Event Callbacks. * * References to "NAN Spec" are to the Wi-Fi Alliance "Wi-Fi Neighbor Awareness * Networking (NAN) Technical Specification". */ interface IWifiNanIfaceEventCallback extends @1.0::IWifiNanIfaceEventCallback { /** * Asynchronous callback indicating a data-path (NDP) setup has been completed: received by * both Initiator and Responder. * * Note: supersedes the @1.0::IWifiNanIfaceEventCallback.eventDataPathConfirm() method which is * deprecated as of HAL version 1.2. * * @param event: NanDataPathConfirmInd containing event details. */ oneway eventDataPathConfirm_1_2(NanDataPathConfirmInd event); /** * Asynchronous callback indicating a data-path (NDP) schedule has been updated (e.g. channels * have been changed). * * @param event: NanDataPathScheduleUpdateInd containing event details. */ oneway eventDataPathScheduleUpdate(NanDataPathScheduleUpdateInd event); }; No newline at end of file
wifi/1.2/default/hidl_struct_util.cpp +64 −6 Original line number Diff line number Diff line Loading @@ -1956,6 +1956,22 @@ bool convertLegacyNanDataPathRequestIndToHidl( return true; } bool convertLegacyNdpChannelInfoToHidl( const legacy_hal::NanChannelInfo& legacy_struct, NanDataPathChannelInfo* hidl_struct) { if (!hidl_struct) { LOG(ERROR) << "convertLegacyNdpChannelInfoToHidl: hidl_struct is null"; return false; } *hidl_struct = {}; hidl_struct->channelFreq = legacy_struct.channel; hidl_struct->channelBandwidth = legacy_struct.bandwidth; hidl_struct->numSpatialStreams = legacy_struct.nss; return true; } bool convertLegacyNanDataPathConfirmIndToHidl( const legacy_hal::NanDataPathConfirmInd& legacy_ind, NanDataPathConfirmInd* hidl_ind) { Loading @@ -1966,18 +1982,60 @@ bool convertLegacyNanDataPathConfirmIndToHidl( } *hidl_ind = {}; hidl_ind->ndpInstanceId = legacy_ind.ndp_instance_id; hidl_ind->dataPathSetupSuccess = hidl_ind->V1_0.ndpInstanceId = legacy_ind.ndp_instance_id; hidl_ind->V1_0.dataPathSetupSuccess = legacy_ind.rsp_code == legacy_hal::NAN_DP_REQUEST_ACCEPT; hidl_ind->peerNdiMacAddr = hidl_ind->V1_0.peerNdiMacAddr = hidl_array<uint8_t, 6>(legacy_ind.peer_ndi_mac_addr); hidl_ind->appInfo = hidl_ind->V1_0.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 = hidl_ind->V1_0.status.status = convertLegacyNanStatusTypeToHidl(legacy_ind.reason_code); hidl_ind->status.description = ""; // TODO: b/34059183 hidl_ind->V1_0.status.description = ""; // TODO: b/34059183 std::vector<NanDataPathChannelInfo> channelInfo; for (unsigned int i = 0; i < legacy_ind.num_channels; ++i) { NanDataPathChannelInfo hidl_struct; if (!convertLegacyNdpChannelInfoToHidl(legacy_ind.channel_info[i], &hidl_struct)) { return false; } channelInfo.push_back(hidl_struct); } hidl_ind->channelInfo = channelInfo; return true; } bool convertLegacyNanDataPathScheduleUpdateIndToHidl( const legacy_hal::NanDataPathScheduleUpdateInd& legacy_ind, NanDataPathScheduleUpdateInd* hidl_ind) { if (!hidl_ind) { LOG(ERROR) << "convertLegacyNanDataPathScheduleUpdateIndToHidl: " "hidl_ind is null"; return false; } *hidl_ind = {}; hidl_ind->peerDiscoveryAddress = hidl_array<uint8_t, 6>(legacy_ind.peer_mac_addr); std::vector<NanDataPathChannelInfo> channelInfo; for (unsigned int i = 0; i < legacy_ind.num_channels; ++i) { NanDataPathChannelInfo hidl_struct; if (!convertLegacyNdpChannelInfoToHidl(legacy_ind.channel_info[i], &hidl_struct)) { return false; } channelInfo.push_back(hidl_struct); } hidl_ind->channelInfo = channelInfo; std::vector<uint32_t> ndpInstanceIds; for (unsigned int i = 0; i < legacy_ind.num_ndp_instances; ++i) { ndpInstanceIds.push_back(legacy_ind.ndp_instance_id[i]); } hidl_ind->ndpInstanceIds = ndpInstanceIds; return true; } Loading
wifi/1.2/default/hidl_struct_util.h +3 −0 Original line number Diff line number Diff line Loading @@ -147,6 +147,9 @@ bool convertLegacyNanDataPathRequestIndToHidl( bool convertLegacyNanDataPathConfirmIndToHidl( const legacy_hal::NanDataPathConfirmInd& legacy_ind, NanDataPathConfirmInd* hidl_ind); bool convertLegacyNanDataPathScheduleUpdateIndToHidl( const legacy_hal::NanDataPathScheduleUpdateInd& legacy_ind, NanDataPathScheduleUpdateInd* hidl_ind); // RTT controller conversion methods. bool convertHidlVectorOfRttConfigToLegacy( Loading