src/eric7/MicroPython/Devices/DeviceBase.py

branch
mpy_network
changeset 9855
c9244db5566a
parent 9853
080e060a0383
child 9857
0122ae72618d
equal deleted inserted replaced
9854:c1e298e5c588 9855:c9244db5566a
73 <li>scanNetworks: scan for available WiFi networks</li> 73 <li>scanNetworks: scan for available WiFi networks</li>
74 <li>deactivateInterface: deactivate a WiFi interface</li> 74 <li>deactivateInterface: deactivate a WiFi interface</li>
75 <li>startAccessPoint: start an access point</li> 75 <li>startAccessPoint: start an access point</li>
76 <li>stopAccessPoint: stop the access point</li> 76 <li>stopAccessPoint: stop the access point</li>
77 <li>getConnectedClients: get a list of connected WiFi clients</li> 77 <li>getConnectedClients: get a list of connected WiFi clients</li>
78 </ul>
79
80 Supported Bluetooth commands are:
81 <ul>
82 <li>hasBluetooth: check, if the board has Bluetooth functionality</li>
83 <li>getBluetoothStatus: get Bluetooth status data</li>
84 <li>deactivateBluetoothInterface: deactivate a Bluetooth interface</li>
78 </ul> 85 </ul>
79 """ 86 """
80 87
81 def __init__(self, microPythonWidget, deviceType, parent=None): 88 def __init__(self, microPythonWidget, deviceType, parent=None):
82 """ 89 """
1464 @return flag indicating the availability of Bluetooth 1471 @return flag indicating the availability of Bluetooth
1465 @rtype bool 1472 @rtype bool
1466 """ 1473 """
1467 return False 1474 return False
1468 1475
1476 def addDeviceBluetoothEntries(self, menu):
1477 """
1478 Public method to add device specific entries to the given menu.
1479
1480 @param menu reference to the context menu
1481 @type QMenu
1482 """
1483 pass
1484
1485 def getBluetoothStatus(self):
1486 """
1487 Public method to get Bluetooth status data of the connected board.
1488
1489 @return list of tuples containing the translated status data label and
1490 the associated value
1491 @rtype list of tuples of (str, str)
1492 """
1493 return []
1494
1495 def activateBluetoothInterface(self):
1496 """
1497 Public method to activate the Bluetooth interface.
1498
1499 @return flag indicating the new state of the Bluetooth interface
1500 @rtype bool
1501 """
1502 return False
1503
1504 def deactivateBluetoothInterface(self):
1505 """
1506 Public method to deactivate the Bluetooth interface.
1507
1508 @return flag indicating the new state of the Bluetooth interface
1509 @rtype bool
1510 """
1511 return False
1512
1513 ##################################################################
1514 ## Methods below implement some utility methods
1515 ##################################################################
1516
1517 def bool2str(self, val, capitalized=True):
1518 """
1519 Public method to generate a yes/no string given a truth value.
1520
1521 @param val truth value to be converted
1522 @type bool
1523 @param capitalized flag indicating a capitalized variant
1524 @type bool
1525 @return string with 'yes' or 'no'
1526 @rtype str
1527 """
1528 if capitalized:
1529 return self.tr("Yes") if val else self.tr("No")
1530 else:
1531 return self.tr("yes") if val else self.tr("no")
1469 1532
1470 # 1533 #
1471 # eflag: noqa = M613 1534 # eflag: noqa = M613

eric ide

mercurial