bluez

BlueZ D-Bus C or C++ Sample [closed]

爷,独闯天下 提交于 2020-01-01 05:07:47
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I am trying to write an application which searches Bluetooth devices nearby and communicates with them. My application is going to be written in C++, and intended to work under Linux. 4 years ago, I used BlueZ. But now, as I see, the API has been changed a lot and now it's using D-Bus. I was not experienced with

Raspberry Pi Bluetooth 4.0 Connection

我怕爱的太早我们不能终老 提交于 2020-01-01 04:55:09
问题 I am trying to connect to a Raspberry Pi via iPhone using CoreBluetooth (bluetooth 4.0). I have discovered the device and send out a connection request using this code: if (peripheral != self.foundPeripheral) { NSLog(@"Try to connect to %@", peripheral.name); self.foundPeripheral = peripheral; [self.centralManager stopScan]; [self.centralManager connectPeripheral:peripheral options:nil]; } Neither the didConnectPeripheral or didFailedToConnectPeripheral are called. I also made sure to set the

Cannot connect to BLE device on Raspberry Pi

你。 提交于 2020-01-01 04:34:05
问题 I'm trying to connect to a BLE device (Heart rate sensor, Polar H7), on a Raspberry Pi 2. I use the last version of bluez (5.35) found here: http://www.bluez.org/download/ But when I'm trying to connect using gatttool , I always have "connection refused" error. Here is what I do : pi@raspberrypi ~ $ sudo su root@raspberrypi:/home/pi# hciconfig dev hci0: Type: BR/EDR Bus: USB BD Address: 5C:F3:70:69:54:3D ACL MTU: 1021:8 SCO MTU: 64:1 DOWN RX bytes:616 acl:0 sco:0 events:34 errors:0 TX bytes

Bluez: advertise service / gatt server example?

白昼怎懂夜的黑 提交于 2019-12-29 03:03:06
问题 Goal I am developping a simple device running Linux. It is BLE capable, and I am currently using bluez 5.8. I want to trigger an action on this device using an iPhone. What already works: I can make the iPhone "see" the device. The iPhone also connects to the device. I setup the bluetooth device like this on linux (thanks to this question): # activate bluetooth hciconfig hci0 up # set advertise data: "hello world" hcitool -i hci0 cmd 0x08 0x0008 48 45 4c 4c 4f 57 4f 52 4c 44 # start

BlueZ: How to set up a GATT server from the command line

ⅰ亾dé卋堺 提交于 2019-12-28 05:45:08
问题 I would like to know if there is a way to set up a gatt server from the Linux command line. I know that the BlueZ gatttool command allows you to act as a gatt client and interrogate a remote gatt server, however, I do not think that this tool can be used to set up a server. What I want to achieve is a gatt server, created from the command line , and can be interrogated by any central device (e.g. iOS or Android device) to connect to the GATT server, discover the services and characteristics,

How do you read/write to the handle returned by hci_le_create_conn?

♀尐吖头ヾ 提交于 2019-12-25 08:37:42
问题 Using BlueZ-5.43, Nordic nRF52832 and Raspberry Pi Raspbian. I can create an l2cap socket and perform service discovery and attribute read and write operations on characteristics. However, this solution by-passes creating a connection via the HCI and subsequently uses defaults for parameters such as supervision timeout and slave latency. Going through hci.c using hci_le_create_conn allows me to override these defaults, but I get a handle number 64 with no obvious means to use this handle for

Bluetooth Pairing with DisplayOnly no passkey box appears

旧巷老猫 提交于 2019-12-25 01:35:09
问题 I am trying to configure a bluetooth chip for linux to pair with an android phone. I will have a display on which I am able to show a 6 digit passkey, so I am trying to set the Bluetoothctl agent to DisplayOnly. According to the table in this post https://www.silabs.com/community/wireless/bluetooth/knowledge-base.entry.html/2016/07/11/bt121_-_legacy_pairi-MnCo If the responder is DisplayOnly, and the initiator (Android) is KeyboardDisplay, it should use Passkey entry, with the responder

Out-Of-Band Pairing between iOS device and embedded Linux

↘锁芯ラ 提交于 2019-12-24 06:05:22
问题 I'm implementing OOB Pairing between iOS 10 device (iPhone) and embedded Linux device (3.10 kernel version, 5.35 BlueZ version) via USB (iAP2 protocol, CarPlay). My question is: does BlueZ supports this kind of pairing? Where to find some information on that? What I have now: OBB Pairing working flawlessly from the iOS side (e.g. after USB connection established for the first time, I have my Linux device in "My Devices" bluetooth section of the phone). On Linux accessory's side I'm receiving

Out-Of-Band Pairing between iOS device and embedded Linux

两盒软妹~` 提交于 2019-12-24 06:05:13
问题 I'm implementing OOB Pairing between iOS 10 device (iPhone) and embedded Linux device (3.10 kernel version, 5.35 BlueZ version) via USB (iAP2 protocol, CarPlay). My question is: does BlueZ supports this kind of pairing? Where to find some information on that? What I have now: OBB Pairing working flawlessly from the iOS side (e.g. after USB connection established for the first time, I have my Linux device in "My Devices" bluetooth section of the phone). On Linux accessory's side I'm receiving

BLE peripheral: scanning while connected

谁都会走 提交于 2019-12-23 22:54:19
问题 Is it possible to make a peripheral scan for advertisments while connected to a central? It seems like it is either scanning for advertisments or have your peripheral connected but I need to do both. The peripheral should be able to report RSSI measurements from advertisements it picks up. I'm using 'bleno' for the peripheral and 'noble' for the scanning on a linux box (bluez) 回答1: The answer to this differs depending on the version of Bluetooth that your device is on. For Bluetooth v4.0: A