I experimented with SweetBlue running it over night using the following settings. I now find that it seems like my phone is stuck in BLE low power mode.
I have an app I am writing for collecting data about BLE advertisements. On another clean phone that never had SweetBlue installed it gets about 12 events/second. On the phone I tested SweetBlue on it now gets about 3 events/second and the RSSI levels are very low. Something like 20 db weaker than on the clean phone.
I have spent hours trying to figure out how to back out whatever SweetBlue did, such as resetting the stack, the phone itself, enabling and disabling BLE, having SweetBlue write different settings, along with various commands AI suggested.
Nothing works, it seems that the only option left is to try reinstalling the OS on the phone to see if that clears whatever permanent BLE settings it has now.
Any ideas on what to do? The following is the code I used to test it, which apparently produced this problem:
public void startPreciseScan()
{
ScanOptions options = new ScanOptions();
// Force a indefinite scan. If you choose to scan indefinitely, and don't set this, SweetBlue will automatically pause the scan, and resume it shortly
// thereafter, to make sure scan results keep coming in as expected. If you pass in <code>true</code> here, the scan will just run until you call
// {@link BleManager#stopScan()}. There's really no reason to do this, but it's left in here to be flexible.
options.scanInfinitely(); // Scan indefinitely
options.forceIndefinite(true);
options.withMatchMode(ScanOptions.MatchMode.AGGRESSIVE); // Aggressive matching
// This will set the scan to be of the highest priority. This should ONLY be used if you absolutely
// need it! With this active, ONLY scanning will happen (even if you call connect on a device, or
// read/write, etc), until you call {@link BleManager#stopScan()}.
options.asHighPriority(true); // High priority scan
// Description: The MatchNumber setting determines how many advertisements are matched per filter. By default, it’s set to MAX_ADVERTISEMENT, which matches as many as possible.
// Recommendation: You can keep it as MAX_ADVERTISEMENT to ensure you’re not missing packets. Explicitly setting this can make your intentions clear:
options.withMatchNumber(ScanOptions.MatchNumber.MAX_ADVERTISEMENT);
bleManager.startScan(options);
}
I experimented with SweetBlue running it over night using the following settings. I now find that it seems like my phone is stuck in BLE low power mode.
I have an app I am writing for collecting data about BLE advertisements. On another clean phone that never had SweetBlue installed it gets about 12 events/second. On the phone I tested SweetBlue on it now gets about 3 events/second and the RSSI levels are very low. Something like 20 db weaker than on the clean phone.
I have spent hours trying to figure out how to back out whatever SweetBlue did, such as resetting the stack, the phone itself, enabling and disabling BLE, having SweetBlue write different settings, along with various commands AI suggested.
Nothing works, it seems that the only option left is to try reinstalling the OS on the phone to see if that clears whatever permanent BLE settings it has now.
Any ideas on what to do? The following is the code I used to test it, which apparently produced this problem: