| | |
| | | @Override |
| | | public void onConnecting(BluetoothGatt gatt, int status) { |
| | | BleLog.i("BleGattCallback:onConnectSuccess "); |
| | | |
| | | bluetoothGatt = gatt; |
| | | Iterator iterator = callbackHashMap.entrySet().iterator(); |
| | | while (iterator.hasNext()) { |
| | |
| | | + '\n' + "status: " + status |
| | | + '\n' + "newState: " + newState |
| | | + '\n' + "currentThread: " + Thread.currentThread().getId()); |
| | | |
| | | if (newState == BluetoothGatt.STATE_CONNECTED) { |
| | | connectionState = STATE_CONNECTED; |
| | | onConnectSuccess(gatt, status); |
| | |
| | | Map.Entry entry = (Map.Entry) iterator.next(); |
| | | Object call = entry.getValue(); |
| | | if (call instanceof BluetoothGattCallback) { |
| | | gatt.requestMtu(64); |
| | | ((BluetoothGattCallback) call).onServicesDiscovered(gatt, status); |
| | | } |
| | | } |
| | |
| | | @Override |
| | | public void onCharacteristicWrite(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) { |
| | | BleLog.i("BleGattCallback:onCharacteristicWrite "); |
| | | |
| | | Iterator iterator = callbackHashMap.entrySet().iterator(); |
| | | while (iterator.hasNext()) { |
| | | Map.Entry entry = (Map.Entry) iterator.next(); |
| | |
| | | @Override |
| | | public void onCharacteristicChanged(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) { |
| | | BleLog.i("BleGattCallback:onCharacteristicChanged "); |
| | | |
| | | Iterator iterator = callbackHashMap.entrySet().iterator(); |
| | | while (iterator.hasNext()) { |
| | | Map.Entry entry = (Map.Entry) iterator.next(); |