weliem / blessed-android

BLESSED, a Bluetooth Low Energy (BLE) library for Android
MIT License
557 stars 119 forks source link

BluetoothPeripheralManager.close() doesn't stop advertising #143

Closed matthewkrueger closed 2 years ago

matthewkrueger commented 2 years ago

Hello - thanks for your wonderful library! Lately I'm noticing that when I call BluetoothPeripheralManager.close() that advertising does not actually stop - I continue to receive scan results on another device.

I tried to trace through the code and BluetoothLeAdvertiser.java in the stopAdvertising method returns on:

if (wrapper == null) return;

which then stops it from calling:

mLegacyAdvertisers.remove(callback);

How does one properly stop advertising using your library? Thank you!

weliem commented 2 years ago

In my application I simple call stopAdvertising() and that seems to work fine.

Do you have any log you could share?

matthewkrueger commented 2 years ago

Sorry it turned out that I was calling start again after calling close due to a misbehaving listener. Closed this task, my issue not yours!