Changed the code to use the Lib bundled GATT attribute Resolver
This commit is contained in:
@@ -19,7 +19,7 @@ package uk.co.alt236.btlescan.services;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import uk.co.alt236.btlescan.util.SampleGattAttributes;
|
||||
import uk.co.alt236.bluetoothlelib.resolvers.GattAttributeResolver;
|
||||
import android.app.Service;
|
||||
import android.bluetooth.BluetoothAdapter;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
@@ -65,7 +65,7 @@ public class BluetoothLeService extends Service {
|
||||
"com.example.bluetooth.le.EXTRA_DATA";
|
||||
|
||||
public final static UUID UUID_HEART_RATE_MEASUREMENT =
|
||||
UUID.fromString(SampleGattAttributes.HEART_RATE_MEASUREMENT);
|
||||
UUID.fromString(GattAttributeResolver.HEART_RATE_MEASUREMENT);
|
||||
|
||||
// Implements callback methods for GATT events that the app cares about. For example,
|
||||
// connection change and services discovered.
|
||||
@@ -300,7 +300,7 @@ public class BluetoothLeService extends Service {
|
||||
// This is specific to Heart Rate Measurement.
|
||||
if (UUID_HEART_RATE_MEASUREMENT.equals(characteristic.getUuid())) {
|
||||
BluetoothGattDescriptor descriptor = characteristic.getDescriptor(
|
||||
UUID.fromString(SampleGattAttributes.CLIENT_CHARACTERISTIC_CONFIG));
|
||||
UUID.fromString(GattAttributeResolver.CLIENT_CHARACTERISTIC_CONFIG));
|
||||
descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
|
||||
mBluetoothGatt.writeDescriptor(descriptor);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user