bluez

Bluetooth Low Energy in C - using Bluez to create a GATT server

我只是一个虾纸丫 提交于 2019-12-18 11:59:27
问题 I'm attempting to use GATT on my Linux box to set up a custom service with a load of characteristics. Using this question, and the ones it links to, I was able to identify the code that I would need to write (making use of the gatt_service_add() function). I've created a separate file called gatt_service.c, and written the code I think that I need. However, I cannot work out how to link my code to the Bluez libraries in order to compile and run my solution. For example this site (whilst not

Python code for Bluetooth throws error after I had to reset the adapter

喜你入骨 提交于 2019-12-18 10:56:12
问题 I was trying out bluetooth programming in python. It was working fine till yesterday. This morning, there was a power outage and for some reason, the bluetooth module got disabled and it could not be turned on. So, I did a sudo hciconfig hci0 reset and then turned it on. From that point onwards, the simplest of the programs are failing to execute. Take this one for example. It gets stuck at advertise_service in bluetooth module and throws the following error (FYI: virtualenv was not a problem

Bluetooth pairing in C blueZ on Linux

Deadly 提交于 2019-12-18 04:03:29
问题 I cannot find any reference on how to pair a bluetooth device on linux in a program written in C using the BlueZ Bluetooth libraries. I already managed to do a HCI level query to get devices along with thier RSSI levels (during the device discovery) but currently I am stuck with this. I saw a suggestion to use the DBUS api for the blueZ-simple-agent - but is there any way to avoid this and just use some C level methods from BlueZ? 回答1: Authentication code from hcitool (original source code

Bluetooth Low Energy: listening for notifications/indications in linux

徘徊边缘 提交于 2019-12-17 03:53:32
问题 I'm trying to communicate with a BLE module through a Linux machine (the module is running a heart rate profile). So far, I've been able to do everything I need except listening for Notifications and indications (e.g. listening for the Heart Rate Measurement Notification). I'm using kernel version 3.5 and bluez-5.3. Succcessful commands used so far: hcitool lescan hcitool lecc gatttool -b <Mac Address> --primary gatttool -b <MAC Address> --characteristics gatttool -b <MAC Address> --char-read

Connecting two raspberry pi through bluetooth with bluez

痴心易碎 提交于 2019-12-13 03:55:49
问题 I'm trying to use this API: https://www.linumiz.com/bluetooth-connectdevice-without-scanning/ to make a connection between two Raspberry PI. I'm using this program like a server such as: pi@raspberrypi:~/bluetoothC $ sudo ./bin/bluez_adapter_connect Adapter is Powered "on" and then, in the client side: pi@raspberrypi:~/bluetoothC $ sudo ./bin/bluez_adapter_connect B8:27:EB:9F:91:A7 Adapter is Powered "on" Unable to get result: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Method

C++ Bluetooth headphones under Linux over BlueZ

早过忘川 提交于 2019-12-13 02:58:30
问题 I'm trying to write audio application for Bluetooth headphones under Linux (over BlueZ stack). It's embedded version so I want to use only C++ and BlueZ without any DBus or Python. For now I could successfully inquire devices and pair with them. But after few seconds connection gets lost. As far as I understand - there's should be some link established after pairing to prevent disconnection. But I can't figure out what am I doing wrong.. Here is my code sample: int main(int argc, char** argv)

Decode Array (unit8_t array to char array)

泪湿孤枕 提交于 2019-12-12 05:51:32
问题 I have a text representation of a encrypted buffer (via gcrypt) as follows: (enc-val (ecdh (s #04FA304FE9E91BED21E3C5898796056CE4E590E12BC74D0219A185D2E0B9B49A7393F023415F3E1FFD22D5B0A134E03F84D5C5DF7C5326C51971CFB783A26F1636#) (e #0411C41FC2ECB6F6F482050C005B30F75E134FD8AEA1E45F687A9E995CCFFB14DDD8EA41462E41CAEBA2AA21CA8F70C67FF4AA6620E64BABA23CCA0088F292256D#) ) ) I then convert this text string to a ( uint_8 ) value array via the function data_from_string . The function is as follows: size

How to choose local adapter when connecting to service with QBluetoothSocket

 ̄綄美尐妖づ 提交于 2019-12-12 04:29:29
问题 In the presence of multiple Bluetooth adapters, is it possible to specify which local adapter to use when creating a QBluetoothSocket or calling QBluetoothSocket::connectToService() ? I'm interested in Linux/BlueZ as well as Android (where it is not even clear whether multiple Bluetooth adapters are supported by the Bluetooth stack). 回答1: As of Qt 5.6.2, there is no such functionality yet apart from QBluetoothLocalDevice(QBluetoothAddress) , QBluetoothDeviceDiscoveryAgent(QBluetoothAddress) ,

Detect nearby beacons with Bluez

大憨熊 提交于 2019-12-12 04:27:00
问题 I installed Bluez and I am trying to scan and get UUID Major, Minor and if possible mac address for nearby ibeacon. I found similar questions and they refer to a script which I found here . When I launch the script I get this error Set scan parameters failed: Input/output error Did someone know how to solve the problem or has another solution ? If I start transmitting with the beacon and then I start the scan I get no result at all and I have to interrupt the script. 回答1: You should test that

Linux BlueZ 4.101 Allows GATT Connection but does not Expose GATT Services on Ubuntu

孤街醉人 提交于 2019-12-12 04:08:14
问题 My goal is to use BlueZ 4.101 ( not BlueZ 5.X ) to expose a GATT Server through a USB BLE Dongle ( Cambridge Silicon Radio CSR8510 A10 ) on Ubuntu 14.04. BlueZ 4.101 ships with a gatt-example plugin that several people have confirmed works for them. For example, the last answer in the post claims it works: Bluez: advertise service / gatt server example? Ultimately, I want to implement my own GATT server in BlueZ 4.101 similar to this post: http://gaiger-programming.blogspot.tw/2015/01