目录

IWifiP2pManagerEx

Interface Info

public interface IWifiP2pManagerEx

Southbound API required for integrating Share Engine for non-Huawei devices, which is called when Share Engine directly connects to the device through Wi-Fi Direct.

Public Method Summary

Qualifier and Type

Method Name and Description

int[]

getChannelListFor5G()

Obtains the list of 5 GHz channels supported by the device.

void

createGroup(WifiP2pManager.Channel channel, String frequency, WifiP2pManager.ActionListener listener)

Creates a peer-to-peer group with a specified frequency as the group owner.

void

connect(WifiP2pManager.Channel channel, String config, WifiP2pManager.ActionListener listener)

Joins a specified peer-to-peer group as a group client.

void

removeGcGroup(WifiP2pManager.Channel channel, String iface, WifiP2pManager.ActionListener listener)

Exits a specified peer-to-peer group as a group client.

boolean

configIpAddr(String ifName, String ipAddr, String server)

Configures DHCP settings as a group client.

boolean

releaseIpAddr(String ifName)

Cancels DHCP settings.

int

getWifiP2pGroupFreq(WifiP2pGroup p2pGroup)

Obtains the frequency of a specified peer-to-peer group.

Public Methods

[h2]int[] getChannelListFor5G

Method

int[] getChannelListFor5G()

Obtains the list of 5 GHz channels supported by the device.

[h2]void createGroup

Method

void createGroup(WifiP2pManager.Channel channel, String frequency, WifiP2pManager.ActionListener listener)

Creates a peer-to-peer group with a specified frequency as the group owner.

Parameters

Name

Description

channel

Channel.

frequency

Frequency of the group to create.

listener

Callback object.

[h2]void connect

Method

void connect(WifiP2pManager.Channel channel, String config, WifiP2pManager.ActionListener listener)

Joins a specified peer-to-peer group as a group client.

Parameters

Name

Description

channel

Channel.

Config

Connection information: SSID + "\n" + GO_MAC + "\n" + PASSPHRASE + "\n" + FREQUENCE + "\n" + "1"

listener

Callback object.

[h2]void removeGcGroup

Method

void removeGcGroup(WifiP2pManager.Channel channel, String iface, WifiP2pManager.ActionListener listener)

Exits a specified peer-to-peer group as a group client.

Parameters

Name

Description

channel

Channel.

iface

P2P API, for example, p2p-p2p-1.

listener

Callback object.

[h2]boolean configIpAddr

Method

boolean configIpAddr(String ifName, String ipAddr, String server)

Configures DHCP settings as a group client.

Parameters

Name

Description

ifName

P2P API, for example, p2p-p2p-1.

ipAddr

IP address of the group owner.

server

Gateway address.

[h2]boolean releaseIpAddr

Method

boolean releaseIpAddr(String ifName)

Cancels DHCP settings.

Parameters

Name

Description

ifName

P2P API, for example, p2p-p2p-1.

[h2]int getWifiP2pGroupFreq

Method

int getWifiP2pGroupFreq(WifiP2pGroup p2pGroup)

Obtains the frequency of a specified peer-to-peer group.

Parameters

Name

Description

p2pGroup

Peer-to-peer group.