src/eric7/MicroPython/Devices/EspDevices.py

branch
mpy_network
changeset 9857
0122ae72618d
parent 9855
c9244db5566a
child 9859
829c1edbf253
equal deleted inserted replaced
9856:df2ff78bbc01 9857:0122ae72618d
1046 """ 1046 """
1047 Public method to check the availability of Bluetooth. 1047 Public method to check the availability of Bluetooth.
1048 1048
1049 @return flag indicating the availability of Bluetooth 1049 @return flag indicating the availability of Bluetooth
1050 @rtype bool 1050 @rtype bool
1051 @exception OSError raised to indicate an issue with the device
1051 """ 1052 """
1052 command = """ 1053 command = """
1053 def has_bt(): 1054 def has_bt():
1054 try: 1055 try:
1055 import bluetooth 1056 import bluetooth
1075 Public method to get Bluetooth status data of the connected board. 1076 Public method to get Bluetooth status data of the connected board.
1076 1077
1077 @return list of tuples containing the translated status data label and 1078 @return list of tuples containing the translated status data label and
1078 the associated value 1079 the associated value
1079 @rtype list of tuples of (str, str) 1080 @rtype list of tuples of (str, str)
1081 @exception OSError raised to indicate an issue with the device
1080 """ 1082 """
1081 command = """ 1083 command = """
1082 def ble_status(): 1084 def ble_status():
1083 import bluetooth 1085 import bluetooth
1084 import ubinascii 1086 import ubinascii
1123 ) 1125 )
1124 ) 1126 )
1125 status.append( 1127 status.append(
1126 (self.tr("Rx-Buffer"), self.tr("{0} Bytes").format(bleStatus["rxbuf"])) 1128 (self.tr("Rx-Buffer"), self.tr("{0} Bytes").format(bleStatus["rxbuf"]))
1127 ) 1129 )
1128 status.append( 1130 status.append((self.tr("MTU"), self.tr("{0} Bytes").format(bleStatus["mtu"])))
1129 (self.tr("MTU"), self.tr("{0} Bytes").format(bleStatus["mtu"]))
1130 )
1131 1131
1132 return status 1132 return status
1133 1133
1134 def activateBluetoothInterface(self): 1134 def activateBluetoothInterface(self):
1135 """ 1135 """
1136 Public method to activate the Bluetooth interface. 1136 Public method to activate the Bluetooth interface.
1137 1137
1138 @return flag indicating the new state of the Bluetooth interface 1138 @return flag indicating the new state of the Bluetooth interface
1139 @rtype bool 1139 @rtype bool
1140 @exception OSError raised to indicate an issue with the device
1140 """ 1141 """
1141 command = """ 1142 command = """
1142 def activate_ble(): 1143 def activate_ble():
1143 import bluetooth 1144 import bluetooth
1144 1145
1160 """ 1161 """
1161 Public method to deactivate the Bluetooth interface. 1162 Public method to deactivate the Bluetooth interface.
1162 1163
1163 @return flag indicating the new state of the Bluetooth interface 1164 @return flag indicating the new state of the Bluetooth interface
1164 @rtype bool 1165 @rtype bool
1166 @exception OSError raised to indicate an issue with the device
1165 """ 1167 """
1166 command = """ 1168 command = """
1167 def deactivate_ble(): 1169 def deactivate_ble():
1168 import bluetooth 1170 import bluetooth
1169 1171

eric ide

mercurial