iDevicesInc / SweetBlue

BLE on Android, the easy way. THIS IS NOW DEPRECATED. Please visit website for info on new versions.
https://sweetblue.io
GNU General Public License v3.0
357 stars 57 forks source link

Sometimes BleServer Incoming listener not calling #417

Open ryadav3 opened 6 years ago

ryadav3 commented 6 years ago

Hi,

I am using SweetBlue library for one of our app and facing some issues with BleServer Incoming listener because it not receiving any callback even if BLE device is connected.

Please help.

Thanks.

ryanhubbell commented 6 years ago

Could you give more details please? When I use the BleServer, I get callbacks in the incoming listener. BTW, if you put your app on an app store, you're required to get a commercial license (please see the SweetBlue website for more info).

ryadav3 commented 6 years ago

@ryanidev Here is the code snippet which we are using to add services:

mBleServer = BleManager.get(context).getServer(getGattDatabase());

private GattDatabase getGattDatabase() { return new GattDatabase() .addService(MY_SERVICE_UUID) .addCharacteristic(MY_CHARACTERISTIC_UUID) .setProperties().write_no_response() .setPermissions().write() .completeService(); } It is working most of the time but sometimes incoming listener is not calling, especially when ON/OFF the Bluetooth from device settings.

ryadav3 commented 6 years ago

@ryanidev Please suggest, how we can fix this issue?