connection - Ble Device not connect to peripheral randomly android -


i'm using ble service connect peripheral have strange problem connection times following method not connect device , times works ratio 10:1

private void scanledevice(final boolean enable) {     if (enable) {         mhandler.postdelayed(new runnable() {             @override             public void run() {                 mbluetoothadapter.stoplescan(mlescancallback);                 connecttoperipheral();             }         }, 15000);         mbluetoothadapter.startlescan(mlescancallback);     } else {         mbluetoothadapter.stoplescan(mlescancallback);     } }  method connecttoperipheral connection , data receiving,i stuck problem since long time don't have idea why happening if kill app connect still have same problem.is problem of advertising delay?  


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -