Browse Source

docs/library/network: Update docs for network.country, network.hostname.

Also marks wlan.config(hostname) as deprecated.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
pull/10635/head
Jim Mussared 2 years ago
committed by Damien George
parent
commit
8b277d3c34
  1. 2
      docs/library/network.WLAN.rst
  2. 31
      docs/library/network.rst

2
docs/library/network.WLAN.rst

@ -130,7 +130,7 @@ Methods
hidden Whether SSID is hidden (boolean) hidden Whether SSID is hidden (boolean)
security Security protocol supported (enumeration, see module constants) security Security protocol supported (enumeration, see module constants)
key Access key (string) key Access key (string)
hostname The hostname that will be sent to DHCP (STA interfaces) and mDNS (if supported, both STA and AP) hostname The hostname that will be sent to DHCP (STA interfaces) and mDNS (if supported, both STA and AP). (Deprecated, use :func:`network.hostname` instead)
reconnects Number of reconnect attempts to make (integer, 0=none, -1=unlimited) reconnects Number of reconnect attempts to make (integer, 0=none, -1=unlimited)
txpower Maximum transmit power in dBm (integer or float) txpower Maximum transmit power in dBm (integer or float)
============= =========== ============= ===========

31
docs/library/network.rst

@ -158,12 +158,39 @@ Network functions
The following are functions available in the network module. The following are functions available in the network module.
.. function:: country([code])
Get or set the two-letter ISO 3166-1 Alpha-2 country code to be used for
radio compliance.
If the *code* parameter is provided, the country will be set to this value.
If the function is called without parameters, it returns the current
country.
The default code ``"XX"`` represents the "worldwide" region.
.. function:: hostname([name])
Get or set the hostname that will identify this device on the network. It is
applied to all interfaces.
This hostname is used for:
* Sending to the DHCP server in the client request. (If using DHCP)
* Broadcasting via mDNS. (If enabled)
If the *name* parameter is provided, the hostname will be set to this value.
If the function is called without parameters, it returns the current
hostname.
The default hostname is typically the name of the board.
.. function:: phy_mode([mode]) .. function:: phy_mode([mode])
Get or set the PHY mode. Get or set the PHY mode.
If the *mode* parameter is provided, sets the mode to its value. If If the *mode* parameter is provided, the PHY mode will be set to this value.
the function is called without parameters, returns the current mode. If the function is called without parameters, it returns the current PHY
mode.
The possible modes are defined as constants: The possible modes are defined as constants:
* ``MODE_11B`` -- IEEE 802.11b, * ``MODE_11B`` -- IEEE 802.11b,

Loading…
Cancel
Save