avoid "Already advertising" error
This commit is contained in:
parent
1a7d1d53f6
commit
d12f9a18f1
@ -314,10 +314,11 @@ class BLEHID(AbstractHID):
|
|||||||
_bleio.adapter.erase_bonding()
|
_bleio.adapter.erase_bonding()
|
||||||
|
|
||||||
def start_advertising(self):
|
def start_advertising(self):
|
||||||
advertisement = ProvideServicesAdvertisement(self.hid)
|
if not self.ble.advertising:
|
||||||
advertisement.appearance = self.BLE_APPEARANCE_HID_KEYBOARD
|
advertisement = ProvideServicesAdvertisement(self.hid)
|
||||||
|
advertisement.appearance = self.BLE_APPEARANCE_HID_KEYBOARD
|
||||||
|
|
||||||
self.ble.start_advertising(advertisement)
|
self.ble.start_advertising(advertisement)
|
||||||
|
|
||||||
def stop_advertising(self):
|
def stop_advertising(self):
|
||||||
self.ble.stop_advertising()
|
self.ble.stop_advertising()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user