bluez

Bluetooth connection between Android and Linux (RPi) lost on first write action

感情迁移 提交于 2019-12-03 11:06:24
问题 So I have been working on a project in which a device running Android (API level = 14) must connect to a server running Linux (to be specific: a Raspberry Pi) via Bluetooth. When a connection is established, the app sends an encrypted XML string to the RPi. The RPi must decrypt this string, parse the XML and perform the corresponding action. The result of the action is send back to the Android device. So far, I have managed to create a connection between the app and the RPi (which runs the

Multiple BLE Connections using Linux and Bluez 5.0

让人想犯罪 __ 提交于 2019-12-03 10:10:37
问题 I am currently attempting to connect to multiple BLE devices using BlueZ 5.0 and Linux. I have one host BLE adapter and I have modified the gatttool to connect and perform this function. If I run an instance of the modified gatttool, I successfully connect and receive notification data from the BLE device. If I run another instance of the modified gatttool and connect to another BLE device, this application starts receiving notification data from both BLE devices and the initial application

BlueZ 5.30: D-Bus GATT API - Simply Discover and Connect to a BLE device in C

风流意气都作罢 提交于 2019-12-03 10:08:42
问题 With the last release of BlueZ (5.30) the highlight was the completion of the GATT D-Bus apis. My goal is to programmatically (in C), as a BLE client: scan for ble devices (which I can do with the hci layer) Connect to an advertising BLE device Get the UUIDs Execute Read and Write to handles The BlueZ community is strongly suggesting to use the GATT-Dbus api to accomplish this. After multiple searches and head scratching I was not successful to find a proper way or example that would perform

Finding Bluetooth low energy with python

筅森魡賤 提交于 2019-12-03 06:22:49
问题 Is it possible for this code to be modified to include Bluetooth Low Energy devices as well? https://code.google.com/p/pybluez/source/browse/trunk/examples/advanced/inquiry-with-rssi.py?r=1 I can find devices like my phone and other bluetooth 4.0 devices, but not any BLE. If this cannot be modified, is it possible to run the hcitool lescan and pull the data from hci dump within python? I can use the tools to see the devices I am looking for and it gives an RSSI in hcidump, which is what my

read rssi of bluetooth low-energy beacon using bluez5

自古美人都是妖i 提交于 2019-12-03 03:30:30
I want to read the RSSI simultaneously of an bluetooth lowenergy beacon, on 2 bluetooth le usb adapters. I'm using a fedora 20 system with bluez 5 and the LogiLink BT0015 adapters (CSR chip). My code works like a charm when only one adapter is connected, but after connecting the second adapter i'm receiving input/output errors. Does anybody know what's wrong with the code? Is there another way to read out the RSSI? #include <rssi.h> #include <stdio.h> #include <string.h> #include <errno.h> #include <bluetooth/bluetooth.h> #include <bluetooth/hci.h> #include <bluetooth/hci_lib.h> #include <time

C/C++ BLE read/write example with Bluez

纵然是瞬间 提交于 2019-12-03 02:59:23
I am starting to build up a simple BLE network with a microcontroller and a raspberry pi (tardis BLE dongle). As a starting point, I am looking for a simple C or C++ example to read/write a BLE device, similar to what I am able to do over the command line. The examples I have found so far are quite complicated. As a BLE beginner I need some very simple examples to build from before moving forward with a more complicated design. I am okay with hard-coding the BLE device name as I have in the gatttool example below. Here is how I currently use the command line options from Bluez. From the

Check battery level of connected bluetooth device on linux

房东的猫 提交于 2019-12-03 02:04:07
How can I check the battery level of a connected bluetooth device? The device shows the battery level on Android so I'm assuming the device supports the GATT-based Battery Service . However, by entering "menu gatt" in bluetoothctl and then listing the GATT attributes of the device with "list-attributes [dev]", nothing shows up. A similar question was posted to SO but the OP seems to have found a solution that doesn't work for me. When I run "info [dev]" in bluetoothctl I don't see the UUID for Battery Service. I would prefer a solution that runs on the command line and is distro-agnostic.

Bluetooth connection between Android and Linux (RPi) lost on first write action

雨燕双飞 提交于 2019-12-03 01:30:26
So I have been working on a project in which a device running Android (API level = 14) must connect to a server running Linux (to be specific: a Raspberry Pi) via Bluetooth. When a connection is established, the app sends an encrypted XML string to the RPi. The RPi must decrypt this string, parse the XML and perform the corresponding action. The result of the action is send back to the Android device. So far, I have managed to create a connection between the app and the RPi (which runs the latest version of the Bluez package ). The RPi has a Bluetooth 4.0 dongle from Targus. The point where I

BlueZ 5.30: D-Bus GATT API - Simply Discover and Connect to a BLE device in C

删除回忆录丶 提交于 2019-12-03 00:38:07
With the last release of BlueZ (5.30) the highlight was the completion of the GATT D-Bus apis. My goal is to programmatically (in C), as a BLE client: scan for ble devices (which I can do with the hci layer) Connect to an advertising BLE device Get the UUIDs Execute Read and Write to handles The BlueZ community is strongly suggesting to use the GATT-Dbus api to accomplish this. After multiple searches and head scratching I was not successful to find a proper way or example that would perform this through GATT-DBUs api. It seems more complicate than just use directly the GATT layer.

Finding Bluetooth low energy with python

余生颓废 提交于 2019-12-02 20:56:34
Is it possible for this code to be modified to include Bluetooth Low Energy devices as well? https://code.google.com/p/pybluez/source/browse/trunk/examples/advanced/inquiry-with-rssi.py?r=1 I can find devices like my phone and other bluetooth 4.0 devices, but not any BLE. If this cannot be modified, is it possible to run the hcitool lescan and pull the data from hci dump within python? I can use the tools to see the devices I am looking for and it gives an RSSI in hcidump, which is what my end goal is. To get a MAC address and RSSI from the BLE device. Thanks! As I said in the comment, that