Comments (7)
Could you provide a code snippet, Android version and device?
from rxandroidble.
rxBleClient.scanBleDevices()
.observeOn(AndroidSchedulers.mainThread())
.doOnUnsubscribe(() -> Timber.i("Scan unsubscribe"))
.subscribe((rxBleScanResult -> {
}
}), (throwable -> {
if (throwable instanceof BleScanException) {
String msg = getExceptionMessage((BleScanException) throwable);
scanCallback.scanResult(new ScanResult(msg));
}
}))
Android N Preview 4, Nexus 6P
from rxandroidble.
Could you also turn on logging and provide ADB Logs? Best will be without package filtering because we may see system bluetooth logs as well.
from rxandroidble.
I have similar problems. The device scans for half a second (sometimes even less) and stops.
If I mash the scan button multiple times I find the device I want, but it would be a lot more convinient to e possible to say "scan for X seconds"
If it's relevant: I have another BLE device connected already (my watch)
06-25 21:41:03.523 17384-25926/? D/RxBle#Radio: QUEUED RxBleRadioOperationScan(239854725)
06-25 21:41:03.524 17384-25942/? D/RxBle#Radio: STARTED RxBleRadioOperationScan(239854725)
06-25 21:41:03.538 6124-6365/? D/BtGatt.GattService: registerClient() - UUID=0b1fbda3-6807-4c82-8c4d-fb4b95d3ffbe
06-25 21:41:03.541 6124-6224/? D/BtGatt.GattService: onClientRegistered() - UUID=0b1fbda3-6807-4c82-8c4d-fb4b95d3ffbe, clientIf=5
06-25 21:41:03.541 17384-25936/? D/BluetoothLeScanner: onClientRegistered() - status=0 clientIf=5
06-25 21:41:03.541 6124-8778/? D/BtGatt.GattService: start scan with filters
06-25 21:41:03.545 6124-6239/? D/BtGatt.ScanManager: handling starting scan
06-25 21:41:03.546 17384-25942/? D/RxBle#Radio: FINISHED RxBleRadioOperationScan(239854725)
06-25 21:41:03.563 6124-6224/? D/BtGatt.GattService: onScanFilterEnableDisabled() - clientIf=5, status=0, action=1
06-25 21:41:03.563 6124-6224/? D/BtGatt.ScanManager: callback done for clientIf - 5 status - 0
06-25 21:41:03.563 6124-6239/? D/BtGatt.ScanManager: configureFilterParamter 500 10000 1 0
06-25 21:41:03.570 6124-6224/? D/BtGatt.GattService: onScanFilterParamsConfigured() - clientIf=5, status=0, action=0, availableSpace=15
06-25 21:41:03.570 6124-6224/? D/BtGatt.ScanManager: callback done for clientIf - 5 status - 0
06-25 21:41:03.570 6124-6239/? D/BtGatt.ScanManager: configureRegularScanParams() - queue=1
06-25 21:41:03.570 6124-6239/? D/BtGatt.ScanManager: configureRegularScanParams() - ScanSetting Scan mode=2 mLastConfiguredScanSetting=-2147483648
06-25 21:41:03.570 6124-6239/? D/BtGatt.ScanManager: configureRegularScanParams - scanInterval = 8000configureRegularScanParams - scanWindow = 8000
06-25 21:41:03.571 6124-6224/? D/BtGatt.GattService: onScanParamSetupCompleted : 0
06-25 21:41:03.623 17384-25926/? I/MYAPP:DeviceScanActivity: 65:C6:F0:28:F6:F9
06-25 21:41:03.626 6124-6365/? D/BtGatt.GattService: stopScan() - queue size =1
06-25 21:41:03.626 6124-6239/? D/BtGatt.ScanManager: stop scan
06-25 21:41:03.626 6124-8778/? D/BtGatt.GattService: unregisterClient() - clientIf=5
06-25 21:41:03.639 6124-6224/? D/BtGatt.GattService: onScanFilterParamsConfigured() - clientIf=5, status=0, action=1, availableSpace=16
06-25 21:41:03.640 6124-6224/? D/BtGatt.ScanManager: callback done for clientIf - 5 status - 0
06-25 21:41:03.640 6124-6239/? D/BtGatt.ScanManager: configureRegularScanParams() - queue=0
06-25 21:41:03.640 6124-6239/? D/BtGatt.ScanManager: configureRegularScanParams() - ScanSetting Scan mode=-2147483648 mLastConfiguredScanSetting=2
06-25 21:41:03.640 6124-6239/? D/BtGatt.ScanManager: configureRegularScanParams() - queue emtpy, scan stopped
from rxandroidble.
Okay, here's how to reproduce (and a fix, at least for me)
final String deviceName = rxBleScanResult.getBleDevice().getName(); // this can be null!
logger.i(deviceName); // this stops the scan without stacktrace, if the name is null
logger.i(String.format("name: %s", deviceName)); // this doesn't
from rxandroidble.
Awesome. Had the same problem. This also fixed it for me.
from rxandroidble.
This is true. Name advertisement is optional.
from rxandroidble.
Related Issues (20)
- Does RxAndroidBle support the use of Bluetooth Gatt's connect method? HOT 4
- Building fork help HOT 6
- It is not possible to disconnect the Bluetooth while it is in the process of connecting. HOT 1
- BleGattCharacteristicException while readCharacteristic HOT 12
- scanResult.bleDevice.name not showing Ble updated name HOT 1
- BLUETOOTH_SCAN set usesPermissionFlags="neverForLocation",Is there a problem? HOT 2
- GenericFailure<CharacteristicValueUpdateError> HOT 11
- Send long bytes twice HOT 2
- Write request is not processed in the random order HOT 2
- Long Bytes Send HOT 8
- Creating a Fork HOT 2
- Set Preferred PHY / Read PHY HOT 2
- RxBleClient mulit connections HOT 4
- Is the library still maintained? HOT 3
- Android 14 breaking change HOT 15
- Google Pixel 5 loses bonding info after BT adapter cycle HOT 4
- Metode readcharacteristic not stream HOT 2
- Unable to readCharacteristic after writeCharacteristic HOT 5
- In the case of unsuccessful Bluetooth connection, actively disconnect without executing context. unregisterReceiver (receiver); At this point, there may be multiple Bluetooth broadcast registrarReceivers, which may crash on some Huawei phones due to a broadcast limit of approximately 1000. Suggest fixing this issue. HOT 2
- Can't scan after connect dispose/clear HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rxandroidble.