bluetooth-lowenergy

Excessive Bluetooth LE timeouts on Linux?

我们两清 提交于 2019-12-31 04:08:19
问题 I have written an application that uses Bluetooth LE L2CAP connections in nonblocking mode on Linux to read/write ATT packets (using socket(PF_BLUETOOTH, SOCK_SEQPACKET|SOCK_CLOEXEC, BTPROTO_L2CAP) ). Normally, when the device turns off or goes out of range, read() gives errno=ETIMEDOUT. However, read() is giving errno=ETIMEDOUT more often than it should, when the Bluetooth LE device still appears to be working. What is the cause of the timeout? Is the timeout configurable? My Linux

BluetoothDevice always returns null on getName()

痴心易碎 提交于 2019-12-31 03:56:25
问题 I'm facing this issue consistently in Android 4.4, 5 and 6. I'm performing a BLE Bluetooth devices scan and after it I can access their address (getAddress()), and other data. But if I call device.getName() it returns null EVERY TIME. This documentation is not helpful, it only says that returns null if "there was a problem" : https://developer.android.com/reference/android/bluetooth/BluetoothDevice.html#getName() Other posts that I visited unsuccessfully : https://code.google.com/p/android

Ble Scan service of a device without connecting to it

痞子三分冷 提交于 2019-12-31 03:22:45
问题 I want to scan some device with BLE. I only want to show my device, so for know I get the name of the device and if it is the good one I put it in my list. if (device.getName().contains(DEVICE_NAME)) { mDevices.put(device.hashCode(), device); invalidateOptionsMenu(); } My problem is that if I change the name of my device this check will be false. So I look if it was possible to get some uuid of some services that I add to do the check with something that would not change. And the only way is

How to turn CBUUID into string

我是研究僧i 提交于 2019-12-30 00:35:57
问题 I can't find any official way to get a UUID string back out of a CBUUID. These UUIDs can be 2 or 16 bytes long. The goal is to store CBUUIDs in a file somewhere as a string, and then resurrect with [CBUUID UUIDWithString:] etc. Here is what I have so far. // returns a simple 4 byte string for 16bit uuids, 128 bit uuids are in standard 8-4-4-4-12 format // the resulting string can be passed into [CBUUID UUIDWithString:] +(NSString*)CBUUIDToString:(CBUUID*)cbuuid; { NSData* data = cbuuid.data;

iOS Bluetooth dual-mode; connect BLE (GATT) to an already connected BR/EDR (A2DP/HFP) stereo headset simultaneously

断了今生、忘了曾经 提交于 2019-12-29 19:19:06
问题 I'm developing a stereo headset with Bluetooth using the classic profiles (HFP, A2DP, AVRCP) as one would expect Ina stereo headset. However, I want to deploy a remote control app for iOS, and use it simultaneously to the other classic links, but the dual-mode chipset I'm working with in my design does not behave as I'd expect; The headset is setup as a peripheral, letting the iOS device act as central. As such, the peripheral advertise its BLE services (with my specific 128-bit UUIDs) and

iOS 7 ANCS: Discovering the primary ANCS Service UUID

余生长醉 提交于 2019-12-29 11:41:11
问题 Under iOS7, is the primary ANCS Service meant to be constantly advertised, or does it need to be enabled in obfuscated settings / implemented using a custom CBPeripheralManager (using the Apple-specified Service and Characteristic UUIDs) for a potential Notification Consumer to successfully discover it and subscribe? The Apple documentation (both the CoreBluetooth Programming Guide, and the ANCS Specification) are surprisingly bereft of any information on this. They seem to hint at requiring

onServicesDiscovered never called while connecting to GATT Server

可紊 提交于 2019-12-29 06:55:12
问题 I have a bluetooth headset which is paired with my Nexus 5X (running Android 7.1) and I would like to connect to a GATT Server of the headset. I tried it with the following code: private BluetoothGattCallback btleGattCallback = new BluetoothGattCallback() { @Override public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) { Log.d(TAG, "onConnectionStateChange: " + status + ", " + newState); if(newState == STATE_CONNECTED) { Log.d(TAG, "Device connected"); boolean ans

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

Does blued cache ATT values, and how to clear the cache?

╄→尐↘猪︶ㄣ 提交于 2019-12-28 19:02:12
问题 I am trying to find any workarounds for a Bluetooth LE bug on OSX. In particular, I want to know where OSX goes wrong in reading the Bluetooth LE GATT table. Thus, I am viewing the L2CAP packets in PacketLogger from Hardware IO Tools for XCode. When I use Bluetooth Explorer to connect to the Bluetooth LE device, I am expecting to see 3.4.4.9 Read By Group Type Request (uuid=0x2800 «Primary Service», startingHandle=0x0001, endingHandle=0xffff) to discover primary services (or Find By Type

RxAndroidBle keeping a persistant connection + Write/Notification handling

我们两清 提交于 2019-12-28 06:33:48
问题 I am building an Android application that has specific requirements regarding Bluetooth Low Energy. I need to write to a Write-only characteristic and receive responses on a separate notification characteristic, and I need to do it in many, many activities. Is there a Rx way to send a request on the 1st characteristic, wait for the answer on the second one, then proceed to another request? Also, to share my instance of RxAndroidBle I thought about doing some sort of BleManager Singleton where