bluetooth-lowenergy

How to setup the enviroment that bluepy can scan without sudo?

你。 提交于 2021-02-11 13:49:18
问题 I wrote some Python3 script, that scans for devices. If they match a "name" I am connecting to them and do some ble stuff. The script is build on top of the bluepy module. One think I don't like, is that I need to run the device scanning as sudo (like sudo python3 getDev.py ). Any ideas how to make a user being able to scan without root rights? Guess I need to add the local user to a group etc. Any ideas are welcome 回答1: On linux Bluetooth protocol stack need special privileges to interact

Need help to parse mealtype on glucometer android BLE

佐手、 提交于 2021-02-11 13:20:56
问题 Need help to parse mealtype on glucometer android BLE. https://github.com/oesmith/gatt-xml/blob/master/org.bluetooth.characteristic.glucose_measurement_context.xml Here's my data: [27, 5, 0, -28, 7, 8, 24, 17, 18, 41, -29, 1, 102, -80, -8, 0, 0] I also found this one: C3: Field exists if the key of bit 1 of the Flags field is set to 1 Here's my enum public static Meal from(final int code) { switch (code) { case 1: return PREPRANDIAL; case 2: return POSTPRANDIAL; case 3: return FASTING; case 4

Android - Cannot find a device in onScanResult callback after successful connection

假装没事ソ 提交于 2021-02-10 16:48:22
问题 I'm scanning for BLE devices with my mobile. Whenever I get a callback of onScanResult I check if peripheral is iBeacon with specific minorId, if it is, I do device connection. Problem is that after successful connection onScanResult returns different devices around me, but none of them are the ones I just connected to. It's crucial for me to find connected devices in onScanResult . Is this normal behaviour? What could cause this? This happens when I connect to device - and only then. 回答1:

Bluetooth LE: undocumented error code 19

青春壹個敷衍的年華 提交于 2021-02-10 13:14:20
问题 My Android app uses BLE APIs, and one of these APIs, BluetoothGattCallback.onConnectionStateChange() , receives an undocumented error code 19. I'm using Nexus 9. Did anybody ever see this error code before? Like I mentioned above, this is undocumented in the Android API reference, and I don't know what to do about it. P.S. I searched issue tickets at Android issue tracker also, and found that developers encounter undocumented, BLE-related error codes often. Hmm, this is grim. 来源: https:/

Bluetooth LE: undocumented error code 19

与世无争的帅哥 提交于 2021-02-10 13:11:08
问题 My Android app uses BLE APIs, and one of these APIs, BluetoothGattCallback.onConnectionStateChange() , receives an undocumented error code 19. I'm using Nexus 9. Did anybody ever see this error code before? Like I mentioned above, this is undocumented in the Android API reference, and I don't know what to do about it. P.S. I searched issue tickets at Android issue tracker also, and found that developers encounter undocumented, BLE-related error codes often. Hmm, this is grim. 来源: https:/

Bluetooth LE: undocumented error code 19

冷暖自知 提交于 2021-02-10 13:10:04
问题 My Android app uses BLE APIs, and one of these APIs, BluetoothGattCallback.onConnectionStateChange() , receives an undocumented error code 19. I'm using Nexus 9. Did anybody ever see this error code before? Like I mentioned above, this is undocumented in the Android API reference, and I don't know what to do about it. P.S. I searched issue tickets at Android issue tracker also, and found that developers encounter undocumented, BLE-related error codes often. Hmm, this is grim. 来源: https:/

Bluetooth LE: undocumented error code 19

白昼怎懂夜的黑 提交于 2021-02-10 13:08:08
问题 My Android app uses BLE APIs, and one of these APIs, BluetoothGattCallback.onConnectionStateChange() , receives an undocumented error code 19. I'm using Nexus 9. Did anybody ever see this error code before? Like I mentioned above, this is undocumented in the Android API reference, and I don't know what to do about it. P.S. I searched issue tickets at Android issue tracker also, and found that developers encounter undocumented, BLE-related error codes often. Hmm, this is grim. 来源: https:/

Bluetooth 5.1 Angle of Arrival backward compatibility

流过昼夜 提交于 2021-02-10 12:46:50
问题 I am currently designing a simple indoor location project to evaluate possibilities of Bluetooth 5.1 standard. The feature I would like to use is AoA (Angle of Arrival) introduced in Bluetooth 5.1. According to the standard, AoA allows to measure position of a transmitting device (tx) by approximating the angle and measuring RSSI on a locator/receiver (rx). Since AoA is a feature newly implemented in 5.1, I understand that rx needs to support 5.1 Bluetooth standard. How about the transmitting

Android BLE peripheral with pin pairing

▼魔方 西西 提交于 2021-02-10 06:51:49
问题 I am developing an Android app which behaves as Bluetooth peripheral role with a service. When I start advertising, other Android devices searching for devices offering this service, can see my device (and can pair to it without pin) - ok. But how to enable PIN pairing? 回答1: You can force the device has to be paired, when using specific characteristics by protecting them with PERMISSION_READ_ENCRYPTED_MITM or PERMISSION_WRITE_ENCRYPTED_MITM. The client/central side can force pairing by

Android BLE peripheral with pin pairing

╄→гoц情女王★ 提交于 2021-02-10 06:51:18
问题 I am developing an Android app which behaves as Bluetooth peripheral role with a service. When I start advertising, other Android devices searching for devices offering this service, can see my device (and can pair to it without pin) - ok. But how to enable PIN pairing? 回答1: You can force the device has to be paired, when using specific characteristics by protecting them with PERMISSION_READ_ENCRYPTED_MITM or PERMISSION_WRITE_ENCRYPTED_MITM. The client/central side can force pairing by