gatt

How to solve the BluetoothGatt : android.os.DeadObjectException error happened in Android?

时光总嘲笑我的痴心妄想 提交于 2019-12-04 17:01:34
问题 I following the page Bluetooth Low Energy for developing in Android 4.3 for Bluetooth Low Energy . I already can turn on the Bluetooth , scan the device and connect to the BLE device. But it show the BluetoothGatt : android.os.DeadObjectException after I try to connect to device (device.connectGatt) and before discover the Service (mBluetoothGatt.discoverServices) for the BLE device. Before BluetoothGatt : android.os.DeadObjectException it show the log like the following W/bt-smp (10670): io

BLuetooth Gatt Callback not working with new API for Lollipop

不问归期 提交于 2019-12-04 00:17:30
I currently have a method which writes to the BLE devices to beep it. My Bluetooth Callback goes as follows : ReadCharacteristic rc = new ReadCharacteristic(context, ds.getMacAddress(), serviceUUID, UUID.fromString(myUUID), "") { @Override public void onRead() { Log.w(TAG, "callDevice onRead"); try{Thread.sleep(1000);}catch(InterruptedException ex){} WriteCharacteristic wc = new WriteCharacteristic(activity, context, getMacAddress(), serviceUUID, UUID.fromString(myUUID), ""){ @Override public void onWrite(){ Log.w(TAG, "callDevice onWrite"); } @Override public void onError(){ Log.w(TAG,

Android How to read BLE properties Readable Writable Notifiable GATT Characteristics

走远了吗. 提交于 2019-12-03 11:28:35
How to read BluetoothGattCharacteristic properties like is characteristic Readable , Writable or Notifiable . AZ_ /** * @return Returns <b>true</b> if property is writable */ public static boolean isCharacteristicWritable(BluetoothGattCharacteristic pChar) { return (pChar.getProperties() & (BluetoothGattCharacteristic.PROPERTY_WRITE | BluetoothGattCharacteristic.PROPERTY_WRITE_NO_RESPONSE)) != 0; } /** * @return Returns <b>true</b> if property is Readable */ public static boolean isCharacteristicReadable(BluetoothGattCharacteristic pChar) { return ((pChar.getProperties() &

Bluetooth Gatt issue onClientConnectionState() - status=8 clientIf=29

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am making android BLE app. As per the Documents, I make application. My Problem is that sometime the app will work good , but sometime it throw the errors .There is 2 logs, one for success and 2nd for the errors. Every time bluetooth disconnect, i am send close method. I don't know where I am stuck. 1st success log 2nd log As in above Logs , the 1st display the data but in 2nd i got the issue of status 8 , it will happen after 3 or 4 successful connection .My thought is that, If there is issue in the code then it is not given me single

StickNFind Bluetooth GATT Profiles

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Does anyone know what Bluetooth LE GATT profiles/services StickNFind is using? I am working on BLE project on Android with other products. I have not purchased any StickNFind stickers. I just want to know a bit more about these stickers before considering to have the app supporting it. Many thanks. 回答1: I've already bougth one of these stickers and I'm working with. To answer your question, I don't have the LE GATT Server complete table of all the services that it supports but there's an interesting app on Iphones call "BLE Utility" which

BlueZ 5.30: D-Bus GATT API - Simply Discover and Connect to a BLE device in C

风流意气都作罢 提交于 2019-12-03 10:08:42
问题 With the last release of BlueZ (5.30) the highlight was the completion of the GATT D-Bus apis. My goal is to programmatically (in C), as a BLE client: scan for ble devices (which I can do with the hci layer) Connect to an advertising BLE device Get the UUIDs Execute Read and Write to handles The BlueZ community is strongly suggesting to use the GATT-Dbus api to accomplish this. After multiple searches and head scratching I was not successful to find a proper way or example that would perform

Bluetooth GATT - onServicesDiscovered(BluetoothGatt gatt, int status) does not contain all Services

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have code that connects to, and then tries to discover all Services provided by a custom BLE server device advertising custom Services. The code works on Nexus 5 with Android 5.1 Samsung SM-T320 with Android 4.4.2 ZTE Blade Vec 4G With Android 4.4.2 Code does not work on Samsung SM-T360 with Android 4.4.4 Samsung GT-I9195 with Android 4.4.2 On devices where it fails it often discovers all of the BLE Services on one (of two) devices that advertises the same BLE Services. Restarting the Android device and/or fiddling with wifi/bt makes it

Android, How can I make BLE device to paired device (bonded)

醉酒当歌 提交于 2019-12-03 06:19:19
问题 Before GATT, createRfcommSocketToServiceRecord, createInsecureRfcommSocketToServiceRecord methods can make paired device, but GATT has no option about paired device, only use BluetoothDevice.connectGatt(...) I want to make a paired device if it's connected already. thx. 回答1: As far as I know, to initiate a pairing procedure in BLE there are two ways: 1) From API 19 and up you can start the pairing by calling the mBluetoothDevice.createBond(). You don't need to be connected with the remote BLE

Android Bluetooth status 133 in onCharacteristicwrite

匿名 (未验证) 提交于 2019-12-03 02:15:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm new to Android and now doing a simple app that requires writing some data into a peripheral device. Actually nothing goes wrong in a Samsung GT-S7272C device. But when I switch to Sony LT29i, there will always be a status 133 when I'm trying to write into a certain characteristic. I will give out some brief code. BluetoothGattService syncService = gatt . getService ( SYNC_DATA_SERVICE ); BluetoothGattCharacteristic tChar = syncService . getCharacteristic ( SYNC_TIME_INPUT_CHAR ); if ( tChar == null ) throw new AssertionError (

Android Bluetooth status 133 in onCharacteristicwrite

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm new to Android and now doing a simple app that requires writing some data into a peripheral device. Actually nothing goes wrong in a Samsung GT-S7272C device. But when I switch to Sony LT29i, there will always be a status 133 when I'm trying to write into a certain characteristic. I will give out some brief code. BluetoothGattService syncService = gatt . getService ( SYNC_DATA_SERVICE ); BluetoothGattCharacteristic tChar = syncService . getCharacteristic ( SYNC_TIME_INPUT_CHAR ); if ( tChar == null ) throw new AssertionError (