| | |
| | | if (MainApp.theApp.bleManager != null) { |
| | | MainApp.theApp.bleManager.closeBluetoothGatt(); |
| | | } |
| | | mBluetoothService.connectDevice(scanResultList.get(position)); |
| | | mBluetoothService.scanAndConnect5(scanResultList.get(position).getDevice().getAddress()); |
| | | } |
| | | } |
| | | |
| | |
| | | if (ActivityManager.getActivityManager().isActivityExist(BLESearchActivity.this.getClass().getName())) { |
| | | progressDialog.dismiss(); |
| | | } |
| | | Log.d("chonglian","孕妇哨连接断开"); |
| | | Log.d("chonglian", "孕妇哨连接断开"); |
| | | mToatUtils.showSingletonToast("孕妇哨连接断开"); |
| | | EventMessage msg = new EventMessage(); |
| | | msg.setType(AppConfig.GET_BLE_DISCONNECT); |
| | |
| | | |
| | | @Override |
| | | public void onServicesDiscovered() { |
| | | Log.d("chonglian","孕妇哨连接成功"); |
| | | Log.d("chonglian", "孕妇哨连接成功"); |
| | | EventMessage msg = new EventMessage(); |
| | | msg.setType(AppConfig.GET_BLE_SERVICE); |
| | | EventBus.getDefault().postSticky(msg); |