diff options
author | Radomir Dopieralski <openstack@sheep.art.pl> | 2015-05-26 23:34:31 +0200 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-05-30 12:49:58 +0100 |
commit | 78ccb44a90584387dba6cfbdaa19fb651a6f64ab (patch) | |
tree | b885ce8fba8a0bb63025cdc679e2e37cea23b289 /docs/library/esp.rst | |
parent | 278d22ce8f9c5b51778f70d36088a986f1b6adc8 (diff) | |
download | micropython-78ccb44a90584387dba6cfbdaa19fb651a6f64ab.tar.gz micropython-78ccb44a90584387dba6cfbdaa19fb651a6f64ab.zip |
docs: Document esp module for ESP8266.
I document as much as I could guess from experiments and reading the
code for the ``esp`` module for the ESP8266 port of Micropython.
For now the tag has to be set manually with -t option when building,
when we have properly split documentation, there will be a separate
config file for esp8266 with that the tag "port_esp8266" set.
To build use:
make SPHINXOPTS="-t port_esp8266" html
Diffstat (limited to 'docs/library/esp.rst')
-rw-r--r-- | docs/library/esp.rst | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/docs/library/esp.rst b/docs/library/esp.rst new file mode 100644 index 0000000000..8dd39f536f --- /dev/null +++ b/docs/library/esp.rst @@ -0,0 +1,56 @@ +:mod:`esp` --- functions related to the ESP8266 +=============================================== + +.. module:: esp + :synopsis: functions related to the ESP8266 + +The ``esp`` module contains specific functions related to the ESP8266 module. + + +Functions +--------- + +.. function:: connect(ssid, password) + + Connect to the specified wireless network, using the specified password. + +.. function:: disconnect() + + Disconnect from the currently connected wireless network. + +.. function:: scan(cb) + + Initiate scanning for the available wireless networks. + + Once the scanning is complete, the provided callback function ``cb`` will + be called once for each network found, and passed a tuple with information + about that network. + +.. function:: status() + + Return the current status of the wireless connection. + + The possible statuses are defined as constants: + + * ``STAT_IDLE`` -- no connection and no activity, + * ``STAT_CONNECTING`` -- connecting in progress, + * ``STAT_WRONG_PASSWORD`` -- failed due to incorrect password, + * ``STAT_NO_AP_FOUND`` -- failed because no access point replied, + * ``STAT_CONNECT_FAIL`` -- failed due to other problems, + * ``STAT_GOT_IP`` -- connection susccessful. + +.. function:: getaddrinfo((hostname, port, lambda)) + + Initiate resolving of the given hostname. + + When the hostname is resolved, the provided ``lambda`` callback will be + called with two arguments, first being the hostname being resolved, + second a tuple with information about that hostname. + +Classes +------- + +.. toctree:: + :maxdepth: 1 + + esp.socket.rst |