gatt

BLE gatttool cannot connect even though device is discoverable with hcitool lescan

两盒软妹~` 提交于 2019-11-27 20:07:29
问题 I'm running RPi with a USB Bluetooth dongle. When I use hcitool, I can discover the SmartTag device. But when I use gatttool, I cannot connect. It says "Host is down (112)". Here are my commands: $ sudo hcitool lescan LE Scan ... BC:6A:29:AB:DE:2B (unknown) BC:6A:29:AB:DE:2B SensorTag Checking for bluetooth adapters on my RPi I get: $ hcitool dev Devices: hci0 5C:F3:70:60:E6:1B Then, when I use the gatttool like this, I get: $ sudo gatttool -i hci0 -b BC:6A:29:AB:DE:2B -I [ ][BC:6A:29:AB:DE

Windows UWP connect to BLE device after discovery

拈花ヽ惹草 提交于 2019-11-27 18:50:01
I'm using BluetoothLEAdvertisementWatcher to find nearby BLE devices and it's working well. After finding them I want to connect and read/write data via GATT. But I can't figure out how to use the API after getting the BluetoothLEAdvertisement ( https://msdn.microsoft.com/de-de/library/windows/apps/windows.devices.bluetooth.genericattributeprofile ). public class Adapter { private readonly BluetoothLEAdvertisementWatcher _bleWatcher = new BluetoothLEAdvertisementWatcher(); public Adapter() { _bleWatcher.Received += BleWatcherOnReceived; } private void BleWatcherOnReceived

Creating a Gatt Server?

送分小仙女□ 提交于 2019-11-27 10:54:44
问题 I have a wider range question here, so if someone could point me to a doc or article that could explain this, that would suffice. Needless to say, a days worth of googling has gotten me nowhere, and I could use a helping hand. I am connecting to a BeagleBoard with BlueZ 5.9, and my intent is to: Create a Gatt server, Load it up with some writeable attributes, and Advertise that server to connect to an android device. I've created the Android app that will connect and operate as the central,

Is the native Android BLE implementation synchronous in nature?

╄→尐↘猪︶ㄣ 提交于 2019-11-27 08:05:23
I remember reading in the "Guide and Hint" -doc to the Samsung BLE API (archived page) : One of the most important concepts of the Samsung F/W and stack is its synchronous nature . That is, if we call for example, writeCharacteristic for a particular characteristic, if it returns true , the next call to any BluetoothGatt or BluetoothGattServer method should be done after the onCharacteristicRead callback is received. This is because the stack is designed to support and process only one GATT call at a time, and if, for example, you call writeCharacteristic or readCharacteristic on any

NORDIC GATT事件

為{幸葍}努か 提交于 2019-11-27 07:49:34
假设有两个服务,每个服务注册相应事件 注册的事件为ble_dev_cfg_on_ble_evt、ble_lora_cfg_on_ble_evt 当在任何一个服务中发生GATT特征读或写的时候,注册的这两个服务事件都会发生而不是只发生在相应特征项所属的事件 这点在特征项读写权限访问的时候需要注意,因为会在两个服务事件中发生,所以要避免重复回复的问题,否则会导致权限功能异常 void ble_lora_cfg_on_ble_evt(ble_evt_t const * p_ble_evt, void * p_context) //发生GATT特性项读写的时候会进入此事件 { ble_lora_cfg_t * p_lora_cfg = (ble_lora_cfg_t *)p_context; switch (p_ble_evt->header.evt_id) { case BLE_GATTS_EVT_WRITE: on_write(p_lora_cfg, p_ble_evt); break; case BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST: on_read_write_auth(p_lora_cfg, p_ble_evt); break; default: // No implementation needed. break; } } void ble

BluetoothDevice.ConnectGatt() with transport parameter

余生长醉 提交于 2019-11-27 07:09:21
问题 I just started with Android and set up an API 21 project in Android Studio using Bluetooth LE. Digging into BluetoothDevice shows me two signatures of ConnectGatt() method: public BluetoothGatt connectGatt(Context context, boolean autoConnect, BluetoothGattCallback callback) and public BluetoothGatt connectGatt(Context context, boolean autoConnect, BluetoothGattCallback callback, int transport) I'd like to use the second one but the build fails: Error:(127, 26) error: method connectGatt in

Android BLE API: GATT Notification not received

家住魔仙堡 提交于 2019-11-27 02:38:07
Device used for testing: Nexus 4, Android 4.3 Connection is working fine but the onCharacteristicChanged Method of my callback is never called. However I am registering for notifications using setCharacteristicNotification(char, true) inside onServicesDiscovered and that function even returns true. Device log (there are actually no messages at all when notifications should appear / are sent via the Bluetooth device): 07-28 18:15:06.936 16777-16809/de.ffuf.leica.sketch D/BluetoothGatt: setCharacteristicNotification() - uuid: 3ab10101-f831-4395-b29d-570977d5bf94 enable: true 07-28 18:15:06.936

startLeScan with 128 bit UUIDs doesn't work on native Android BLE implementation

北城余情 提交于 2019-11-26 21:42:33
I am having trouble using startLeScan( new UUID[]{ MY_DESIRED_128_BIT_SERVICE_UUID }, callback ) on the new introduced BLE API of Android 4.3 on my Nexus 4. The callback just doesn't get called. I still can see incoming packages in the log: 08-02 15:48:57.985: I/bt-hci(1051): btu_ble_process_adv_pkt 08-02 15:48:58.636: I/bt-hci(1051): BLE HCI(id=62) event = 0x02) If I don't use the parameter to filter for UUIDs it works. We are using a manufacturer specific 128bit UUID for device of our company. Now, our device offers more services than I am providing in the array. But that shouldn't be the

Windows UWP connect to BLE device after discovery

萝らか妹 提交于 2019-11-26 19:37:44
问题 I'm using BluetoothLEAdvertisementWatcher to find nearby BLE devices and it's working well. After finding them I want to connect and read/write data via GATT. But I can't figure out how to use the API after getting the BluetoothLEAdvertisement (https://msdn.microsoft.com/de-de/library/windows/apps/windows.devices.bluetooth.genericattributeprofile). public class Adapter { private readonly BluetoothLEAdvertisementWatcher _bleWatcher = new BluetoothLEAdvertisementWatcher(); public Adapter() {

Bluetooth Low Energy: listening for notifications/indications in linux

丶灬走出姿态 提交于 2019-11-26 17:10:17
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 gatttool -b <MAC Address> --char-desc gatttool -b <MAC Address> --interactive Failed commands: