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: U100 |
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 |
1408 @param _deviceType type of board to sync time to (unused) |
1409 @type str |
1409 @type str |
1410 @param hasCPy flag indicating that the device has CircuitPython loadede |
1410 @param hasCPy flag indicating that the device has CircuitPython loadede |
1411 (defaults to False) |
1411 (defaults to False) (unused) |
1412 @type bool |
1412 @type bool |
1413 @exception OSError raised to indicate an issue with the device |
1413 @exception OSError raised to indicate an issue with the device |
1414 """ |
1414 """ |
1415 setTimeCode = self._getSetTimeCode() |
1415 setTimeCode = self._getSetTimeCode() |
1416 if setTimeCode: |
1416 if setTimeCode: |
1590 |
1590 |
1591 def connectWifi(self, ssid, password, hostname): # noqa: U100 |
1591 def connectWifi(self, ssid, password, hostname): # noqa: U100 |
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 |
1595 @param ssid name (SSID) of the WiFi network (unused) |
1596 @type str |
1596 @type str |
1597 @param password password needed to connect |
1597 @param password password needed to connect (unused) |
1598 @type str |
1598 @type str |
1599 @param hostname host name of the device |
1599 @param hostname host name of the device (unused) |
1600 @type str |
1600 @type str |
1601 @return tuple containing the connection status and an error string |
1601 @return tuple containing the connection status and an error string |
1602 @rtype tuple of (bool, str) |
1602 @rtype tuple of (bool, str) |
1603 """ |
1603 """ |
1604 return False, self.tr("Operation not supported.") |
1604 return False, self.tr("Operation not supported.") |
1633 def writeCredentials(self, ssid, password, hostname, country): # noqa: U100 |
1633 def writeCredentials(self, ssid, password, hostname, country): # noqa: U100 |
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 |
1638 @param ssid SSID of the network to connect to (unused) |
1639 @type str |
1639 @type str |
1640 @param password password needed to authenticate |
1640 @param password password needed to authenticate (unused) |
1641 @type str |
1641 @type str |
1642 @param hostname host name of the device |
1642 @param hostname host name of the device (unused) |
1643 @type str |
1643 @type str |
1644 @param country WiFi country code |
1644 @param country WiFi country code (unused) |
1645 @type str |
1645 @type str |
1646 @return tuple containing a flag indicating success and an error message |
1646 @return tuple containing a flag indicating success and an error message |
1647 @rtype tuple of (bool, str) |
1647 @rtype tuple of (bool, str) |
1648 """ |
1648 """ |
1649 return False, "" |
1649 return False, "" |
1679 def deactivateInterface(self, interface): # noqa: U100 |
1679 def deactivateInterface(self, interface): # noqa: U100 |
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') |
1684 or 'STA') (unused) |
1685 @type str |
1685 @type str |
1686 @return tuple containg a flag indicating success and an error message |
1686 @return tuple containg a flag indicating success and an error message |
1687 @rtype tuple of (bool, str) |
1687 @rtype tuple of (bool, str) |
1688 """ |
1688 """ |
1689 return True, "" |
1689 return True, "" |
1697 ifconfig=None, # noqa: U100 |
1697 ifconfig=None, # noqa: U100 |
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 |
1702 @param ssid SSID of the access point (unused) |
1703 @type str |
1703 @type str |
1704 @param security security method (defaults to None) |
1704 @param security security method (defaults to None) (unused) |
1705 @type int (optional) |
1705 @type int (optional) |
1706 @param password password (defaults to None) |
1706 @param password password (defaults to None) (unused) |
1707 @type str (optional) |
1707 @type str (optional) |
1708 @param hostname host name of the device (defaults to None) |
1708 @param hostname host name of the device (defaults to None) (unused) |
1709 @type str (optional) |
1709 @type str (optional) |
1710 @param ifconfig IPv4 configuration for the access point if not default |
1710 @param ifconfig IPv4 configuration for the access point if not default |
1711 (IPv4 address, netmask, gateway address, DNS server address) |
1711 (IPv4 address, netmask, gateway address, DNS server address) (unused) |
1712 @type tuple of (str, str, str, str) |
1712 @type tuple of (str, str, str, str) |
1713 @return tuple containing a flag indicating success and an error message |
1713 @return tuple containing a flag indicating success and an error message |
1714 @rtype tuple of (bool, str) |
1714 @rtype tuple of (bool, str) |
1715 """ |
1715 """ |
1716 return False, "" |
1716 return False, "" |
1737 def enableWebrepl(self, password): # noqa: U100 |
1737 def enableWebrepl(self, password): # noqa: U100 |
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 |
1742 @param password password needed to authenticate (unused) |
1743 @type str |
1743 @type str |
1744 @return tuple containing a flag indicating success and an error message |
1744 @return tuple containing a flag indicating success and an error message |
1745 @rtype tuple of (bool, str) |
1745 @rtype tuple of (bool, str) |
1746 """ |
1746 """ |
1747 return False, "" |
1747 return False, "" |
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. |
|
1798 (unused) |
1798 @type str or tuple of (str, str, str, str) |
1799 @type str or tuple of (str, str, str, str) |
1799 @param hostname host name of the device |
1800 @param hostname host name of the device (unused) |
1800 @type str |
1801 @type str |
1801 @return tuple containing a flag indicating success and an error message |
1802 @return tuple containing a flag indicating success and an error message |
1802 @rtype tuple of (bool, str) |
1803 @rtype tuple of (bool, str) |
1803 """ |
1804 """ |
1804 return False, "" |
1805 return False, "" |
1844 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 |
1845 device to the LAN during boot time. |
1846 device to the LAN during boot time. |
1846 |
1847 |
1847 @param config configuration for the connection (either the string 'dhcp' |
1848 @param config configuration for the connection (either the string 'dhcp' |
1848 for a dynamic address or a tuple of four strings with the IPv4 parameters. |
1849 for a dynamic address or a tuple of four strings with the IPv4 parameters. |
|
1850 (unused) |
1849 @type str or tuple of (str, str, str, str) |
1851 @type str or tuple of (str, str, str, str) |
1850 @param hostname host name of the device |
1852 @param hostname host name of the device (unused) |
1851 @type str |
1853 @type str |
1852 @return tuple containing a flag indicating success and an error message |
1854 @return tuple containing a flag indicating success and an error message |
1853 @rtype tuple of (bool, str) |
1855 @rtype tuple of (bool, str) |
1854 """ |
1856 """ |
1855 return False, "" |
1857 return False, "" |
1918 def getDeviceScan(self, timeout=10): # noqa: U100 |
1920 def getDeviceScan(self, timeout=10): # noqa: U100 |
1919 """ |
1921 """ |
1920 Public method to perform a Bluetooth device scan. |
1922 Public method to perform a Bluetooth device scan. |
1921 |
1923 |
1922 @param timeout duration of the device scan in seconds (defaults |
1924 @param timeout duration of the device scan in seconds (defaults |
1923 to 10) |
1925 to 10) (unused) |
1924 @type int (optional) |
1926 @type int (optional) |
1925 @return tuple containing a dictionary with the scan results and |
1927 @return tuple containing a dictionary with the scan results and |
1926 an error string |
1928 an error string |
1927 @rtype tuple of (dict, str) |
1929 @rtype tuple of (dict, str) |
1928 """ |
1930 """ |
1947 """ |
1949 """ |
1948 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 |
1949 NTP server. |
1951 NTP server. |
1950 |
1952 |
1951 @param server name of the NTP server to get the network time from |
1953 @param server name of the NTP server to get the network time from |
1952 (defaults to "0.pool.ntp.org") |
1954 (defaults to "0.pool.ntp.org") (unused) |
1953 @type str (optional) |
1955 @type str (optional) |
1954 @param tzOffset offset with respect to UTC (defaults to 0) |
1956 @param tzOffset offset with respect to UTC (defaults to 0) (unused) |
1955 @type int (optional) |
1957 @type int (optional) |
1956 @param timeout maximum time to wait for a server response in seconds |
1958 @param timeout maximum time to wait for a server response in seconds |
1957 (defaults to 10) |
1959 (defaults to 10) (unused) |
1958 @type int |
1960 @type int |
1959 @return tuple containing a flag indicating success and an error string |
1961 @return tuple containing a flag indicating success and an error string |
1960 @rtype tuple of (bool, str) |
1962 @rtype tuple of (bool, str) |
1961 """ |
1963 """ |
1962 return False, "" |
1964 return False, "" |