@@ -10,18 +10,12 @@ The ``esp`` module contains specific functions related to the ESP8266 module.
1010Functions
1111---------
1212
13- .. function:: status( )
13+ .. function:: mac([address] )
1414
15- Return the current status of the wireless connection .
15+ Get or set the network interface's MAC address .
1616
17- The possible statuses are defined as constants:
18-
19- * ``STAT_IDLE`` -- no connection and no activity,
20- * ``STAT_CONNECTING`` -- connecting in progress,
21- * ``STAT_WRONG_PASSWORD`` -- failed due to incorrect password,
22- * ``STAT_NO_AP_FOUND`` -- failed because no access point replied,
23- * ``STAT_CONNECT_FAIL`` -- failed due to other problems,
24- * ``STAT_GOT_IP`` -- connection susccessful.
17+ If the ``address`` parameter is provided, sets the address to its value. If
18+ the function is called wihout parameters, returns the current address.
2519
2620.. function:: getaddrinfo((hostname, port, lambda))
2721
@@ -31,6 +25,61 @@ Functions
3125 called with two arguments, first being the hostname being resolved,
3226 second a tuple with information about that hostname.
3327
28+ .. function:: wifi_mode([mode])
29+
30+ Get or set the wireless network operating mode.
31+
32+ If the ``mode`` parameter is provided, sets the mode to its value. If
33+ the function is called wihout parameters, returns the current mode.
34+
35+ The possible modes are defined as constants:
36+
37+ * ``STA_MODE`` -- station mode,
38+ * ``AP_MODE`` -- software access point mode,
39+ * ``STA_AP_MODE`` -- mixed station and software access point mode.
40+
41+ .. function:: phy_mode([mode])
42+
43+ Get or set the network interface mode.
44+
45+ If the ``mode`` parameter is provided, sets the mode to its value. If
46+ the function is called wihout parameters, returns the current mode.
47+
48+ The possible modes are defined as constants:
49+ * ``MODE_11B`` -- IEEE 802.11b,
50+ * ``MODE_11G`` -- IEEE 802.11g,
51+ * ``MODE_11N`` -- IEEE 802.11n.
52+
53+ .. function:: sleep_type([sleep_type])
54+
55+ Get or set the sleep type.
56+
57+ If the ``sleep_type`` parameter is provided, sets the sleep type to its
58+ value. If the function is called wihout parameters, returns the current
59+ sleep type.
60+
61+ The possible sleep types are defined as constants:
62+
63+ * ``SLEEP_NONE`` -- all functions enabled,
64+ * ``SLEEP_MODEM`` -- modem sleep, shuts down the WiFi Modem circuit.
65+ * ``SLEEP_LIGHT`` -- light sleep, shuts down the WiFi Modem circuit
66+ and suspends the processor periodically.
67+
68+ The system enters the set sleep mode automatically when possible.
69+
70+ .. function:: deepsleep(time=0)
71+
72+ Enter deep sleep.
73+
74+ The whole module powers down, except for the RTC clock circuit, which can
75+ be used to restart the module after the specified time if the pin 16 is
76+ connected to the reset pin. Otherwise the module will sleep until manually
77+ reset.
78+
79+ .. function:: flash_id()
80+
81+ Read the device ID of the flash memory.
82+
3483Classes
3584-------
3685
0 commit comments