Loading android/app/src/com/android/bluetooth/gatt/GattService.java +8 −4 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.bluetooth.le.AdvertiseCallback; import android.bluetooth.le.AdvertiseData; import android.bluetooth.le.AdvertiseSettings; import android.bluetooth.le.ScanFilter; import android.bluetooth.le.ScanRecord; import android.bluetooth.le.ScanResult; import android.bluetooth.le.ScanSettings; import android.content.Intent; Loading Loading @@ -596,7 +597,8 @@ public class GattService extends ProfileService { .getRemoteDevice(address); long scanTimeNanos = TimeUnit.NANOSECONDS.toMicros(SystemClock.elapsedRealtimeNanos()); ScanResult result = new ScanResult(device, adv_data, rssi, scanTimeNanos); ScanResult result = new ScanResult(device, ScanRecord.parseFromBytes(adv_data), rssi, scanTimeNanos); if (matchesFilters(client, result)) { try { app.callback.onScanResult(address, rssi, adv_data); Loading Loading @@ -1015,7 +1017,8 @@ public class GattService extends ProfileService { int rssi = record[8]; // Timestamp is in every 50 ms. long timestampNanos = parseTimestampNanos(extractBytes(record, 9, 2)); results.add(new ScanResult(device, new byte[0], rssi, timestampNanos)); results.add(new ScanResult(device, ScanRecord.parseFromBytes(new byte[0]), rssi, timestampNanos)); } return results; } Loading Loading @@ -1053,7 +1056,8 @@ public class GattService extends ProfileService { System.arraycopy(advertiseBytes, 0, scanRecord, 0, advertisePacketLen); System.arraycopy(scanResponseBytes, 0, scanRecord, advertisePacketLen, scanResponsePacketLen); results.add(new ScanResult(device, scanRecord, rssi, timestampNanos)); results.add(new ScanResult(device, ScanRecord.parseFromBytes(scanRecord), rssi, timestampNanos)); } return results; } Loading Loading @@ -1270,7 +1274,7 @@ public class GattService extends ProfileService { ", isServer=" + isServer); ScanClient scanClient = getScanClient(clientIf, isServer); if (scanClient == null || scanClient.settings == null || scanClient.settings.getReportDelaySeconds() == 0) { || scanClient.settings.getReportDelayMillis() == 0) { // Not a batch scan client. Log.e(TAG, "called flushPendingBatchResults without a proper app!"); return; Loading android/app/src/com/android/bluetooth/gatt/GattServiceStateMachine.java +2 −2 Original line number Diff line number Diff line Loading @@ -303,7 +303,7 @@ public class GattServiceStateMachine extends StateMachine { private void enableBleScan(ScanClient client) { if (client == null || client.settings == null || client.settings.getReportDelaySeconds() == 0) { || client.settings.getReportDelayMillis() == 0) { gattClientScanNative(true); return; } Loading Loading @@ -410,7 +410,7 @@ public class GattServiceStateMachine extends StateMachine { || (settings.getCallbackType() & ScanSettings.CALLBACK_TYPE_MATCH_LOST) != 0) { return DELIVERY_MODE_ON_FOUND; } return settings.getReportDelaySeconds() == 0 ? DELIVERY_MODE_IMMEDIATE return settings.getReportDelayMillis() == 0 ? DELIVERY_MODE_IMMEDIATE : DELIVERY_MODE_BATCH; } Loading Loading
android/app/src/com/android/bluetooth/gatt/GattService.java +8 −4 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.bluetooth.le.AdvertiseCallback; import android.bluetooth.le.AdvertiseData; import android.bluetooth.le.AdvertiseSettings; import android.bluetooth.le.ScanFilter; import android.bluetooth.le.ScanRecord; import android.bluetooth.le.ScanResult; import android.bluetooth.le.ScanSettings; import android.content.Intent; Loading Loading @@ -596,7 +597,8 @@ public class GattService extends ProfileService { .getRemoteDevice(address); long scanTimeNanos = TimeUnit.NANOSECONDS.toMicros(SystemClock.elapsedRealtimeNanos()); ScanResult result = new ScanResult(device, adv_data, rssi, scanTimeNanos); ScanResult result = new ScanResult(device, ScanRecord.parseFromBytes(adv_data), rssi, scanTimeNanos); if (matchesFilters(client, result)) { try { app.callback.onScanResult(address, rssi, adv_data); Loading Loading @@ -1015,7 +1017,8 @@ public class GattService extends ProfileService { int rssi = record[8]; // Timestamp is in every 50 ms. long timestampNanos = parseTimestampNanos(extractBytes(record, 9, 2)); results.add(new ScanResult(device, new byte[0], rssi, timestampNanos)); results.add(new ScanResult(device, ScanRecord.parseFromBytes(new byte[0]), rssi, timestampNanos)); } return results; } Loading Loading @@ -1053,7 +1056,8 @@ public class GattService extends ProfileService { System.arraycopy(advertiseBytes, 0, scanRecord, 0, advertisePacketLen); System.arraycopy(scanResponseBytes, 0, scanRecord, advertisePacketLen, scanResponsePacketLen); results.add(new ScanResult(device, scanRecord, rssi, timestampNanos)); results.add(new ScanResult(device, ScanRecord.parseFromBytes(scanRecord), rssi, timestampNanos)); } return results; } Loading Loading @@ -1270,7 +1274,7 @@ public class GattService extends ProfileService { ", isServer=" + isServer); ScanClient scanClient = getScanClient(clientIf, isServer); if (scanClient == null || scanClient.settings == null || scanClient.settings.getReportDelaySeconds() == 0) { || scanClient.settings.getReportDelayMillis() == 0) { // Not a batch scan client. Log.e(TAG, "called flushPendingBatchResults without a proper app!"); return; Loading
android/app/src/com/android/bluetooth/gatt/GattServiceStateMachine.java +2 −2 Original line number Diff line number Diff line Loading @@ -303,7 +303,7 @@ public class GattServiceStateMachine extends StateMachine { private void enableBleScan(ScanClient client) { if (client == null || client.settings == null || client.settings.getReportDelaySeconds() == 0) { || client.settings.getReportDelayMillis() == 0) { gattClientScanNative(true); return; } Loading Loading @@ -410,7 +410,7 @@ public class GattServiceStateMachine extends StateMachine { || (settings.getCallbackType() & ScanSettings.CALLBACK_TYPE_MATCH_LOST) != 0) { return DELIVERY_MODE_ON_FOUND; } return settings.getReportDelaySeconds() == 0 ? DELIVERY_MODE_IMMEDIATE return settings.getReportDelayMillis() == 0 ? DELIVERY_MODE_IMMEDIATE : DELIVERY_MODE_BATCH; } Loading