Added in API level 14

WifiP2pGroup


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

A class representing a Wi-Fi P2p group. A p2p group consists of a single group owner and one or more clients. In the case of a group with only two devices, one will be the group owner and the other will be a group client. {@see WifiP2pManager}

Summary

Constants
static Int

The persistent network id.

static Int

The temporary network id.

Inherited constants
Public constructors

copy constructor

Public methods
open Int

Implement the Parcelable interface

open MutableCollection<WifiP2pDevice!>!

Get the list of clients currently part of the p2p group

open Int

Get the operating frequency (in MHz) of the p2p group

open String!

Get the interface name on which the group is created

open Int

The network ID of the P2P group in wpa_supplicant.

open String!

Get the network name (SSID) of the group.

open WifiP2pDevice!

Get the details of the group owner as a WifiP2pDevice object

open String!

Get the passphrase of the group.

open Boolean

Check whether this device is the group owner of the created p2p group

open String

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

Implement the Parcelable interface

Properties
static Parcelable.Creator<WifiP2pGroup!>

Implement the Parcelable interface

Constants

NETWORK_ID_PERSISTENT

Added in API level 30
static val NETWORK_ID_PERSISTENT: Int

The persistent network id. If a matching persistent profile is found, use it. Otherwise, create a new persistent profile.

Value: -2

See Also

NETWORK_ID_TEMPORARY

Added in API level 30
static val NETWORK_ID_TEMPORARY: Int

The temporary network id.

Value: -1

See Also

Public constructors

WifiP2pGroup

Added in API level 14
WifiP2pGroup()

WifiP2pGroup

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

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

getClientList

Added in API level 14
open fun getClientList(): MutableCollection<WifiP2pDevice!>!

Get the list of clients currently part of the p2p group

getFrequency

Added in API level 29
open fun getFrequency(): Int

Get the operating frequency (in MHz) of the p2p group

getInterface

Added in API level 14
open fun getInterface(): String!

Get the interface name on which the group is created

getNetworkId

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

The network ID of the P2P group in wpa_supplicant.

getNetworkName

Added in API level 14
open fun getNetworkName(): String!

Get the network name (SSID) of the group. Legacy Wi-Fi clients will discover the p2p group using the network name.

getOwner

Added in API level 14
open fun getOwner(): WifiP2pDevice!

Get the details of the group owner as a WifiP2pDevice object

getPassphrase

Added in API level 14
open fun getPassphrase(): String!

Get the passphrase of the group. This function will return a valid passphrase only at the group owner. Legacy Wi-Fi clients will need this passphrase alongside network name obtained from getNetworkName() to join the group

isGroupOwner

Added in API level 14
open fun isGroupOwner(): Boolean

Check whether this device is the group owner of the created p2p group

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<WifiP2pGroup!>

Implement the Parcelable interface