ble

Objective-C iOS 6 BLE (Bluetooth 4.0) Distance calculation

匿名 (未验证) 提交于 2019-12-03 03:03:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is it possible to calculate the distance between the device and the iPhone, or at least, have an idea of the strength so I can check if the distance is getting smaller or bigger as I move. I would like to build some sort of system which makes it easier to find "lost" things in a close perimeter. Is such thing possible? And if so, what is the best way to do this. I assume that there is no obstruction between the two devices. 回答1: Yes, absolutely! Actually it's basic functionality provided by Core Bluetooth. To reference a link provided by a

BLE stack repeatedly reconnects to peripheral after connection is closed and app terminated

匿名 (未验证) 提交于 2019-12-03 02:56:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have an app that opens a short-lived connection to a BLE device, does some characteristic read and writes, and then disconnects and closes the connection. The app uses autoReconnect=false, and the device is not paired or bonded. I am seeing some very weird behavior by Android, which seems to repeatedly and unexpectedly reconnect to the peripheral, even after the connection is close()d, the app killed or even uninstalled. This issue has been previously linked to Spotify triggering the reconnects (see: Android BLE unexpectedly and repeatedly

Android BLE GATT_ERROR(133) on connecting to device

匿名 (未验证) 提交于 2019-12-03 02:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to connect to a BLE device using the MAC address. BluetoothDevice device = bluetoothAdapter.getRemoteDevice(rememberedDeviceAddress) bluetoothDevice.connectGatt(context, false, bluetoothGattCallback); I get a callback in BluetoothGattCallback.onConnectionStateChange with status = 133 and newState = 2 even when my BLE device is switched off. newState = 2 refers to BluetoothProfile.STATE_CONNECTED which means that i am connected to the device and status = 133 is GATT_ERROR (instead of status = 0 SUCCESS) I do not get the Failed to

Android save BLE device to reconnect after app close

匿名 (未验证) 提交于 2019-12-03 02:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm developing an android BLE app in which i try to establish a stable Connection between the app and a BLE device. To achieve this i want my app to keep the BLE device data in shared preferences or somewhere. After app close, i'd like my app to retrive this data and attemp a connection without scan for devices. I prefer to avoid scanning every time becouse scan gives me a lot of problems and it takes time. How can do it? Is there a way to save BLE data? 回答1: You need to store the Bluetooth Device Address (AB:CD:EF:01:02:03) of the device in

Create iOS BLE HID service?

匿名 (未验证) 提交于 2019-12-03 02:24:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I tried to create a simple "Hello World" app implementing the HID service (i.e. my app acting as a simple HID button). However, when trying this I receive the error The specified UUID is not allowed for this operation after adding my service to my CBPeripheralManager instance. Adding any "generic" (random UUID) service works, and other builtins such as Heart Rate monitor works fine, but I was curious about the HID service in particular. I found this thread , indicating that support for HID has been changed (but this seems to be on the

iOS how to reconnect to BLE device in background?

匿名 (未验证) 提交于 2019-12-03 02:18:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: There are many related questions but (apparently) no answers. SO... My iOS app does get updates from my BLE device while the app is in background. If I lose touch with the BLE device, then in centralManager:didDisconnectPeripheral: I call - [CBCentralManager cancelPeripheralConnection:] -- otherwise I will never reconnect to the lost peripheral. Then I call [(re)call - [CBCentralManager scanForPeripheralsWithServices:options:] . Logging shows me that the didDisconnectPeripheral call, and its contained calls, are both happening

Working with BLE Android 4.3 how to write characteristics?

匿名 (未验证) 提交于 2019-12-03 02:16:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am working on a BLE project (Android application) using Android 4.3 API, i have used sample BLE app it is only reading characteristics in DeviceControlActivity.activity, but i want to write characteristics and send it to BLE chip on clicking a button. How can I write data on chip cc2540 .. Basically i don't know the step by step procedure to write characteristics. write i can only see the name and id of device with following piece of code in DeviceControlActivity private final ExpandableListView.OnChildClickListener

Android BLE API: GATT Notification not received

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Device used for testing: Nexus 4, Android 4.3 Connection is working fine but the onCharacteristicChanged Method of my callback is never called. However I am registering for notifications using setCharacteristicNotification(char, true) inside onServicesDiscovered and that function even returns true. Device log (there are actually no messages at all when notifications should appear / are sent via the Bluetooth device): 07-28 18:15:06.936 16777-16809/de.ffuf.leica.sketch D/BluetoothGatt: setCharacteristicNotification() - uuid: 3ab10101-f831

Android: Sending data >20 bytes by BLE

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am able to send data upto 20 bytes by connecting to an external BLE device. How do I send data greater than 20 bytes. I have read that we have to either fragment the data or split characteristic to required parts. If I assume my data is 32 bytes, could you tell me changes I need to make in my code to get this working? Following are the required snippets from my code: public boolean send(byte[] data) { if (mBluetoothGatt == null || mBluetoothGattService == null) { Log.w(TAG, "BluetoothGatt not initialized"); return false; }

Solution for BLE scan's SCAN_FAILED_APPLICATION_REGISTRATION_FAILED?

匿名 (未验证) 提交于 2019-12-03 02:03:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My Android app scans BLE devices, and from a certain point it start to fails with error code 2 ( ScanCallback.SCAN_FAILED_APPLICATION_REGISTRATION_FAILED ). I'm using Nexus 9, 5.0.1 Lollipop. This problem continued even after I relaunched the app, and when I restarted the Bluetooth service from Settings, I could finally get rid of the problem. But this problem is recurring, and I think I'm coding in a wrong way; BLE related APIs are new and there is few information. Does anyone know a general solution for this error, preferably not requiring