bluetooth-lowenergy

Android 10 not working with BLE Bluetooth scanning

吃可爱长大的小学妹 提交于 2020-04-17 03:10:55
问题 I am working on BLE Bluetooth scanning is working on all devices except the Android 10. Android 10 is not working, anyone please answer the question for the version 10 issues for scanning BLE Bluetooth 回答1: To make BLE scanning work on Android apps targeting Android 10 you need to ask the user for ACCESS_BACKGROUND_LOCATION along with ACCESS_FINE_LOCATION and also don't forget to add the permission in the manifest: <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"

Android 10 not working with BLE Bluetooth scanning

半腔热情 提交于 2020-04-17 03:10:43
问题 I am working on BLE Bluetooth scanning is working on all devices except the Android 10. Android 10 is not working, anyone please answer the question for the version 10 issues for scanning BLE Bluetooth 回答1: To make BLE scanning work on Android apps targeting Android 10 you need to ask the user for ACCESS_BACKGROUND_LOCATION along with ACCESS_FINE_LOCATION and also don't forget to add the permission in the manifest: <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"

How to set BLE advertisement packet's device name field

拜拜、爱过 提交于 2020-04-16 05:08:10
问题 I use the API to the build an advertisement packet. I pass true to setIncludeDeviceName AdvertiseData data = new AdvertiseData.Builder() .setIncludeDeviceName(true) .setIncludeTxPowerLevel(false) .addServiceUuid(new ParcelUuid(TimeProfile.TIME_SERVICE)) .build(); The API encodes the device model number in the advertising packet. For my app however, the device name for the advertisement packet should be come from a string hard coded into the app private static final String DEVICE_NAME = "My

How to Programmatically Clear Bluetooth Cache using GattServer

此生再无相见时 提交于 2020-03-17 07:03:29
问题 I'm slightly familiar with BLE and I am facing some problem with an inherited code. So the app works like that: With BLE enabled the app scans for devices The app displays the devices found The user selects the device to pair with The app pairs with the device The problem I'm facing is that after pairing several times (it varies) the phone is not able to discover devices, hence blocking the user to pair. I'm using GattServer to connect with the client device, and I'm reseting the services as

How to implement bluetooth for all device in react native

寵の児 提交于 2020-03-05 04:55:09
问题 I want to scan and connect devices using Bluetooth in React-Native. I tried react-native-ble-manager and react-native-ble-plx plugins. But I have a problem these plugins connected to special devices that have peripheral mode enabled. Look this answer. Question: How can I implement Bluetooth for all (at least all smartphones) devices in REACT-NATIVE? 来源: https://stackoverflow.com/questions/48790170/how-to-implement-bluetooth-for-all-device-in-react-native

Randomize Mac Address in BLE

会有一股神秘感。 提交于 2020-03-04 05:04:10
问题 I have made one app which turns iOS device to beacon. Now when I scan BLE devices from android device I got that iOS device in scan list but issue is every time I got random Mac address. So, my question is: Is this default behaviour means getting random mac address? I have checked all question on stack overflow and got same answer but still I want to confirm it? Also, if changing mac address is default behaviour then can we get when mac address changed? Same for android as well, If my android

How to find out if Bluetooth connection is encrypted?

独自空忆成欢 提交于 2020-02-25 05:32:27
问题 I am creating an BLE connection between a ble device and a mobile. the connection is first unsecured but will be updated to LESC just works from device side. This works fine so far. In Android (target SDK 28) I want to check (better getting an callback) if bluetooth connection is encrypted. I am using a BLE UART Service example. I have access to an BluetoothGatt and BluetoothDevice object. But all methods, variables I found are either private or @SystemApi. Can anyone help? Following some

Bring Bluetooth pairing request notification dialog on front to ask for PIN

爱⌒轻易说出口 提交于 2020-02-20 06:07:11
问题 What I'm trying to do is to brin the dialog to input the PIN for a pairing process. After I connect to a device, I receive a notification but the pairing dialog does not show up. I have to open it manually. So far I tried the following methods which are called in the broadcast receiver when I get the PAIRING_REQUEST action: public void pairDevice(BluetoothDevice device) { String ACTION_PAIRING_REQUEST = "android.bluetooth.device.action.PAIRING_REQUEST"; Intent intent = new Intent(ACTION

Bring Bluetooth pairing request notification dialog on front to ask for PIN

社会主义新天地 提交于 2020-02-20 06:05:06
问题 What I'm trying to do is to brin the dialog to input the PIN for a pairing process. After I connect to a device, I receive a notification but the pairing dialog does not show up. I have to open it manually. So far I tried the following methods which are called in the broadcast receiver when I get the PAIRING_REQUEST action: public void pairDevice(BluetoothDevice device) { String ACTION_PAIRING_REQUEST = "android.bluetooth.device.action.PAIRING_REQUEST"; Intent intent = new Intent(ACTION

How to extract latitude and longitude from location_and_speed characteristic?

那年仲夏 提交于 2020-02-06 04:26:24
问题 In an Android app in central role - how do you please get a hold of the latitude and longitude stored in the org.bluetooth.characteristic.location_and_speed characteristic in the org.bluetooth.service.location_and_navigation service of a BLE peripheral? I am trying the following Java-code - private float mLatitude; private float mLongitude; private static final UUID LOCATION_AND_NAVIGATION = UUID.fromString("00001819-0000-1000-8000-00805f9b34fb"); private static final UUID LOCATION_AND_SPEED