bluetooth

connectGatt on Samsung Galaxy S7 creates connection over Bluetooth Classic instead of BLE

不羁岁月 提交于 2021-01-29 02:30:40
问题 I have a dual-mode (BR/EDR + BLE) device running a GATT server. The address is public and same for BLE and BD/EDR. When I call connectGatt on Galaxy S7 with Android 6.0.1 (API level 23) and set the transport parameter as "TRANSPORT_LE" the phone still tries to establish connection over BD/EDR. It looks like the problem is related to the public address of the BLE because if I set it to private the connection is done over BLE, as expected. This problem was observed only on Galaxy S7, on other

Is there a minimum device name length for BLE 4.0 advertising local name complete?

狂风中的少年 提交于 2021-01-28 23:04:09
问题 For BLE advertising type LOCAL_NAME_COMPLETE, is there a minimum length requirement? I could not find any length specification in the spec (other than it needs to fit in the advertising packet of 31 bytes minus anything else already in the advertisement packet), but am running into an issue where it may seem that there is. I wanted to confirm here. 回答1: According to the BLUETOOTH SPECIFICATION Version 4.0 [Vol 3] section 12.1: ...The Device Name characteristic value shall be 0 to 248 octets

Is there a minimum device name length for BLE 4.0 advertising local name complete?

前提是你 提交于 2021-01-28 22:44:24
问题 For BLE advertising type LOCAL_NAME_COMPLETE, is there a minimum length requirement? I could not find any length specification in the spec (other than it needs to fit in the advertising packet of 31 bytes minus anything else already in the advertisement packet), but am running into an issue where it may seem that there is. I wanted to confirm here. 回答1: According to the BLUETOOTH SPECIFICATION Version 4.0 [Vol 3] section 12.1: ...The Device Name characteristic value shall be 0 to 248 octets

“Failed to encrypt the connection” with BlueZ peripheral and iOS

微笑、不失礼 提交于 2021-01-28 11:24:00
问题 I'm trying to make a raspberry pi bluetooth peripheral, so I try running the BlueZ example "example-gatt-server" and "example-advertising" at the same time. Then communicate it with my phone. But I got "Failed to encrypt the connection, the connection has timed out unexpectedly." on my iOS with nrf connect app. I'm using iOS 14, BlueZ 5.50, Raspberry Pi 4, Raspberry Pi OS Stretch 回答1: Instead of using ready made examples, I recommend that you create your own GATT server and then advertise as

Heart Rate Value in BLE

霸气de小男生 提交于 2021-01-28 11:13:17
问题 I am having a hard time getting a valid value out of the HR characteristics. I am clearly not handling the values properly in Dart. Example Data: List<int> value = [22, 56, 55, 4, 7, 3]; Flags Field: I convert the first item in the main byte array to binary to get the flags 22 = 10110 (as binary) this leads me to believe that it is U16 (bit[0] is == 1) HR Value: Because it is 16 bit I am trying to get the bytes in the 1 & 2 indexes. I then try to buffer them into a ByteData. From there I get

How to search the BLE/ Bluetooth device when app is background or inactive state in Swift?

北城以北 提交于 2021-01-28 08:02:32
问题 I know lost of questions are there related to this, but didn't get the proper solution so can you please help me. I'm stuck here from last 2 days Can we search the Bluetooth/BLE devices when app is in background. Can we search the Bluetooth/BLE devices when app is inactive mode 来源: https://stackoverflow.com/questions/63394414/how-to-search-the-ble-bluetooth-device-when-app-is-background-or-inactive-state

Android BLE write 'onCharacteristicWrite' returns status GATT_WRITE_NOT_PERMITTED

南楼画角 提交于 2021-01-28 06:08:56
问题 I've been trying to create a small Android BLE app that sends some bytes of data to a BLE device (an HM-10 module). Using existing applications on the Play Store I've been able to test the connection and this seems to be working but I seem to keep running into problems when trying to implement it in my own app. This is the code I'm using to connect to the BLE device using its MAC-address: // Initializes Bluetooth adapter. final BluetoothManager bluetoothManager = (BluetoothManager)

How to authenticate with Mi Band 3 in React Native

扶醉桌前 提交于 2021-01-28 04:57:48
问题 I have struggled for a few days to find a way to authenticate to my Mi Band 3 using React Native. I'm using react-native-ble-plx to make the connection. I can search for the nearby devices and I can even connect to the band, but when I try to call some service or characteristic, anything happens. Upon a few hours of searching, I realized that the problem might be the authentication, so I started looking for that, but I can't find anything. I found a question similar to this one, but the only

How to get BLE advertising channel index number

谁说胖子不能爱 提交于 2021-01-28 03:33:20
问题 I would like to get the advertising channel index number when I read the advertisement packet. I can only see that the advertisement information consists of a header info, UUID, major number, minor number and RSSI value. does any of this information have the channel number embedded into it? Can I tell if I'm reading the packet on channel 37/38/39? 回答1: On all host platforms that use HCI to communicate with the Bluetooth controller, this is not possible since HCI does not expose the channel

How to get BLE advertising channel index number

萝らか妹 提交于 2021-01-28 02:16:56
问题 I would like to get the advertising channel index number when I read the advertisement packet. I can only see that the advertisement information consists of a header info, UUID, major number, minor number and RSSI value. does any of this information have the channel number embedded into it? Can I tell if I'm reading the packet on channel 37/38/39? 回答1: On all host platforms that use HCI to communicate with the Bluetooth controller, this is not possible since HCI does not expose the channel