Open Aaronwong94 opened 7 years ago
What type of error are you receiving? Most likely it's trying to start the scan again while the scan is already in progress. Are you on Android 6.0? Make sure your app has the proper permission as explained in the readme.
Also check out this guide to markdown: https://guides.github.com/features/mastering-markdown/ Formatting your code will make it easier to receive help!
I am getting behavior similar to this. Fresh device start, open the app, scan, no problem. Re-run the app and start scan doesn't return any devices. Occasionally I get an error code of 5 from the start scan which is unfortunate because the documented error codes only go to 4 as far as I can tell. Once this state has occurred the only way out of it is to cycle the bluetooth on and off at the OS level. I am filtering based on a service UUID and only allowing the first match if that would matter.
I had a question on the startScan(), where i use this function in a "refreshDeviceList" button. it seems like, at first i open the application, the first time i press the button and it successfull scan the bluetooth device .However when i press for the second time on the button, it return nothing! and go to error callback. The question is
' + 'RSSI: ' + device.rssi + ' | ' + device.address; listItem.dataset.deviceId = device.address; listItem.dataset.devicename = device.name; listItem.dataset.devicerssi = device.rssi; listItem.dataset.devicestatus = device.status; disconnectButton.dataset.deviceId = device.address; listItem.innerHTML = html; deviceList.appendChild(listItem); } else { deviceList.innerHTML = ""; } },