src/eric7/MicroPython/Devices/DeviceBase.py

branch
eric7
changeset 10069
435cc5875135
parent 10034
bf2d02317ba6
child 10083
62019277dd0a
equal deleted inserted replaced
10068:7febcdccb2a1 10069:435cc5875135
1319 clock.datetime = time.struct_time(clock_time) 1319 clock.datetime = time.struct_time(clock_time)
1320 """ 1320 """
1321 else: 1321 else:
1322 return "" 1322 return ""
1323 1323
1324 def syncTime(self, deviceType, hasCPy=False): 1324 def syncTime(self, deviceType, hasCPy=False): # noqa: U100
1325 """ 1325 """
1326 Public method to set the time of the connected device to the local 1326 Public method to set the time of the connected device to the local
1327 computer's time. 1327 computer's time.
1328 1328
1329 @param deviceType type of board to sync time to 1329 @param deviceType type of board to sync time to
1474 for the WiFi client, access point and overall data 1474 for the WiFi client, access point and overall data
1475 @rtype tuple of (dict, dict, dict) 1475 @rtype tuple of (dict, dict, dict)
1476 """ 1476 """
1477 return {}, {}, {} 1477 return {}, {}, {}
1478 1478
1479 def connectWifi(self, ssid, password): 1479 def connectWifi(self, ssid, password): # noqa: U100
1480 """ 1480 """
1481 Public method to connect a device to a WiFi network. 1481 Public method to connect a device to a WiFi network.
1482 1482
1483 @param ssid name (SSID) of the WiFi network 1483 @param ssid name (SSID) of the WiFi network
1484 @type str 1484 @type str
1496 @return tuple containing a flag indicating success and an error string 1496 @return tuple containing a flag indicating success and an error string
1497 @rtype tuple of (bool, str) 1497 @rtype tuple of (bool, str)
1498 """ 1498 """
1499 return True, "" 1499 return True, ""
1500 1500
1501 def writeCredentials(self, ssid, password): 1501 def writeCredentials(self, ssid, password): # noqa: U100
1502 """ 1502 """
1503 Public method to write the given credentials to the connected device and modify 1503 Public method to write the given credentials to the connected device and modify
1504 the start script to connect automatically. 1504 the start script to connect automatically.
1505 1505
1506 @param ssid SSID of the network to connect to 1506 @param ssid SSID of the network to connect to
1538 'MAC-Address', 'channel', 'RSSI' and 'security' and an error string 1538 'MAC-Address', 'channel', 'RSSI' and 'security' and an error string
1539 @rtype tuple of (list of tuple of (str, str, int, int, str), str) 1539 @rtype tuple of (list of tuple of (str, str, int, int, str), str)
1540 """ 1540 """
1541 return [], "" 1541 return [], ""
1542 1542
1543 def deactivateInterface(self, interface): 1543 def deactivateInterface(self, interface): # noqa: U100
1544 """ 1544 """
1545 Public method to deactivate a given WiFi interface of the connected device. 1545 Public method to deactivate a given WiFi interface of the connected device.
1546 1546
1547 @param interface designation of the interface to be deactivated (one of 'AP' 1547 @param interface designation of the interface to be deactivated (one of 'AP'
1548 or 'STA') 1548 or 'STA')
1550 @return tuple containg a flag indicating success and an error message 1550 @return tuple containg a flag indicating success and an error message
1551 @rtype tuple of (bool, str) 1551 @rtype tuple of (bool, str)
1552 """ 1552 """
1553 return True, "" 1553 return True, ""
1554 1554
1555 def startAccessPoint(self, ssid, security=None, password=None, ifconfig=None): 1555 def startAccessPoint(
1556 self, ssid, security=None, password=None, ifconfig=None # noqa: U100
1557 ):
1556 """ 1558 """
1557 Public method to start the access point interface. 1559 Public method to start the access point interface.
1558 1560
1559 @param ssid SSID of the access point 1561 @param ssid SSID of the access point
1560 @type str 1562 @type str
1587 and the RSSI (if supported and available) and an error message 1589 and the RSSI (if supported and available) and an error message
1588 @rtype tuple of ([(bytes, int)], str) 1590 @rtype tuple of ([(bytes, int)], str)
1589 """ 1591 """
1590 return [], "" 1592 return [], ""
1591 1593
1592 def enableWebrepl(self, password): 1594 def enableWebrepl(self, password): # noqa: U100
1593 """ 1595 """
1594 Public method to write the given WebREPL password to the connected device and 1596 Public method to write the given WebREPL password to the connected device and
1595 modify the start script to start the WebREPL server. 1597 modify the start script to start the WebREPL server.
1596 1598
1597 @param password password needed to authenticate 1599 @param password password needed to authenticate
1642 the associated value 1644 the associated value
1643 @rtype list of tuples of (str, str) 1645 @rtype list of tuples of (str, str)
1644 """ 1646 """
1645 return [] 1647 return []
1646 1648
1647 def connectToLan(self, config): 1649 def connectToLan(self, config): # noqa: U100
1648 """ 1650 """
1649 Public method to connect the connected device to the LAN. 1651 Public method to connect the connected device to the LAN.
1650 1652
1651 @param config configuration for the connection (either the string 'dhcp' 1653 @param config configuration for the connection (either the string 'dhcp'
1652 for a dynamic address or a tuple of four strings with the IPv4 parameters. 1654 for a dynamic address or a tuple of four strings with the IPv4 parameters.
1681 @return tuple containg a flag indicating success and an error message 1683 @return tuple containg a flag indicating success and an error message
1682 @rtype tuple of (bool, str) 1684 @rtype tuple of (bool, str)
1683 """ 1685 """
1684 return True, "" 1686 return True, ""
1685 1687
1686 def writeLanAutoConnect(self, config): 1688 def writeLanAutoConnect(self, config): # noqa: U100
1687 """ 1689 """
1688 Public method to generate a script and associated configuration to connect the 1690 Public method to generate a script and associated configuration to connect the
1689 device to the LAN during boot time. 1691 device to the LAN during boot time.
1690 1692
1691 @param config configuration for the connection (either the string 'dhcp' 1693 @param config configuration for the connection (either the string 'dhcp'
1755 @return flag indicating the new state of the Bluetooth interface 1757 @return flag indicating the new state of the Bluetooth interface
1756 @rtype bool 1758 @rtype bool
1757 """ 1759 """
1758 return False 1760 return False
1759 1761
1760 def getDeviceScan(self, timeout=10): 1762 def getDeviceScan(self, timeout=10): # noqa: U100
1761 """ 1763 """
1762 Public method to perform a Bluetooth device scan. 1764 Public method to perform a Bluetooth device scan.
1763 1765
1764 @param timeout duration of the device scan in seconds (defaults 1766 @param timeout duration of the device scan in seconds (defaults
1765 to 10) 1767 to 10)
1781 @return flag indicating the availability of network time functions 1783 @return flag indicating the availability of network time functions
1782 @rtype bool 1784 @rtype bool
1783 """ 1785 """
1784 return False 1786 return False
1785 1787
1786 def setNetworkTime(self, server="pool.ntp.org", tzOffset=0, timeout=10): 1788 def setNetworkTime(
1789 self, server="pool.ntp.org", tzOffset=0, timeout=10 # noqa: U100
1790 ):
1787 """ 1791 """
1788 Public method to set the time to the network time retrieved from an 1792 Public method to set the time to the network time retrieved from an
1789 NTP server. 1793 NTP server.
1790 1794
1791 @param server name of the NTP server to get the network time from 1795 @param server name of the NTP server to get the network time from

eric ide

mercurial