Language

WifiP2pManager.SetVendorElements Method

Definition

Set/Clear vendor specific information elements (VSIEs) to be published during Wi-Fi Direct (P2P) discovery.

[Android.Runtime.Register("setVendorElements", "(Landroid/net/wifi/p2p/WifiP2pManager$Channel;Ljava/util/List;Landroid/net/wifi/p2p/WifiP2pManager$ActionListener;)V", "GetSetVendorElements_Landroid_net_wifi_p2p_WifiP2pManager_Channel_Ljava_util_List_Landroid_net_wifi_p2p_WifiP2pManager_ActionListener_Handler", ApiSince=33)]
public virtual void SetVendorElements(Android.Net.Wifi.P2p.WifiP2pManager.Channel c, System.Collections.Generic.IList<Android.Net.Wifi.ScanResult.InformationElement> vendorElements, Android.Net.Wifi.P2p.WifiP2pManager.IActionListener? listener);
[<Android.Runtime.Register("setVendorElements", "(Landroid/net/wifi/p2p/WifiP2pManager$Channel;Ljava/util/List;Landroid/net/wifi/p2p/WifiP2pManager$ActionListener;)V", "GetSetVendorElements_Landroid_net_wifi_p2p_WifiP2pManager_Channel_Ljava_util_List_Landroid_net_wifi_p2p_WifiP2pManager_ActionListener_Handler", ApiSince=33)>]
abstract member SetVendorElements : Android.Net.Wifi.P2p.WifiP2pManager.Channel * System.Collections.Generic.IList<Android.Net.Wifi.ScanResult.InformationElement> * Android.Net.Wifi.P2p.WifiP2pManager.IActionListener -> unit
override this.SetVendorElements : Android.Net.Wifi.P2p.WifiP2pManager.Channel * System.Collections.Generic.IList<Android.Net.Wifi.ScanResult.InformationElement> * Android.Net.Wifi.P2p.WifiP2pManager.IActionListener -> unit

Parameters

c
WifiP2pManager.Channel

The channel created by Initialize(Context, Looper, WifiP2pManager+IChannelListener). This value cannot be null.

vendorElements
IList<ScanResult.InformationElement>

application information as vendor-specific information elements. This value cannot be null.

listener
WifiP2pManager.IActionListener

for callbacks on success or failure of setting vendor elements. This value may be null.

Attributes

Remarks

Set/Clear vendor specific information elements (VSIEs) to be published during Wi-Fi Direct (P2P) discovery. Once Close() is called, the vendor information elements will be cleared from framework. The information element format is defined in the IEEE 802.11-2016 spec Table 9-77.

To clear the previously set vendor elements, call this API with an empty List.

The total length of all VSIEs must not exceed P2pMaxAllowedVendorElementsLengthBytes.

To publish vendor elements, this API should be called before peer discovery API, ex. DiscoverPeers(WifiP2pManager+Channel, WifiP2pManager+IActionListener).

Check IsSetVendorElementsSupported to determine whether the device supports this feature. This method throws UnsupportedOperationException if the property is false. Requires android.permission.NEARBY_WIFI_DEVICES and android.permission.OVERRIDE_WIFI_CONFIG

Android reference for android.net.wifi.p2p.WifiP2pManager.setVendorElements.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to