bluetooth-gatt

Android BLE peripheral disconnects with status code BLE_HCI_INSTANT_PASSED(0x28)

纵饮孤独 提交于 2020-07-09 17:02:11
问题 My application is able to connect to the BLE peripheral(which is an OBDII/J1939 device) device successfully. 2018-01-24 14:58:38,413 INFO LogUtil - GATT Server Status = (0) : BLE_HCI_STATUS_CODE_SUCCESS(0x00) 2018-01-24 14:58:38,414 INFO LogUtil - GATT Server New State = (2) : STATE_CONNECTED 2018-01-24 14:58:38,414 INFO LogUtil - Connected to GATT server. Application started communication with the device but after some time it received GATT server disconnection message in

pygatt: Unable to execute device.subscribe()

↘锁芯ラ 提交于 2020-04-07 01:20:04
问题 I am trying to subscribe to a GATT characteristic. I have set the "Indicate", "Notify" and "Read" attributes for the GATT characteristic in my BLE device. I am able to connect to my BLE device and read/write to other characteristics. However, i am unable to execute the device.subscribe() function for this particular characteristic. When i use device.subscribe("845ce63c-d003-423c-8922-818676d34255", callback=handle_data) i get the error pygatt.backends.bgapi.exceptions.ExpectedResponseTimeout:

Android BLE Gatt connection change statuses

白昼怎懂夜的黑 提交于 2020-01-12 06:15:30
问题 I have an android app to connect to a BLE device and write to it. I can successfully connect, read and write to it. As a part of testing, we are trying different disconnection scenarions. Sometimes, if ble device disconnect the connection, i get the connection change as disconnect with status value as 19. Also if there is any bond error, status equals 22. If i programmatically disconnect the connection, this status gives me 0. But none of these states except 0 are specified in android

Which GATT Profile and Services are used by OBD BLE Adapters like LELink, Automatic, Carista?

核能气质少年 提交于 2020-01-11 10:43:10
问题 I am exploring building apps (Android & iOS) for Car OBD2 Adapters that support BLE (Bluetooth Low Energy). In order for the app to be able to work with such adapters from different vendors, I presume there would be a standard set of GATT profile i.e. Services and Characteristics that these adapters would be using for standard features like engine RPM, Fuel level etc. Is this info available somewhere that I can refer while building the mobile app? 回答1: OBD2 BLE adapters don't use any fixed

Getting Type_Gatt_Error with status 133 while connecting to AND UA651BLE

点点圈 提交于 2020-01-03 19:32:09
问题 I am trying to connect to AnD UA-651BLE blood pressure monitor and get the values in an android app. The app is able to find the device but I am getting Type_Gatt_Error in 'onConnectionStateChange'. This is working fine for certain devices like samsung galaxy S5, Moto G4 etc. but not for certain phones like redmi 3s prime, etc. This works well and i am able to read data, when i unpair the device and re pair it everytime. I am not able to understand anything as i am new to android-ble

Getting Type_Gatt_Error with status 133 while connecting to AND UA651BLE

╄→尐↘猪︶ㄣ 提交于 2020-01-03 19:30:50
问题 I am trying to connect to AnD UA-651BLE blood pressure monitor and get the values in an android app. The app is able to find the device but I am getting Type_Gatt_Error in 'onConnectionStateChange'. This is working fine for certain devices like samsung galaxy S5, Moto G4 etc. but not for certain phones like redmi 3s prime, etc. This works well and i am able to read data, when i unpair the device and re pair it everytime. I am not able to understand anything as i am new to android-ble

Which correct flag of autoConnect in connectGatt of BLE?

谁说胖子不能爱 提交于 2019-12-27 17:34:10
问题 my goal is making an auto connection between Bluetooth Low Energy device and phone. I followed the sample code and I found the line // We want to directly connect to the device, so we are setting the autoConnect parameter to false. mBluetoothGatt = device.connectGatt(this, false, mGattCallback); The above code means that false uses to autoconnection. However, I found the API at here, it said that BluetoothGatt connectGatt(Context context, boolean autoConnect, BluetoothGattCallback callback,

Android BLE write byte[] including unsigned values

本小妞迷上赌 提交于 2019-12-25 07:52:31
问题 this question started life here here but this appears to be a red herring! So, the issue is, I have a byte array of values that need to be written to a BLE device. byte bytes[] = {0x04,0x08,0x0F,0x66,(byte)0x99,0x41,0x52,0x43,0x55,(byte)0xAA}; ch.setValue(bytes); If I log the output of this array I get (note the negative values): [4, 8, 15, 102, -103, 65, 82, 67, 85, -86] But in theory this should only be java's representation of the values and shouldn't affect the perceived values when they

Bluetooth Connection drops automatically with Anrdoid Application

旧时模样 提交于 2019-12-24 19:38:46
问题 I am creating an application which Connects with the BLE Device with android application programmatically. Here's my code for the Connect / Disconnect When use clicks on the Connect button new Thread(new Runnable() { @Override public void run() { mConnecting = true; mConnectException = null; mConnectWait.close(); // Reset the condition. if (mConnectedGatt != null) { // Reconnect to the BLE DEX adapter. Logger.d(LOG_TAG, "going to connect"); mConnectedGatt.connect(); BluetoothDevice device =