<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>can not scan device</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/28633/can-not-scan-device</link><description>Hi, I&amp;#39;m using nRF52832 with sdk 13.1.0(softdevice 4.0.2). I had trouble to scan nRF52832 in android smart device.When i disconnect the device a long time when the status is lock screen,then the android device can not find the device(NRF52832).It also</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 29 Dec 2017 13:20:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/28633/can-not-scan-device" /><item><title>RE: can not scan device</title><link>https://devzone.nordicsemi.com/thread/113492?ContentTypeID=1</link><pubDate>Fri, 29 Dec 2017 13:20:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f965565-83cd-4857-8853-800e9aded639</guid><dc:creator>asdf</dc:creator><description>&lt;p&gt;I think I need some time to learn about these api.Thanks a lot.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: can not scan device</title><link>https://devzone.nordicsemi.com/thread/113491?ContentTypeID=1</link><pubDate>Fri, 29 Dec 2017 12:47:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12f98d4d-5529-4e54-a747-ebb522d4de4d</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;I assume that it&amp;#39;s the policy of the Huawei phone that it will kill the service (I assume you do scanning in a service so it can run in background) after it runs in background for a while. My suggestion is to define your device as Eddystone beacon then you can register your app with the Nearby Message API by Android.
You can have a look at &lt;a href="https://devzone.nordicsemi.com/question/88852/best-scanning-rate-to-avoid-phones-battery-drain-in-background-mode/"&gt;this case&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: can not scan device</title><link>https://devzone.nordicsemi.com/thread/113490?ContentTypeID=1</link><pubDate>Wed, 27 Dec 2017 08:28:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a424c473-0312-42fd-8b82-69a473560602</guid><dc:creator>asdf</dc:creator><description>&lt;p&gt;_
scanSettingsHuaWei = new ScanSettings.Builder().setScanMode
(ScanSettings.SCAN_MODE_LOW_POWER).build();
scanFilterHuaWei = new ScanFilter.Builder().setDeviceAddress(mBluetoothDeviceAddress).build();&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: can not scan device</title><link>https://devzone.nordicsemi.com/thread/113489?ContentTypeID=1</link><pubDate>Wed, 27 Dec 2017 08:28:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61bba94b-3b9f-442c-9862-ce13a3d51758</guid><dc:creator>asdf</dc:creator><description>&lt;p&gt;_&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;scannerHuaWei = mBluetoothAdapter.getBluetoothLeScanner();
            callbackHuaWei = new ScanCallback() {
                @Override
                public void onScanResult(int callbackType, ScanResult result) {
                    if (Build.VERSION.SDK_INT &amp;gt;= Build.VERSION_CODES.LOLLIPOP) {
                            connect(mBluetoothDeviceAddress);
                    }
                    super.onScanResult(callbackType, result);
                }

                @Override
                public void onBatchScanResults(List&amp;lt;ScanResult&amp;gt; results) {
                    super.onBatchScanResults(results);
                }

                @Override
                public void onScanFailed(int errorCode) {
                    super.onScanFailed(errorCode);
                }
            };
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: can not scan device</title><link>https://devzone.nordicsemi.com/thread/113488?ContentTypeID=1</link><pubDate>Wed, 27 Dec 2017 08:26:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7868d62f-a094-4e99-b3b1-1db9dd89fc6f</guid><dc:creator>asdf</dc:creator><description>&lt;p&gt;_
public void scanLeDeviceHuaWei(boolean enable) {
if (!mBluetoothAdapter.isEnabled()) {
return;
}
if (enable) {
if (Build.VERSION.SDK_INT &amp;gt;= Build.VERSION_CODES.LOLLIPOP){
List ar = new ArrayList&amp;lt;&amp;gt;();
ar.add(scanFilterHuaWei);
scannerHuaWei.startScan(ar,scanSettingsHuaWei,callbackHuaWei);
}
} else {
if (Build.VERSION.SDK_INT &amp;gt;= Build.VERSION_CODES.LOLLIPOP) {
scannerHuaWei.stopScan(callbackHuaWei);
}
}
}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: can not scan device</title><link>https://devzone.nordicsemi.com/thread/113487?ContentTypeID=1</link><pubDate>Wed, 27 Dec 2017 08:24:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c686e7e2-ef12-46ac-b1c8-53555374564a</guid><dc:creator>asdf</dc:creator><description>&lt;p&gt;Thank you for your reply. I&amp;#39;m sorry I did not reply because I have a holiday. I tried using your method but it caused the problem. It worked fine at first, but after a few times he became unable to find my device. Here is my code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: can not scan device</title><link>https://devzone.nordicsemi.com/thread/113494?ContentTypeID=1</link><pubDate>Thu, 21 Dec 2017 13:06:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f372c90-654b-4051-abc4-be35a80aa812</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Could you post your code ? Or the part that you do scanning ? Have you made sure you used &lt;a href="https://developer.android.com/reference/android/bluetooth/le/ScanSettings.html#SCAN_MODE_LOW_POWER"&gt;low power mode&lt;/a&gt; to scan ?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/attachment/bdd561ff56924e10ea78057b91c5c642"&gt;This document&lt;/a&gt; might be useful.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: can not scan device</title><link>https://devzone.nordicsemi.com/thread/113493?ContentTypeID=1</link><pubDate>Thu, 21 Dec 2017 06:32:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:939fb36e-6f7e-41a6-ad9b-dff03df0df4c</guid><dc:creator>asdf</dc:creator><description>&lt;p&gt;I&amp;#39;m sorry about that because I just know a little bit of English.My app was using the foreground service.The above log is the system log, not my application log.This means the system turned off my scan. Sometimes the system log shows that the scan is too frequent to stop my scan.This is some same question url but There is not an accurate answer.&lt;a href="https://github.com/AltBeacon/android-beacon-library/issues/554"&gt;link text&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: can not scan device</title><link>https://devzone.nordicsemi.com/thread/113486?ContentTypeID=1</link><pubDate>Wed, 20 Dec 2017 15:02:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a97cf57c-d61d-4186-962a-eb516dff04d7</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi asdf,&lt;/p&gt;
&lt;p&gt;It&amp;#39;s hard to catch what you want to say here, you meant background or foreground ? You may want to post a snippet of your code. I assume it works fine when you open the screen and the app is open.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not so familiar with Android but what is that btm_ble_stop_scan ? it&amp;#39;s the function you call in your app ?&lt;/p&gt;
&lt;p&gt;Also since it works with Sony but doesn&amp;#39;t work with Huawei, I suspect it&amp;#39;s more about Huawei issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: can not scan device</title><link>https://devzone.nordicsemi.com/thread/113485?ContentTypeID=1</link><pubDate>Wed, 20 Dec 2017 09:33:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66b0bd72-8ba0-4867-8571-b5790d7964e0</guid><dc:creator>asdf</dc:creator><description>&lt;p&gt;It happens in HUAWEI&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: can not scan device</title><link>https://devzone.nordicsemi.com/thread/113482?ContentTypeID=1</link><pubDate>Wed, 20 Dec 2017 04:08:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b99089b-ec9f-4e38-afd2-17eb4e29d523</guid><dc:creator>asdf</dc:creator><description>&lt;p&gt;When I was last able to scan the device, the following log appeared&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;12-20 12:06:08.913 2960-2960/? D/BluetoothAdapter: stopLeScan()
12-20 12:06:08.913 2960-2960/? I/BluetoothAdapter: getBluetoothLeScanner
12-20 12:06:08.919 2960-2960/? D/BluetoothAdapter: STATE_ON
12-20 12:06:08.922 1917-2025/? I/BluetoothState: inactive bluetooth uid: 10275, pid:2960, reason:BLE_SCAN
12-20 12:06:08.923 1600-1823/? I/bt_btif: BTA_DmBleObserve:start = 0 
12-20 12:06:08.924 1600-2177/? I/bt_btm: BTM_BleObserve : scan_type:0, 8000, 8000
12-20 12:06:08.924 1600-2177/? I/bt_btm: btm_ble_stop_scan 
12-20 12:06:08.924 1600-2177/? I/bt_btm: btm_update_scanner_filter_policy
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: can not scan device</title><link>https://devzone.nordicsemi.com/thread/113483?ContentTypeID=1</link><pubDate>Wed, 20 Dec 2017 01:05:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aec15b05-761e-4cd6-b462-5dc4ba94a4eb</guid><dc:creator>asdf</dc:creator><description>&lt;p&gt;I put the scanning and connection service in the foreground, and I found working on some sony phones is normal, but Huawei&amp;#39;s phone is not working properly, and it looks like the system stopped my scanning (because when I scan except for device it will try to connect ).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: can not scan device</title><link>https://devzone.nordicsemi.com/thread/113484?ContentTypeID=1</link><pubDate>Tue, 19 Dec 2017 09:59:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7f14945-0323-494c-94e0-1778981512df</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Could you give some more information on how you do scanning in the background and how do you know if the phone scan and find the advertising packet. I assume you wrote your own app ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: can not scan device</title><link>https://devzone.nordicsemi.com/thread/113495?ContentTypeID=1</link><pubDate>Mon, 18 Dec 2017 10:35:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c90c786a-d05c-4bf0-aaab-e308ba11e748</guid><dc:creator>asdf</dc:creator><description>&lt;p&gt;Android(In android 6.0 or more)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>