Created
August 27, 2015 08:16
-
-
Save bitristan/82c22a4b4d6c047028d6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private BluetoothGattCallback mGattCallback = new BluetoothGattCallback() { | |
@Override | |
public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) { | |
super.onConnectionStateChange(gatt, status, newState); | |
Log.v(TAG, "Connection State Changed: " + (newState == BluetoothProfile.STATE_CONNECTED ? "Connected" : "Disconnected")); | |
if (newState == BluetoothProfile.STATE_CONNECTED) { | |
setState(State.CONNECTED); | |
gatt.discoverServices(); | |
} else { | |
setState(State.IDLE); | |
} | |
} | |
@Override | |
public void onServicesDiscovered(BluetoothGatt gatt, | |
int status) { | |
if (status == BluetoothGatt.GATT_SUCCESS) { | |
Log.v(TAG, "onServicesDiscovered: " + status); | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment