summaryrefslogtreecommitdiffstatshomepage
path: root/docs/library/esp.rst
blob: 8dd39f536fa9059de3c305e423b8690be86e600a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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