• Skip to main content
  • Select language
  • Skip to search
MDN Web Docs
  • Technologies
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs / DOM
    • WebExtensions
    • MathML
  • References & Guides
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
B2G OS
  1. MDN
  2. Archive of obsolete content
  3. B2G OS
  4. B2G OS APIs
  5. MozWifiP2pManager

MozWifiP2pManager

In This Article
  1. Properties
  2. Methods
  3. Event handlers
  4. Specifications
  5. Browser compatibility
  6. See also

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, returns null.

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 whose result 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 a DOMRequest 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 the getPeerList() 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

  • Desktop
  • Mobile
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

Document Tags and Contributors

Tags: 
  • API
  • Firefox OS
  • Interface
  • Non-standard
  • WiFi
 Contributors to this page: chrisdavidmills, teoli, fscholz, gmarty
 Last updated by: chrisdavidmills, Feb 27, 2017, 2:09:15 AM
See also
  1. WiFi Information API
  2. Archive
  3. Events
    1. statuschange
    2. connectioninfoupdate
  4. Related pages for WiFi Information API
    1. MozWifiCapabilities
    2. MozWifiConnection
    3. MozWifiConnectionInfo
    4. MozWifiConnectionInfoEvent
    5. MozWifiManager
    6. MozWifiNetwork
    7. MozWifiStationChangeEvent
    8. MozWifiStatusChangeEvent
    9. WifiManager