This API is available on Firefox OS for internal applications only.
The MozWifiP2pManager
is an interface that allows to control Wi-Fi connection with other computers using Wi-Fi Direct.
Properties
This interface also inherits properties from its parent, the EventTarget
interface.
MozWifiP2pManager.enabled
Read only- Returns a
Boolean
indicating if the Wi-Fi Direct is enabled MozWifiP2pManager.groupOwner
Read only- Returns a
MozWifiP2pGroupOwner
representing the owner of the Wi-Fi Direct group. If no group is active, returnsnull
.
Methods
This interface also inherits methods from its parent, the EventTarget
interface.
MozWifiP2pManager.setScanEnabled()
- Enables, or disables, a Wi-Fi Direct scan and returns a
DOMRequest
that will report on the success of the operation. MozWifiP2pManager.connect()
- Connects, with a given configuration, to a peer identified by its MAC address and returns a
DOMRequest
that will report if the connect request has been issued successfully or not (but not about its result). MozWifiP2pManager.disconnect()
- Ends the connection with the peer identified by its MAC address and returns a
DOMRequest
that will report if the disconnect request has been issued successfully or not (but not about its result). MozWifiP2pManager.getPeerList()
- Returns a
DOMRequest
whoseresult
properties, on success, contains a list of peers, their MAC address, their capabilities and their connection status. MozWifiP2pManager.setPairingConfirmation()
- Defines if we accept a given peer or not with an optional PIN if needed and returns a
DOMRequest
that will report if the command succeeded or not. MozWifiP2pManager.setDeviceName()
- Sets a new device name, a
DOMString
and returns aDOMRequest
that will report if the command succeeded or not.
Event handlers
MozWifiP2pManager.onpeerinfoupdate
- Is the event handler called when the
peerinfoupdate
event is received. Such an event is sent when the peer list, accessible via thegetPeerList()
method, is updated. MozWifiP2pManager.onstatuschange
- Is the event handler called when the
statuschange
event is received. Such an event is sent when MozWifiP2pManager.onenabled
- Is the event handler called when the
enabled
event is received. Such an event is sent when MozWifiP2pManager.ondisabled
- Is the event handler called when the
disabled
event is received. Such an event is sent when
Specifications
This is a non-standard API, not on an any standard track.
Browser compatibility
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | No support | No support | No support | No support | No support |
Feature | Android | Firefox Mobile (Gecko) | Firefox OS | IE Mobile | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|
Basic support | No support | No support | 1.4 | No support | No support | No support | No support |
See also
- WiFiDirect API
- Article on Mozilla Hacks about Wi-Fi Direct