# Print output for @column tags ?> WifiP2pConfig - Android SDK | Android Developers

Most visited

Recently visited

WifiP2pConfig

public class WifiP2pConfig
extends Object implements Parcelable

java.lang.Object
   ↳ android.net.wifi.p2p.WifiP2pConfig


A class representing a Wi-Fi P2p configuration for setting up a connection

See also:

Summary

Nested classes

class WifiP2pConfig.Builder

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

Constants

int GROUP_OWNER_BAND_2GHZ

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

int GROUP_OWNER_BAND_5GHZ

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

int GROUP_OWNER_BAND_AUTO

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

int GROUP_OWNER_INTENT_AUTO

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

int GROUP_OWNER_INTENT_MAX

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

int GROUP_OWNER_INTENT_MIN

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

Inherited constants

Fields

public static final Creator<WifiP2pConfig> CREATOR

Implement the Parcelable interface

public String deviceAddress

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

public int groupOwnerIntent

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.

public WpsInfo wps

Wi-Fi Protected Setup information

Public constructors

WifiP2pConfig()
WifiP2pConfig(WifiP2pConfig source)

copy constructor

Public methods

int describeContents()

Implement the Parcelable interface

int getGroupOwnerBand()

Get the required band for the group owner.

int getNetworkId()

Get the network ID of this P2P configuration.

String getNetworkName()

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

String getPassphrase()

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

String toString()

Returns a string representation of the object.

void writeToParcel(Parcel dest, int flags)

Implement the Parcelable interface

Inherited methods

Constants

GROUP_OWNER_BAND_2GHZ

public static final int GROUP_OWNER_BAND_2GHZ

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

Constant Value: 1 (0x00000001)

GROUP_OWNER_BAND_5GHZ

public static final int GROUP_OWNER_BAND_5GHZ

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

Constant Value: 2 (0x00000002)

GROUP_OWNER_BAND_AUTO

public static final int GROUP_OWNER_BAND_AUTO

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

Constant Value: 0 (0x00000000)

GROUP_OWNER_INTENT_AUTO

public static final int GROUP_OWNER_INTENT_AUTO

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

Constant Value: -1 (0xffffffff)

GROUP_OWNER_INTENT_MAX

public static final int GROUP_OWNER_INTENT_MAX

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

Constant Value: 15 (0x0000000f)

GROUP_OWNER_INTENT_MIN

public static final int GROUP_OWNER_INTENT_MIN

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

Constant Value: 0 (0x00000000)

Fields

CREATOR

public static final Creator<WifiP2pConfig> CREATOR

Implement the Parcelable interface

deviceAddress

public String deviceAddress

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

groupOwnerIntent

public int groupOwnerIntent

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

public WpsInfo wps

Wi-Fi Protected Setup information

Public constructors

WifiP2pConfig

public WifiP2pConfig ()

WifiP2pConfig

public WifiP2pConfig (WifiP2pConfig source)

copy constructor

Parameters
source WifiP2pConfig

Public methods

describeContents

public int describeContents ()

Implement the Parcelable interface

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or CONTENTS_FILE_DESCRIPTOR

getGroupOwnerBand

public int getGroupOwnerBand ()

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

Returns
int Value is GROUP_OWNER_BAND_AUTO, GROUP_OWNER_BAND_2GHZ, or GROUP_OWNER_BAND_5GHZ

getNetworkId

public int getNetworkId ()

Get the network ID of this P2P configuration.

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

getNetworkName

public String getNetworkName ()

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

Returns
String

getPassphrase

public String getPassphrase ()

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

Returns
String

toString

public String toString ()

Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Returns
String a string representation of the object.

writeToParcel

public void writeToParcel (Parcel dest, 
                int flags)

Implement the Parcelable interface

Parameters
dest Parcel: The Parcel in which the object should be written.

flags int: Additional flags about how the object should be written. May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES