Last active
November 11, 2015 18:54
-
-
Save don/619f01de5c15d08fc670 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
// code to add to slides, not a complete implementation | |
public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) { | |
if (newState == BluetoothGatt.STATE_CONNECTED) { | |
this.gatt = gatt; | |
gatt.discoverServices(); | |
} | |
} | |
public void onServicesDiscovered(BluetoothGatt gatt, int status) { | |
BluetoothGattService service = gatt.getService(SERVICE_UUID); | |
// TODO handler errors if null | |
switchCharacteristic = service.getCharacteristic(SWITCH_UUID); | |
brightnessCharacteristic = service.getCharacteristic(DIMMER_UUID); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment