src/eric7/MicroPython/Devices/DeviceBase.py

branch
eric7
changeset 11148
15e30f0c76a8
parent 11090
f5f5f5803935
child 11167
a3f5af773bc7
equal deleted inserted replaced
11147:dee6e106b4d3 11148:15e30f0c76a8
1398 clock.datetime = time.struct_time(clock_time) 1398 clock.datetime = time.struct_time(clock_time)
1399 """ 1399 """
1400 else: 1400 else:
1401 return "" 1401 return ""
1402 1402
1403 def syncTime(self, _deviceType, hasCPy=False): # noqa: U100 1403 def syncTime(self, _deviceType, hasCPy=False): # noqa: U-100
1404 """ 1404 """
1405 Public method to set the time of the connected device to the local 1405 Public method to set the time of the connected device to the local
1406 computer's time. 1406 computer's time.
1407 1407
1408 @param _deviceType type of board to sync time to (unused) 1408 @param _deviceType type of board to sync time to (unused)
1586 for the WiFi client, access point and overall data 1586 for the WiFi client, access point and overall data
1587 @rtype tuple of (dict, dict, dict) 1587 @rtype tuple of (dict, dict, dict)
1588 """ 1588 """
1589 return {}, {}, {} 1589 return {}, {}, {}
1590 1590
1591 def connectWifi(self, ssid, password, hostname): # noqa: U100 1591 def connectWifi(self, ssid, password, hostname): # noqa: U-100
1592 """ 1592 """
1593 Public method to connect a device to a WiFi network. 1593 Public method to connect a device to a WiFi network.
1594 1594
1595 @param ssid name (SSID) of the WiFi network (unused) 1595 @param ssid name (SSID) of the WiFi network (unused)
1596 @type str 1596 @type str
1628 @return flag indicating the WiFi connection status 1628 @return flag indicating the WiFi connection status
1629 @rtype bool 1629 @rtype bool
1630 """ 1630 """
1631 return False 1631 return False
1632 1632
1633 def writeCredentials(self, ssid, password, hostname, country): # noqa: U100 1633 def writeCredentials(self, ssid, password, hostname, country): # noqa: U-100
1634 """ 1634 """
1635 Public method to write the given credentials to the connected device and modify 1635 Public method to write the given credentials to the connected device and modify
1636 the start script to connect automatically. 1636 the start script to connect automatically.
1637 1637
1638 @param ssid SSID of the network to connect to (unused) 1638 @param ssid SSID of the network to connect to (unused)
1674 'MAC-Address', 'channel', 'RSSI' and 'security' and an error string 1674 'MAC-Address', 'channel', 'RSSI' and 'security' and an error string
1675 @rtype tuple of (list of tuple of (str, str, int, int, str), str) 1675 @rtype tuple of (list of tuple of (str, str, int, int, str), str)
1676 """ 1676 """
1677 return [], "" 1677 return [], ""
1678 1678
1679 def deactivateInterface(self, interface): # noqa: U100 1679 def deactivateInterface(self, interface): # noqa: U-100
1680 """ 1680 """
1681 Public method to deactivate a given WiFi interface of the connected device. 1681 Public method to deactivate a given WiFi interface of the connected device.
1682 1682
1683 @param interface designation of the interface to be deactivated (one of 'AP' 1683 @param interface designation of the interface to be deactivated (one of 'AP'
1684 or 'STA') (unused) 1684 or 'STA') (unused)
1688 """ 1688 """
1689 return True, "" 1689 return True, ""
1690 1690
1691 def startAccessPoint( 1691 def startAccessPoint(
1692 self, 1692 self,
1693 ssid, # noqa: U100 1693 ssid, # noqa: U-100
1694 security=None, # noqa: U100 1694 security=None, # noqa: U-100
1695 password=None, # noqa: U100 1695 password=None, # noqa: U-100
1696 hostname=None, # noqa: U100 1696 hostname=None, # noqa: U-100
1697 ifconfig=None, # noqa: U100 1697 ifconfig=None, # noqa: U-100
1698 ): 1698 ):
1699 """ 1699 """
1700 Public method to start the access point interface. 1700 Public method to start the access point interface.
1701 1701
1702 @param ssid SSID of the access point (unused) 1702 @param ssid SSID of the access point (unused)
1732 and the RSSI (if supported and available) and an error message 1732 and the RSSI (if supported and available) and an error message
1733 @rtype tuple of ([(bytes, int)], str) 1733 @rtype tuple of ([(bytes, int)], str)
1734 """ 1734 """
1735 return [], "" 1735 return [], ""
1736 1736
1737 def enableWebrepl(self, password): # noqa: U100 1737 def enableWebrepl(self, password): # noqa: U-100
1738 """ 1738 """
1739 Public method to write the given WebREPL password to the connected device and 1739 Public method to write the given WebREPL password to the connected device and
1740 modify the start script to start the WebREPL server. 1740 modify the start script to start the WebREPL server.
1741 1741
1742 @param password password needed to authenticate (unused) 1742 @param password password needed to authenticate (unused)
1787 the associated value 1787 the associated value
1788 @rtype list of tuples of (str, str) 1788 @rtype list of tuples of (str, str)
1789 """ 1789 """
1790 return [] 1790 return []
1791 1791
1792 def connectToLan(self, config, hostname): # noqa: U100 1792 def connectToLan(self, config, hostname): # noqa: U-100
1793 """ 1793 """
1794 Public method to connect the connected device to the LAN. 1794 Public method to connect the connected device to the LAN.
1795 1795
1796 @param config configuration for the connection (either the string 'dhcp' 1796 @param config configuration for the connection (either the string 'dhcp'
1797 for a dynamic address or a tuple of four strings with the IPv4 parameters. 1797 for a dynamic address or a tuple of four strings with the IPv4 parameters.
1838 @return tuple containg a flag indicating success and an error message 1838 @return tuple containg a flag indicating success and an error message
1839 @rtype tuple of (bool, str) 1839 @rtype tuple of (bool, str)
1840 """ 1840 """
1841 return True, "" 1841 return True, ""
1842 1842
1843 def writeLanAutoConnect(self, config, hostname): # noqa: U100 1843 def writeLanAutoConnect(self, config, hostname): # noqa: U-100
1844 """ 1844 """
1845 Public method to generate a script and associated configuration to connect the 1845 Public method to generate a script and associated configuration to connect the
1846 device to the LAN during boot time. 1846 device to the LAN during boot time.
1847 1847
1848 @param config configuration for the connection (either the string 'dhcp' 1848 @param config configuration for the connection (either the string 'dhcp'
1915 @return flag indicating the new state of the Bluetooth interface 1915 @return flag indicating the new state of the Bluetooth interface
1916 @rtype bool 1916 @rtype bool
1917 """ 1917 """
1918 return False 1918 return False
1919 1919
1920 def getDeviceScan(self, timeout=10): # noqa: U100 1920 def getDeviceScan(self, timeout=10): # noqa: U-100
1921 """ 1921 """
1922 Public method to perform a Bluetooth device scan. 1922 Public method to perform a Bluetooth device scan.
1923 1923
1924 @param timeout duration of the device scan in seconds (defaults 1924 @param timeout duration of the device scan in seconds (defaults
1925 to 10) (unused) 1925 to 10) (unused)
1942 @rtype bool 1942 @rtype bool
1943 """ 1943 """
1944 return False 1944 return False
1945 1945
1946 def setNetworkTime( 1946 def setNetworkTime(
1947 self, server="pool.ntp.org", tzOffset=0, timeout=10 # noqa: U100 1947 self, server="pool.ntp.org", tzOffset=0, timeout=10 # noqa: U-100
1948 ): 1948 ):
1949 """ 1949 """
1950 Public method to set the time to the network time retrieved from an 1950 Public method to set the time to the network time retrieved from an
1951 NTP server. 1951 NTP server.
1952 1952
1983 else: 1983 else:
1984 return self.tr("yes") if val else self.tr("no") 1984 return self.tr("yes") if val else self.tr("no")
1985 1985
1986 1986
1987 # 1987 #
1988 # eflag: noqa = M613 1988 # eflag: noqa = M-613

eric ide

mercurial