WifiAwareSession.CreateNetworkSpecifierPassphrase Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Create a android.net.NetworkRequest.Builder#setNetworkSpecifier(NetworkSpecifier)
for
an encrypted WiFi Aware connection (link) to the specified peer.
[Android.Runtime.Register("createNetworkSpecifierPassphrase", "(I[BLjava/lang/String;)Landroid/net/NetworkSpecifier;", "GetCreateNetworkSpecifierPassphrase_IarrayBLjava_lang_String_Handler", ApiSince=26)]
public virtual Android.Net.NetworkSpecifier? CreateNetworkSpecifierPassphrase (Android.Net.Wifi.Aware.WifiAwareDataPathRole role, byte[] peer, string passphrase);
[<Android.Runtime.Register("createNetworkSpecifierPassphrase", "(I[BLjava/lang/String;)Landroid/net/NetworkSpecifier;", "GetCreateNetworkSpecifierPassphrase_IarrayBLjava_lang_String_Handler", ApiSince=26)>]
abstract member CreateNetworkSpecifierPassphrase : Android.Net.Wifi.Aware.WifiAwareDataPathRole * byte[] * string -> Android.Net.NetworkSpecifier
override this.CreateNetworkSpecifierPassphrase : Android.Net.Wifi.Aware.WifiAwareDataPathRole * byte[] * string -> Android.Net.NetworkSpecifier
Parameters
The role of this device:
WifiAwareManager#WIFI_AWARE_DATA_PATH_ROLE_INITIATOR
or
WifiAwareManager#WIFI_AWARE_DATA_PATH_ROLE_RESPONDER
- peer
- Byte[]
The MAC address of the peer's Aware discovery interface. On a RESPONDER this value is used to gate the acceptance of a connection request from only that peer.
- passphrase
- String
The passphrase to be used to encrypt the link. The PMK is generated from
the passphrase. Use #createNetworkSpecifierOpen(int, byte[])
to
specify an open (unencrypted) link.
Returns
A NetworkSpecifier
to be used to construct
android.net.NetworkRequest.Builder#setNetworkSpecifier(NetworkSpecifier)
to pass to
android.net.ConnectivityManager#requestNetwork(android.net.NetworkRequest,
android.net.ConnectivityManager.NetworkCallback)
[or other varieties of that API].
- Attributes
Remarks
Create a android.net.NetworkRequest.Builder#setNetworkSpecifier(NetworkSpecifier)
for an encrypted WiFi Aware connection (link) to the specified peer. The android.net.NetworkRequest.Builder#addTransportType(int)
should be set to android.net.NetworkCapabilities#TRANSPORT_WIFI_AWARE
.
This API is targeted for applications which can obtain the peer MAC address using OOB (out-of-band) discovery. Aware discovery does not provide the MAC address of the peer - when using Aware discovery use the alternative network specifier method - android.net.wifi.aware.WifiAwareNetworkSpecifier.Builder
.
This member is deprecated. Please use in-band data-path setup, refer to WifiAwareNetworkSpecifier.Builder
, #publish(PublishConfig, DiscoverySessionCallback, Handler)
and #subscribe(SubscribeConfig, DiscoverySessionCallback, Handler)
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.