bluetooth-lowenergy

Bluetooth Low Energy: listening for notifications/indications on Raspberry Pi B+

戏子无情 提交于 2019-12-08 09:36:48
问题 How is it possible to authenticate using Bluez 5.31 and GattTool? I want to listen on a notification. I've connected using gatttool -b <addr> -I and I can run the primary command etc. I sniffed the device and I know that handle 0x0024 is where I will find a notification. When I try char-write-req 0x0024 0100 I get Error: Characteristic write Request failed: Attribute requires authentication before read/write So I try sec-level medium and then sec-level high but I still get the same error. Any

swift: pair with bluetooth device with button click

喜夏-厌秋 提交于 2019-12-08 09:14:30
问题 Until now the iPhone has paired to a bluetooth device when the app is opened, but I want to pair with a button click instead. I tried to put all the scanning and connection functions in a IBAction, but nothing happens when I push the button. In the first function after the IBAction I have a print output to check if it even enters the function, but I don't get the print. I also tried to put a delay after the manager.scanForPeripherals but didn't work either. What am I missing here? anyone know

getting STATE_DISCONNECTED while connecting using bluetooth smart

痞子三分冷 提交于 2019-12-08 09:12:51
问题 I am trying to create a advertiser on Android L and my other android device is scanning that device and trying to make a connection with it. but every time i call connectGatt i am getting BluetoothProfile.STATE_DISCONNECTED in gatt callback. this is how i have created the advertisement // advertisement settings AdvertiseSettings.Builder builderSetting= new AdvertiseSettings.Builder(); builderSetting.setAdvertiseMode(AdvertiseSettings.ADVERTISE_MODE_BALANCED); builderSetting.setConnectable

Scanning for BLE devices on Android 8+ in the background

穿精又带淫゛_ 提交于 2019-12-08 08:36:27
问题 I'm using the following method from BLE scanner API on Android 8+ to scan for BLE Beacons startScan(List<ScanFilter> filters, ScanSettings settings, PendingIntent callbackIntent) The problem is that after sometimes I can see Scan Logs but nothing is delivered by the callbackIntent any idea why is this happening? 回答1: This is the expected behavior on Android 8+. if you need to scan continuously a periodic mechanism is needed in this case. For more information about scanning on different

How to find the specific BLE 4.0 peripheral from two devices with same service UUID

瘦欲@ 提交于 2019-12-08 07:35:57
问题 For BLE 4.0, it provides API to discover peripherals with array of service UUID. I just want to find the specific one. How to achieve this ? If need assign the identifier to the specific device, how to do it ? (I think my question need some context of core bluetooth of iOS. ) 回答1: The process for reconnecting to known peripherals is described in the Core Bluetooth Programming Guide. Essentially if you know the UUID of the device you want to reconnect to (which is the identifier property of

How to encrypt data using BLE connection using Bluez5.50

主宰稳场 提交于 2019-12-08 07:31:01
问题 I'm working on a C++ project that deals with data transmission. My system is composed of two different devices, that have to exchange sensitive data in a trusted mode. To do this I downloaded and set up the last bluez library (v5.50) on my Raspberry Pi. Is there any possibility to enable data encryption using the bluez API? Googling around the possibility to use the BLE encryption mechanism I found discordant opinions. Someone suggests using it while others one discourage it in favor of

How to stop a call resulting in IAsyncOperation?

落爺英雄遲暮 提交于 2019-12-08 07:28:48
问题 In my application I notify multiple devices. If a device is not reachable and is not responding within a few seconds, i want to cancel the call. My code is: await characteristic0.WriteClientCharacteristicConfigurationDescriptorAsync (GattClientCharacteristicConfigurationDescriptorValue.Notify); Now after some research i found out that usually one can pass a CancelationToken (_ct) and do this: First create an operation containing the call: IAsyncOperation<GattCommunicationStatus> operation =

How to send command to BLE device and show result

◇◆丶佛笑我妖孽 提交于 2019-12-08 07:18:59
问题 @Override public void onServicesDiscovered(final BluetoothGatt gatt, int status) { super.onServicesDiscovered(gatt, status); if (status == BluetoothGatt.GATT_SUCCESS) { List<BluetoothGattCharacteristic> characteristics = null; List<BluetoothGattService> services = gatt.getServices(); //I am getting all services for (final BluetoothGattService service : services) { characteristics = service.getCharacteristics(); //I am getting all characteristics for each services } } } I am able to connect

Listening to and accepting a BLE Connect request in windows

丶灬走出姿态 提交于 2019-12-08 07:14:18
问题 I've been trying to connect an iOS device to windows using Bluetooth low energy, and I find the windows BLE API very.. unclear. The windows is acting as the peripheral and the iOS device the Central I think that my Swift code on the iOS device is fine, it works with BLE devices (like a climate device I have) what I'm doing on the iOS side is: - Launching the scan for BLE Advertisements - Upon receiving an Advertisements, if the ManufacturerData is what I'm looking for, I try to connect to the

How to make Android BLE connect to Bluez Peripheral? (Connection issues)

痞子三分冷 提交于 2019-12-08 06:44:50
问题 I am trying to connect my Nexus 5 (Android 6.0.1) smartphone to my desktop computer (Ubuntu 15.04 64-bit with BlueZ 5.36) using Bluetooth Low Energy. I use a BT 4.0 USB dongle with a CSR BC8510 chipset. The setup did actually work just a couple of days ago. Then I switched to a Broadcom USB dongle and it started to become unstable. Connecting became slow and started to fail. It now does not work anymore at all even though I switched back to the CSR dongle and a different Ubuntu machine (still