}
public static void getLeScanCallback() {
-// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
-// caLeRegisterLeScanCallbackForV21(mLeScanCallbackForV21);
-// } else {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ caLeRegisterLeScanCallbackForV21(mLeScanCallbackForV21);
+ } else {
caLeRegisterLeScanCallback(mLeScanCallback);
-// }
+ }
}
public static void getLeGattCallback() {
try {
List<UUID> uuids = getUuids(scanRecord);
for (UUID uuid : uuids) {
+ Log.d(TAG,"UUID is "+ uuid.toString());
if(uuid.toString().contains(SERVICE_UUID.toLowerCase())) {
caLeScanCallback(device);
} else if(uuid.toString().contains(CUSTOM_UUID.toLowerCase()) ||
uuid.toString().contains(CUSTOM_UUID2.toLowerCase())) {
- Log.d(TAG, "we found that has the Device [" + device.getAddress() +
- "] which has custom adv");
+ Log.d(TAG, "Found device which has custom adv");
caLeScanCallback(device);
}
}
public void onDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor,
int status) {
super.onDescriptorWrite(gatt, descriptor, status);
+ Log.d(TAG,"Descriptor status is "+ status);
caLeGattDescriptorWriteCallback(gatt, status);
caLeGattNWDescriptorWriteCallback(gatt, status);