From 2af636b9461a06fb664b746cb6b6b200da187aa4 Mon Sep 17 00:00:00 2001 From: Greg Date: Wed, 27 Nov 2019 11:46:04 -0500 Subject: [PATCH] Doc updates, add "wantScan" to BleConnect.java so scan starts automatically upon grant of permissions or device enable. --- Ble.jar | Bin 10631 -> 10735 bytes BleConnect.java | 34 +++++++++++++++++++++++++++++++--- README.md | 2 ++ 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/Ble.jar b/Ble.jar index ce0a62498ad82e4ff03c57d7a204752a01f8a370..ff3ef60d5b3459b98dcaa72b91603f03071d79c4 100644 GIT binary patch delta 8781 zcmZvC1yCK$(l!Kl336}?5+HDJhv4q+?yd(2aDuzL+rff+a0~81LvYt{umHjSB=`I4 zd+&GeZq;Sy1=X7t!&7jcADZ(3#Iwp zCga1>{}IBlOn<}%3Nx6G#oWQv-91*#RQ|gPo)BwwY^57ZlqE9C&M5o$~lV7c;aoEklR#OI_Tl{7_paSu`;8# z69o;EQO5&{t4LDo(AiQy0pvq}T}xp%IddGwu9O-PY?S0)odPC@&wti5j<}2~EJC8b zS_g7=WMWRu>&_5n-Q{F-7DIMbML)1YW+(u{EfiZqN3HkCg{!J;*5#g|yBn8t z$bgERyKKFq%v9mnTm+b4zks`8nGYqLis}QqoCci*IR7Lt%CYLRjp;&Y@LR&<@^+Wm zx_T><_)?PZP2k(Kz9%`$71@5~9U}3y40u_FhrZi&6jy+i)Ql+0p8r6!xuh%&fi5IW zP-yo^MM7%P{$(j3EuRvfiGK)n?IS9{LFcAD6HuVAGxx6k(34HEY`T1<;2d`^tH%>% z-`TkT5?t(|gzcDAln7hHusG{|XPes~TKSAnWz0Yk%X6qy_!2HyD+?-xW)G6?vFGg| zq@iLKKSv#4s>mZDo9mm2B*MbLw7-IZ`KN{d*e=-{4iBt<-fX0Yp;HN<@WaMKh>lXh z*YH!$E-{SkNN~7rl(={$ds`AIC^Mr3y& zwZ=6c|h5%;y-qE&@bbP{b!my|T9lC*$!ZH>uK)<7t@<9Emb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DP_Zx}20H=2a| zfW>x-*mv?b9y-YiwsrlPGB}(L5r(duR^u#qR4ldCJz%@yYG=3;srX*ex9)2fT2Qac zg^R=UZ=C`?&nc>Jn1?+-+vL*jI@r5eOIg(@9ICrVJs%br-ZR>ZakBzIx>V=1JKhVB zH2>tu{g9S;Z(u8(L}F8bEl?d_PhHl8f7`f{U`o(8yFy;=2D+83E*HFgVJkCn=sC1( zbFuR({O;ATSDVU9OJ9onCx1$ydt`})d^{v15&HiqfgZcbP~m@7+!;Cxu8+MhsR=Yb zcYOXeW1M_6REN0z&`=6O;%AIZ`Jo)^!H>NMifR-8nIm7OcQC(I)GLlI?k}XLqaKx; zALr&gx9gf$ph3SeR(V}(30Fbd{N1cSv+yZb0?(PXPUDw;bbS_61zLC%s3WJosezmc@gnSH zr0`i|ggmb5F;UKrvwo+xaWOa3#m8~&edQaEmLVu5*zP#M%t@*^U~e=#a%1{qMyZ;I z33%J1_eG!DDgXZRGRu_u-q?_#3BE+@)%)tOA7on zX*tzwZ;NRj^E`GS-HfcT#S z1hoL!Kk5>|_eXKC3I0)LY@&Zu8k+?6piZF1-yU|#JewlppQr!dI(;mnnUMZ@$)cv5 zveBlPvXlG;{!c^eKY@7Ye}TpS4g6<+;8WSN)Y`8?)*3KpOyc=1BXcd0!29gW$~ZC5yL;f0}>kfBakK~ el9TxF_xsC2N){&>$_4XZ3*(#=7-)b$L;ed0xcRLB diff --git a/BleConnect.java b/BleConnect.java index 49d046d..909857c 100644 --- a/BleConnect.java +++ b/BleConnect.java @@ -31,6 +31,7 @@ public class BleConnect extends Fragment { BluetoothManager manager; BluetoothAdapter adapter; Handler handler; + boolean wantScan = false; final int PERMISSION_REQUEST = 1; @@ -45,13 +46,11 @@ public class BleConnect extends Fragment { Log.d("gio", "BleConnect: onAttach()"); ctx.registerReceiver(receiver, new IntentFilter(BluetoothAdapter.ACTION_STATE_CHANGED)); manager = (BluetoothManager) ctx.getSystemService(ctx.BLUETOOTH_SERVICE); - Log.d("gio", "BleUtil Enable: adapter"); adapter = manager.getAdapter(); handler = new Handler(ctx.getMainLooper()); if (!enabled()) { Log.d("gio", "BleConnect: enabling adapter"); Intent enableBtIntent = new Intent(adapter.ACTION_REQUEST_ENABLE); - Log.d("gio", "BleConnect: handler.post"); handler.post(new Runnable() { public void run() { startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT); @@ -96,9 +95,13 @@ public class BleConnect extends Fragment { }; public void scan() { - if (!enabled()) { + if (!enabled() || getContext().checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) { + Log.d("gio","BleConnect: scan() not enabled or no permissions, wantScan = true"); + wantScan = true; return; } + Log.d("gio","BleConnect: scan() starting scan"); + wantScan = false; handler.post(new Runnable() { public void run() { adapter.startLeScan(scanCallback); @@ -218,6 +221,9 @@ public class BleConnect extends Fragment { switch (resultCode) { case Activity.RESULT_OK: { Log.d("gio", "BleConnect: onActivityResult() -- OK"); + if (wantScan) { + scan(); + } break; } case Activity.RESULT_CANCELED: { @@ -228,6 +234,28 @@ public class BleConnect extends Fragment { } } + @Override + public void onRequestPermissionsResult (int requestCode, String[] permissions, int[] grantResults) { + Log.d("gio", "BleConnect: onRequestPermissionsResult"); + if (requestCode == PERMISSION_REQUEST) { + boolean granted = true; + for (int x : grantResults) { + if (x == PackageManager.PERMISSION_DENIED) { + granted = false; + break; + } + } + if (!granted) { + Log.d("gio", "BleConnect: permissions not granted"); + return; + } + Log.d("gio", "BleConnect: permissions granted"); + if (wantScan) { + scan(); + } + } + } + static private native void installComplete(BleConnect p); static private native void updateState(int s); static private native void onScan(String name, String id, int rssi, BluetoothDevice dev); diff --git a/README.md b/README.md index fc07c55..d42ccc9 100644 --- a/README.md +++ b/README.md @@ -52,3 +52,5 @@ Using Gio, your main event loop will look something like this: } } ``` + +An example heart rate monitor app can be found at [git.wow.st/gmp/hrm](https://git.wow.st/gmp/hrm).