bluez

How to write a client characteristic configuration descriptor in bluez

谁说胖子不能爱 提交于 2019-12-12 03:29:46
问题 I am working with the example-gatt-server.py script that comes with bluez on my linux board. I want to add notification to one of my custom characteristics. For that I need to define the Client Characteristic Configuration Descriptor and add it to my custom characteristic. Here is how I am doing this - class ClientCharacteristicConfigurationDescriptor(Descriptor): CCCD_UUID = '2902' def __init__(self, bus, index, characteristic): self.value = array.array('B') self.value = self.value.tolist()

Android device name == “BlueZ”?

我的梦境 提交于 2019-12-12 02:54:57
问题 I am new to Android development and built 4.0.3 from source. build.prop does list my device as "Incredible 2" yet in the Bluetooth settings my device is listed as "BlueZ". Sure I can change it but I'd like to know where in the source that is handled so I can see how to fix it. 回答1: BlueZ is the official Linux bluetooth protocol. It's probably just defaulting to the protocol name rather than the device name. I don't have the source on this machine, but I believe that in the bluetooth source

Bluez commands in Bluedroid

人盡茶涼 提交于 2019-12-11 19:07:49
问题 I have an Android 2.2 device which allows me to run Bluez commands such as hcitool scan & hciconfig However since Android 4.2.2 comes with Bluedroid , how can I run such commands? I am looking for an alternative or a similar set of commands that can be used in Bluedroid. Your help is greatly appreciated. 回答1: Bluedroid has a different architecture than Bluez. Currently there are no such tools for bluedroid on android. 来源: https://stackoverflow.com/questions/24605783/bluez-commands-in

How to set bluez mode?

你离开我真会死。 提交于 2019-12-11 12:09:02
问题 There are some threads for how to apply bluez as ibeacon or BLE peripheral. But when I use ble scanner (a BLE central application on Android), that reveal the bluz peripheral as dual mode. How should I do to disable the classic mode in bluez? 回答1: Since you are referring to that thread, you probably use hcitool to set the advertisement data and options. You need to set change the Flag for BR/EDR support to 0. Thats Bit 2 of the Flags field (See Part A Supplement of the Bluetooth Core

Can a C++11 program use BlueZ?

筅森魡賤 提交于 2019-12-11 10:16:26
问题 I am having trouble compiling a simple C++11 program using the BlueZ library : #include <bluetooth/bluetooth.h> int main() {} Compiling this with g++ -std=c++11 main.cpp on my Fedora 21 box gives : In file included from ../scale.cpp:1:0: /usr/include/bluetooth/bluetooth.h: In function ‘uint64_t bt_get_le64(const void*)’: /usr/include/bluetooth/bluetooth.h:177:9: error: expected identifier before ‘*’ token return bt_get_unaligned((const uint64_t *) ptr); ^ ... This is with BlueZ version 5.23

How do I org.bluetooth.characteristic.report_map for more than one type of report?

六眼飞鱼酱① 提交于 2019-12-11 08:04:54
问题 Alright, I'm building a keyboard with an integrated touch-screen used as a mouse, I'm sending the data generated over BLE via HID OVER GATT. This works fine for org.bluetooth.characteristic.boot_keyboard_input_report & org.bluetooth.characteristic.boot_mouse_input_report, but I'm not very certain how to configure the report_map and what I need to send according to these declarations. The Main question is really, because there is no hybrid type of Usage, I need to use two Usage. But do I need

How can BlueZ be configured to require a connecting device to enter a matching pass key?

蹲街弑〆低调 提交于 2019-12-10 21:23:53
问题 I'm trying to setup Bluetooth on an embedded Linux device such that SSP mode is used, with my device generating and displaying a passcode on it's display, and the remote end (e.g. user's phone) being required to enter the matching passcode to be able to successfully pair. I'm written/registered an agent that sets it's mode to DisplayOnly; I expected that when a device connects the "RequestPasskey" callback would be called and that my agent would then be able to generate and return a new

Which tool has replaced gatttool in bluez5?

为君一笑 提交于 2019-12-10 12:47:18
问题 It seems like since commit b1eb2c4cd057624312e0412f6c4be000f7fc3617 gatttool has been deprecated but I'm unable to find any information on what has replaced gattool. Every Python Bluetooth LE packages I looked into relays on gatttool and is now broken on my ArchLinux system since the bluez package isn't build with --enabled-deprecated flag (which would build gatttool binary). pygatt is just broken on my system and bluepy doesn't build as they ship there own (on my system broken) bluez code to

Raspberry Pi3 BLE as Central device receiving just one packet per connection interval - gatttool/hcitool

若如初见. 提交于 2019-12-10 11:44:49
问题 i would appreciate if someone can explain one issue i'm experiencing with Raspberry Pi 3 model B acting as a Central device on a BLE connection with a Peripheral device. First, i successsfully connect both devices and enable notifications on the Central device using the folllowing hcitool/gatttool commands: sudo hciconfig hci0 up sudo gatttool --adapter=hci0 --device=XX:XX:XX:XX:XX:XX --adr_type=random --mtu=23 -I [][LE]> connect [][LE]> char-write-req 0x000c 0100 After that, i started

How to connect pybluez RFCOMM server socket on Debian?

爷,独闯天下 提交于 2019-12-10 10:16:35
问题 I have these snippet in python with pybluez framework: from bluetooth import * server_sock=BluetoothSocket( RFCOMM ) server_sock.bind(("",PORT_ANY)) server_sock.listen(1) port = server_sock.getsockname()[1] uuid = "94f39d29-7d6d-437d-973b-fba39e49d4ee" advertise_service( server_sock, "SampleServer", service_id = uuid # service_classes = [ uuid, SERIAL_PORT_CLASS ], # profiles = [ SERIAL_PORT_PROFILE ], # protocols = [ RFCOMM_UUID ] ) print "Waiting for connection on RFCOMM channel %d" % port