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

How to make a BLE connection that is connected using service to use across the activities without stopping the service or disconnecting ble?

非 Y 不嫁゛ 提交于 2020-01-01 05:39:07
问题 I have 3 components. Activity1 has button for connecting and disconnecting the BLE Connection Activity2 Needs to Get the data from the BLE Device. Service All the connection logic (like getRemoteDevice(),connectGatt etc.,) belongs to service. Activity1 is connecting to BLE Device by binding the service. Intent gattServiceIntent = new Intent(mContext,BleService.class);//In Activity1 context bindService(gattServiceIntent, mServiceConnection,BIND_AUTO_CREATE); and makes connection to ble device

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

bluetoothGatt writeCharacteristic returns false

南楼画角 提交于 2019-12-22 09:01:33
问题 I created a peripheral with a WRITE_TYPE_NO_RESPONSE characteristic. With another application, I wrote on characteristic, but I have an occasional problem with samsung galaxy nexus i9250 with lollipop 5.1.1: sometimes the function BluetoothGatt.writeCharacteristic returns false and the write is not done. What could it be ? Can it be cyanogenmod's fault ? And in what way can I patch this problem ? On peripherall : new BluetoothGattCharacteristic( UUID.fromString(characteristic),

Why isMultipleAdvertisementSupported() returns false, when getBluetoothLeAdvertiser returns an object?

人盡茶涼 提交于 2019-12-21 19:41:36
问题 I am trying to play with BLE transmission on my device. Here is the code I use and the output: // check BLE support Log.i(TAG, "BLE supported: " + getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)); // true // check BLE transmission support final BluetoothManager bluetoothManager = (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE); BluetoothAdapter mBluetoothAdapter = bluetoothManager.getAdapter(); Log.i(TAG, "isMultipleAdvertisementSupported: " +

How to Send an Audio HEX file to Ble Device

馋奶兔 提交于 2019-12-19 11:45:20
问题 I have a working ble device with android . it sends and receives data finely through the Android app. But Now My Problem is I want to send Some Audio HEX files to my BLE Device. And its larger Than 20 bytes. How Can i send such a data to a BLE Device. ?? 回答1: For send data upper than 20bytes, you need to change the MTU-exchange. To API LEVEL 21, you can use requestMtu (Android Developer), it negotiates with the peripherical device and you can define until 512 bytes. The MTU value is defined

Sending Large File via BLE API on android

寵の児 提交于 2019-12-14 00:24:56
问题 I have created BLE sender class for the sending large ByteArray via Bluetooth LE The logic of the send process following: Write descriptor to enable notification on characteristics that sends data Notify peripheral about data sending process via writing to corresponding characteristics (Size of data: chunk size: number of chunks) Wait for peripheral to notify for chunk 0 to send on data sending characteristics On notification received start sending the first chunk 1000 byte by blocks of 20

How do I effectively read temperature from two BLE devices at the same time?

萝らか妹 提交于 2019-12-12 16:38:04
问题 First of all, I am using RxAndroidBLE library to manage my BLE connections. I have two SensorTag devices and I want to read temperature from both at the same time. For example, I'd like to read the temperature from both devices exactly every 500ms and display it to user in two TextViews. My app currently successfully connects to both BLE devices like this: @OnClick(R.id.connectButton1) public void connectFirstSensorTag(Button b) { if (!isDeviceConnected(sensorTag1)) { connectionObservable1 =

BLE different MTU for different implementations

懵懂的女人 提交于 2019-12-11 06:58:01
问题 I have tried different implementations of BLE connection on Android. One with RxAndroidBle and another one with simple Android API. I used RxAndroidBle example app for testing. I connect to the same peripheral with the same service and characteristic. Though when I read or get notifications from it in the case of RxAndroidBle I receive 512 bytes and in the case of Android API - just 20. I try to request MTU 512 but onMtuChanged is never called and I still receive 20. Do I miss something? 来源:

BLE BluetoothGattCallback gets a STATE_DISCONNECTED when device is still ON

眉间皱痕 提交于 2019-12-10 11:56:24
问题 I connect to the bluetooth device using this method: /** * Connects to the GATT server hosted on the Bluetooth LE device. * * @param address The device address of the destination device. * * @return Return true if the connection is initiated successfully. The connection result * is reported asynchronously through the * {@code BluetoothGattCallback#onConnectionStateChange(android.bluetooth.BluetoothGatt, int, int)} * callback. */ public boolean connect(final String address) { if