79 |
79 |
80 Supported Bluetooth commands are: |
80 Supported Bluetooth commands are: |
81 <ul> |
81 <ul> |
82 <li>hasBluetooth: check, if the board has Bluetooth functionality</li> |
82 <li>hasBluetooth: check, if the board has Bluetooth functionality</li> |
83 <li>getBluetoothStatus: get Bluetooth status data</li> |
83 <li>getBluetoothStatus: get Bluetooth status data</li> |
|
84 <li>activateBluetoothInterface: activate a Bluetooth interface</li> |
84 <li>deactivateBluetoothInterface: deactivate a Bluetooth interface</li> |
85 <li>deactivateBluetoothInterface: deactivate a Bluetooth interface</li> |
|
86 <li>getDeviceScan: scan for visible Bluetooth devices</li> |
|
87 </ul> |
|
88 |
|
89 Supported Ethernet commands are: |
|
90 <ul> |
|
91 <li>hasEthernet: check, if the board has Ethernet functionality |
|
92 <li>getEthernetStatus: get Ethernet status data |
|
93 <li>connectToLan: connect to an Ethernet network |
|
94 <li>disconnectFromLan: disconnect from an Ethernet network |
|
95 <li>checkInternetViaLan: check, if internet access via LAN is possible |
|
96 <li>deactivateEthernet: deactivate the Ethernet interface |
|
97 <li>writeLanAutoConnect: save IPv4 parameters to the board and create a script |
|
98 to connect the board to the LAN |
|
99 <li>removeLanAutoConnect: remove the IPv4 parameters and script from the board |
85 </ul> |
100 </ul> |
86 """ |
101 """ |
87 |
102 |
88 def __init__(self, microPythonWidget, deviceType, parent=None): |
103 def __init__(self, microPythonWidget, deviceType, parent=None): |
89 """ |
104 """ |
573 try: |
588 try: |
574 files = __os_.listdir(dirname) |
589 files = __os_.listdir(dirname) |
575 except OSError: |
590 except OSError: |
576 return [] |
591 return [] |
577 if dirname in ('', '/'): |
592 if dirname in ('', '/'): |
578 return list((f, stat(f)) for f in files if is_visible(f, showHidden)) |
593 return list((f, stat(dirname + f)) for f in files if is_visible(f, showHidden)) |
579 return list( |
594 return list( |
580 (f, stat(dirname + '/' + f)) for f in files if is_visible(f, showHidden) |
595 (f, stat(dirname + '/' + f)) for f in files if is_visible(f, showHidden) |
581 ) |
596 ) |
582 |
597 |
583 print(listdir_stat('{0}', {1})) |
598 print(listdir_stat('{0}', {1})) |
1621 @return flag indicating the availability of network time functions |
1636 @return flag indicating the availability of network time functions |
1622 @rtype bool |
1637 @rtype bool |
1623 """ |
1638 """ |
1624 return False |
1639 return False |
1625 |
1640 |
1626 def setNetworkTime(self, server="0.pool.ntp.org", tzOffset=0, timeout=10): |
1641 def setNetworkTime(self, server="pool.ntp.org", tzOffset=0, timeout=10): |
1627 """ |
1642 """ |
1628 Public method to set the time to the network time retrieved from an |
1643 Public method to set the time to the network time retrieved from an |
1629 NTP server. |
1644 NTP server. |
1630 |
1645 |
1631 @param server name of the NTP server to get the network time from |
1646 @param server name of the NTP server to get the network time from |