• 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. WifiManager
  6. WifiManager.setStaticIpMode()

WifiManager.setStaticIpMode()

In This Article
  1. Summary
  2. Syntax
    1. Parameters
    2. Returns
  3. Specification
  4. See also

This API is available on Firefox OS for internal applications only.

Summary

The setStaticIpMod method is used to define a static or dynamic (if the network has a DHCP server) IP address for the device on a given network.

Syntax

var request = navigator.mozWifiManager.setStaticIpMode(param);

Parameters

param
A configuration object with the following properties:
  • enabled : A boolean requesting if the static IP mode must be turned on (true) or off (false). If it's turned off and the current WiFi network is DHCP enabled, the device will get a dynamic IP.
  • ipaddr : A string representing the IP address of the device in the dotted quad format.
  • proxy :  A string representing the proxy server address (if any, otherwise an empty string).
  • maskLength : A number representing the length of the network mask.
  • gateway : A string representing a gateway address (if any, otherwise an empty string).
  • dns1 : A string representing the first DNS server address.
  • dns2 : A string representing the second DNS server address.

Returns

It returns a DOMRequest to handle the success or error of the operation.

Specification

Not part of any specification.

See also

  • WifiManager
  • The WifI Information API

Document Tags and Contributors

Tags: 
  • API
  • B2G
  • Firefox OS
  • Method
  • Non-standard
  • Reference
  • WiFi
 Contributors to this page: chrisdavidmills, teoli, kscarfone, Jeremie
 Last updated by: chrisdavidmills, Feb 27, 2017, 2:08:16 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