:mod:`lanclient` -- Ethernet LAN connection manager =================================================== .. module:: lanclient :synopsis: LAN (over Ethernet) connection manager. .. note:: A global instance of the `NetworkManager` is instantiated in this module. It is strongly recommended to use this instance instead of creating a new one. Import a global instance like this:: from lanclient import nmcli Classes ------- .. class:: NetworkManager() .. property:: ssid Returns 'LAN' (constant value). This property has no meaning for this module and is provided for compatibility with the `wificlient` module. .. property:: connected Returns the LAN client connection status (``True`` if the LAN IC is power on and has a valid IP). .. property:: ip Returns the IP of the board (as a string), or ``0.0.0.0``. .. method:: off() Deactivates the LAN IC. The method safely be called more than once. .. method:: ifconfig() Returns a tuple of ``(ip, netmask, gateway, dns)`` or ``None`` .. method:: defaults() Configures the default connection: static ip ``192.168.1.1`` with ``255.255.255.0`` netmask. .. method:: connect() :async: Tries to acquire a dynamic IP (if enabled in by the board config), or to set a static IP from the board config (if DHCP is disabled). In case of error, the default config is used (ref :meth:`~lanclient.NetworkManager.defaults()`). .. method:: watcher() :async: This is a stub (does nothing). Provided for compatibility with the `wificlient` module.