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