Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 262c7739 authored by Jimmy Chen's avatar Jimmy Chen
Browse files

p2p: add new HAL API to pass vendor-specific data

Bug: 197695047
Test: atest VtsHalWifiSupplicantStaIfaceTargetTest \
            VtsHalWifiSupplicantStaNetworkTargetTest \
            VtsHalWifiSupplicantP2pIfaceTargetTest
Change-Id: Ie746deb74c08307b70bd7959e5950c5f3c1679c5
parent 182b7660
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -95,4 +95,5 @@ interface ISupplicantP2pIface {
  void stopFind();
  void findOnSocialChannels(in int timeoutInSec);
  void findOnSpecificFrequency(in int freqInHz, in int timeoutInSec);
  void setVendorElements(in android.hardware.wifi.supplicant.P2pFrameTypeMask frameTypeMask, in byte[] vendorElemBytes);
}
+1 −0
Original line number Diff line number Diff line
@@ -51,4 +51,5 @@ interface ISupplicantP2pIfaceCallback {
  oneway void onStaAuthorized(in byte[] srcAddress, in byte[] p2pDeviceAddress);
  oneway void onStaDeauthorized(in byte[] srcAddress, in byte[] p2pDeviceAddress);
  oneway void onGroupFrequencyChanged(in String groupIfname, in int frequency);
  oneway void onDeviceFoundWithVendorElements(in byte[] srcAddress, in byte[] p2pDeviceAddress, in byte[] primaryDeviceType, in String deviceName, in android.hardware.wifi.supplicant.WpsConfigMethods configMethods, in byte deviceCapabilities, in android.hardware.wifi.supplicant.P2pGroupCapabilityMask groupCapabilities, in byte[] wfdDeviceInfo, in byte[] wfdR2DeviceInfo, in byte[] vendorElemBytes);
}
+50 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2022 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.
 */
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
///////////////////////////////////////////////////////////////////////////////

// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
//     the interface (from the latest frozen version), the build system will
//     prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.

package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum P2pFrameTypeMask {
  P2P_FRAME_PROBE_REQ_P2P = 1,
  P2P_FRAME_PROBE_RESP_P2P = 2,
  P2P_FRAME_PROBE_RESP_P2P_GO = 4,
  P2P_FRAME_BEACON_P2P_GO = 8,
  P2P_FRAME_P2P_PD_REQ = 16,
  P2P_FRAME_P2P_PD_RESP = 32,
  P2P_FRAME_P2P_GO_NEG_REQ = 64,
  P2P_FRAME_P2P_GO_NEG_RESP = 128,
  P2P_FRAME_P2P_GO_NEG_CONF = 256,
  P2P_FRAME_P2P_INV_REQ = 512,
  P2P_FRAME_P2P_INV_RESP = 1024,
  P2P_FRAME_P2P_ASSOC_REQ = 2048,
  P2P_FRAME_P2P_ASSOC_RESP = 4096,
}
+17 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.hardware.wifi.supplicant.ISupplicantP2pIfaceCallback;
import android.hardware.wifi.supplicant.ISupplicantP2pNetwork;
import android.hardware.wifi.supplicant.IfaceType;
import android.hardware.wifi.supplicant.MiracastMode;
import android.hardware.wifi.supplicant.P2pFrameTypeMask;
import android.hardware.wifi.supplicant.P2pGroupCapabilityMask;
import android.hardware.wifi.supplicant.WpsConfigMethods;
import android.hardware.wifi.supplicant.WpsProvisionMethod;
@@ -810,4 +811,20 @@ interface ISupplicantP2pIface {
     *         |SupplicantStatusCode.FAILURE_IFACE_DISABLED|
     */
    void findOnSpecificFrequency(in int freqInHz, in int timeoutInSec);

    /**
     * Set vendor-specific information elements to P2P frames.
     *
     * @param frameTypeMask The bit mask of P2P frame type represented by
     *         P2pFrameTypeMask.
     * @param vendorElemBytes Vendor-specific information element bytes. The format of an
     *         information element is EID (1 byte) + Length (1 Byte) + Payload which is
     *         defined in Section 9.4.4 TLV encodings of 802.11-2016 IEEE Standard for
     *         Information technology. The length indicates the size of the payload.
     *         Multiple information elements may be appended within the byte array.
     * @throws ServiceSpecificException with one of the following values:
     *         |SupplicantStatusCode.FAILURE_UNKNOWN|,
     *         |SupplicantStatusCode.FAILURE_IFACE_INVALID|
     */
    void setVendorElements(in P2pFrameTypeMask frameTypeMask, in byte[] vendorElemBytes);
}
+31 −0
Original line number Diff line number Diff line
@@ -213,4 +213,35 @@ interface ISupplicantP2pIfaceCallback {
     * @param frequency New operating frequency in MHz.
     */
    oneway void onGroupFrequencyChanged(in String groupIfname, in int frequency);

    /**
     * Used to indicate that a P2P device has been found.
     *
     * @param srcAddress MAC address of the device found. This must either
     *        be the P2P device address for a peer which is not in a group,
     *        or the P2P interface address for a peer which is a Group Owner.
     * @param p2pDeviceAddress P2P device address.
     * @param primaryDeviceType Type of device. Refer to section B.1 of Wifi P2P
     *        Technical specification v1.2.
     * @param deviceName Name of the device.
     * @param configMethods Mask of WPS configuration methods supported by the
     *        device.
     * @param deviceCapabilities Refer to section 4.1.4 of Wifi P2P Technical
     *        specification v1.2.
     * @param groupCapabilites Refer to section 4.1.4 of Wifi P2P Technical
     *        specification v1.2.
     * @param wfdDeviceInfo WFD device info as described in section 5.1.2 of WFD
     *        technical specification v1.0.0.
     * @param wfdR2DeviceInfo WFD R2 device info as described in section 5.1.12 of WFD
     *        technical specification v2.1.
     * @param vendorElemBytes Vendor-specific information element bytes. The format of an
     *         information element is EID (1 byte) + Length (1 Byte) + Payload which is
     *         defined in Section 9.4.4 TLV encodings of 802.11-2016 IEEE Standard for
     *         Information technology. The length indicates the size of the payload.
     *         Multiple information elements may be appended within the byte array.
     */
    oneway void onDeviceFoundWithVendorElements(in byte[] srcAddress, in byte[] p2pDeviceAddress,
            in byte[] primaryDeviceType, in String deviceName, in WpsConfigMethods configMethods,
            in byte deviceCapabilities, in P2pGroupCapabilityMask groupCapabilities,
            in byte[] wfdDeviceInfo, in byte[] wfdR2DeviceInfo, in byte[] vendorElemBytes);
}
Loading