Q: ScanSettings.Builder(),在Nexus 7上可以設定ScanMode,但是一將setReportDelay填入非0值,就ScanCallback就會吐onScanFailed,errorCode是4( SCAN_FAILED_FEATURE_UNSUPPORTED )。 A: 由於是新的API,所以可能會發生硬體不支援的狀況。可以使用下列程式碼做檢測: if ( bluetoothAdapter .isOffloadedScanBatchingSupported()) Log. d ( TAG , "Scan Batching is Supported" ); else Log. d ( TAG , "Scan Batching is NOT Supported" ); 如果出現Scan Batching is NOT Supported表示該裝置不支援這個功能,填入非0值就會出現錯誤。 P.S 可以使用isOffloadedFilteringSupported檢查是否支援應用filter。 bluetoothAdapter . isOffloadedFilteringSupported (); 參考: http://stackoverflow.com/questions/35266845/how-to-fix-android-ble-scan-failed-feature-unsupported-on-nexus-5 這封郵件來自 Evernote。Evernote 是您專屬的工作空間, 免費下載 Evernote
Collecting Interesting Things and What I've Learned