Added in API level 14

WifiP2pConfig

open class WifiP2pConfig : Parcelable
kotlin.Any
   ↳ android.net.wifi.p2p.WifiP2pConfig

A class representing a Wi-Fi P2p configuration for setting up a connection {@see WifiP2pManager}

Summary

Nested classes

Builder used to build WifiP2pConfig objects for creating or joining a group.

Constants
static Int

IP provisioning via IPv4 DHCP, when joining a group as a group client.

static Int

IP provisioning via IPv6 link-local, when joining a group as a group client.

static Int

Allow the system to pick the operating frequency from the 2.

static Int

Allow the system to pick the operating frequency from the 5 GHz band.

static Int

Allow the system to pick the operating frequency from all supported bands.

static Int

The system can choose an appropriate owner intent value, to be filled in the field groupOwnerIntent.

static Int

The most inclination to be a group owner, to be filled in the field groupOwnerIntent.

static Int

The least inclination to be a group owner, to be filled in the field groupOwnerIntent.

Inherited constants
Public constructors

copy constructor

Public methods
open Int

Implement the Parcelable interface

open Int

Get the IP provisioning mode when joining a group as a group client.

open Int

Get the required band for the group owner.

open Int

Get the network ID of this P2P configuration.

open String?

Get the network name of this P2P configuration, or null if unset.

open String?

Get the passphrase of this P2P configuration, or null if unset.

open String

open Unit
writeToParcel(dest: Parcel, flags: Int)

Implement the Parcelable interface

Properties
static Parcelable.Creator<WifiP2pConfig!>

Implement the Parcelable interface

String!

The device MAC address uniquely identifies a Wi-Fi p2p device

Int

This is an integer value between GROUP_OWNER_INTENT_MIN and GROUP_OWNER_INTENT_MAX where GROUP_OWNER_INTENT_MIN indicates the least inclination to be a group owner and GROUP_OWNER_INTENT_MAX indicates the highest inclination to be a group owner.

WpsInfo!

Wi-Fi Protected Setup information

Constants

GROUP_CLIENT_IP_PROVISIONING_MODE_IPV4_DHCP

Added in API level 34
static val GROUP_CLIENT_IP_PROVISIONING_MODE_IPV4_DHCP: Int

IP provisioning via IPv4 DHCP, when joining a group as a group client.

Value: 0
Added in API level 34
static val GROUP_CLIENT_IP_PROVISIONING_MODE_IPV6_LINK_LOCAL: Int

IP provisioning via IPv6 link-local, when joining a group as a group client.

Value: 1

GROUP_OWNER_BAND_2GHZ

Added in API level 29
static val GROUP_OWNER_BAND_2GHZ: Int

Allow the system to pick the operating frequency from the 2.4 GHz band.

Value: 1

GROUP_OWNER_BAND_5GHZ

Added in API level 29
static val GROUP_OWNER_BAND_5GHZ: Int

Allow the system to pick the operating frequency from the 5 GHz band.

Value: 2

GROUP_OWNER_BAND_AUTO

Added in API level 29
static val GROUP_OWNER_BAND_AUTO: Int

Allow the system to pick the operating frequency from all supported bands.

Value: 0

GROUP_OWNER_INTENT_AUTO

Added in API level 30
static val GROUP_OWNER_INTENT_AUTO: Int

The system can choose an appropriate owner intent value, to be filled in the field groupOwnerIntent.

Value: -1

GROUP_OWNER_INTENT_MAX

Added in API level 30
static val GROUP_OWNER_INTENT_MAX: Int

The most inclination to be a group owner, to be filled in the field groupOwnerIntent.

Value: 15

GROUP_OWNER_INTENT_MIN

Added in API level 30
static val GROUP_OWNER_INTENT_MIN: Int

The least inclination to be a group owner, to be filled in the field groupOwnerIntent.

Value: 0

Public constructors

WifiP2pConfig

Added in API level 14
WifiP2pConfig()

WifiP2pConfig

Added in API level 14
WifiP2pConfig(source: WifiP2pConfig!)

copy constructor

Public methods

describeContents

Added in API level 14
open fun describeContents(): Int

Implement the Parcelable interface

Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

getGroupClientIpProvisioningMode

Added in API level 34
open fun getGroupClientIpProvisioningMode(): Int

Get the IP provisioning mode when joining a group as a group client. The result will be one of the following: GROUP_CLIENT_IP_PROVISIONING_MODE_IPV4_DHCP, GROUP_CLIENT_IP_PROVISIONING_MODE_IPV6_LINK_LOCAL

Return
Int Value is android.net.wifi.p2p.WifiP2pConfig#GROUP_CLIENT_IP_PROVISIONING_MODE_IPV4_DHCP, or android.net.wifi.p2p.WifiP2pConfig#GROUP_CLIENT_IP_PROVISIONING_MODE_IPV6_LINK_LOCAL

getGroupOwnerBand

Added in API level 30
open fun getGroupOwnerBand(): Int

Get the required band for the group owner. The result will be one of the following: GROUP_OWNER_BAND_AUTO, GROUP_OWNER_BAND_2GHZ, GROUP_OWNER_BAND_5GHZ

Return
Int Value is android.net.wifi.p2p.WifiP2pConfig#GROUP_OWNER_BAND_AUTO, android.net.wifi.p2p.WifiP2pConfig#GROUP_OWNER_BAND_2GHZ, or android.net.wifi.p2p.WifiP2pConfig#GROUP_OWNER_BAND_5GHZ

getNetworkId

Added in API level 30
open fun getNetworkId(): Int

Get the network ID of this P2P configuration.

Return
Int either a non-negative network ID, or one of WifiP2pGroup#NETWORK_ID_PERSISTENT or WifiP2pGroup#NETWORK_ID_TEMPORARY.

getNetworkName

Added in API level 30
open fun getNetworkName(): String?

Get the network name of this P2P configuration, or null if unset.

getPassphrase

Added in API level 30
open fun getPassphrase(): String?

Get the passphrase of this P2P configuration, or null if unset.

toString

Added in API level 14
open fun toString(): String
Return
String a string representation of the object.

writeToParcel

Added in API level 14
open fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

Implement the Parcelable interface

Parameters
dest Parcel: The Parcel in which the object should be written. This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

Added in API level 14
static val CREATOR: Parcelable.Creator<WifiP2pConfig!>

Implement the Parcelable interface

deviceAddress

Added in API level 14
var deviceAddress: String!

The device MAC address uniquely identifies a Wi-Fi p2p device

groupOwnerIntent

Added in API level 14
var groupOwnerIntent: Int

This is an integer value between GROUP_OWNER_INTENT_MIN and GROUP_OWNER_INTENT_MAX where GROUP_OWNER_INTENT_MIN indicates the least inclination to be a group owner and GROUP_OWNER_INTENT_MAX indicates the highest inclination to be a group owner. A value of GROUP_OWNER_INTENT_AUTO indicates the system can choose an appropriate value. By default this field is set to GROUP_OWNER_INTENT_AUTO.
Value is between 0 and 15 inclusive

wps

Added in API level 14
var wps: WpsInfo!

Wi-Fi Protected Setup information