android-bluetooth

Every connection request is being treated as direct connect request + android ble

天大地大妈咪最大 提交于 2019-11-29 21:56:33
问题 We are writing a ble application where want to have a persistent connection with the peripheral we want to connect. For the same purpose we want to re-connect with the peripheral whenever we loose a existing connection. So our android application as a central just tries to reconnect by creating new bluetoothgatt object by calling bluetoothdevice.connectgatt with autoconnect as true. But whenever we try to do that our reconnection gets failed with 12-02 21:47:11.865: D/BluetoothGatt(31963):

Bluetooth Low Energy Connection Parameters for Android, iOS and Win8

你离开我真会死。 提交于 2019-11-29 21:54:37
I've been looking all over the place for the required bluetooth connection parameters that will work for all three of these operating platforms. I'm using the HOGP (Bluetooth over HID GATT) profile for this project. My project is an embedded system written by myself with a BLE module that I have control over the following parameters for connection. Connection Interval Min Connection Interval Max Slave Latency Supervision Timeout Advertising Interval Min Advertising Interval Max My target devices to connect will be to satisfy connnections with Android >= 4.3, iOS7, and >= Win 8.1. Apple was

How to send data over a Bluetooth Low Energy (BLE) link?

空扰寡人 提交于 2019-11-29 21:47:09
I am able to discover, connect to bluetooth. Source Code--- Connect via bluetooth to Remote Device: //Get the device by its serial number bdDevice = mBluetoothAdapter.getRemoteDevice(blackBox); //for ble connection bdDevice.connectGatt(getApplicationContext(), true, mGattCallback); Gatt CallBack for Status: private BluetoothGattCallback mGattCallback = new BluetoothGattCallback() { @Override public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) { //Connection established if (status == BluetoothGatt.GATT_SUCCESS && newState == BluetoothProfile.STATE_CONNECTED) { /

Android 6.0 Marshmallow BLE : Connection Parameters

*爱你&永不变心* 提交于 2019-11-29 19:33:54
The Bluetooth Low Energy connection parameters management seems to have changed in Android 6. I have a BLE Peripheral device who needs to use some specific connection parameters (notably, the connection interval), and I want to use the minimum connection interval allowed by the BLE specification (i.e. 7,5ms). The Android SDK doesn't allow to choose it from the BLE GAP Central (the smartphone) side, so the proper way to do it is to make my GAP Peripheral device send a L2CAP Connection Parameter Update Request after the GAP connection is made. The parameters I request are: conn interval min : 7

Accepting a Call via Bluetooth Headset

天涯浪子 提交于 2019-11-29 18:08:34
问题 i am working on a VoIP-Android-App. I would like to accept and decline Calls via a connnected Bluetooth Headset in an Activity. What I have tried so far: Using a Media Session to receive Media Button clicks. Problem: If we start BluetoothSCO we do not receive any Media Button clicks. If we do not start BluetoothSCO we do receive Media Button clicks but we cannot differentiate long and short button clicks because downtime is always 0, the keycode is always KEYCODE_MEDIA_PLAY and the ACTION

The perfect function to check Android internet connectivity including bluetooth pan

自作多情 提交于 2019-11-29 11:55:43
问题 My application is working perfect in wifi and mobile networks, but fails to detect when connected through bluetooth tethering. public boolean isNetworkAvailable() { ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = cm.getActiveNetworkInfo(); if (networkInfo != null && networkInfo.isConnected()) { return true; } return false; } I tried running a few other applications . they also shows no network connectivity, But google

What is “reliable write” in BLE?

六眼飞鱼酱① 提交于 2019-11-29 09:22:37
In Android's BLE API ( BluetoothGatt ) there are methods that deal with reliable writes : public boolean beginReliableWrite () public void abortReliableWrite (BluetoothDevice mDevice) public boolean executeReliableWrite () There is also a Callback for it (in BluetoothGattCallback ): public void onReliableWriteCompleted (BluetoothGatt gatt, int status) I can't find any documentation on that. What is it? How is it different from "normal" (unreliable?) writes? bottersb Reliable write allows checking back transmitted values and atomic execution of one or mutliple transmitted messages. A good

Bluetooth not connecting on 4.4.2

偶尔善良 提交于 2019-11-29 05:25:26
问题 I've got a Bluetooth device that has connected on all versions of Android that I have tried prior to 4.4.2. Now, it's not connecting on the Galaxy Tab 4 or the S3. The Tab 3 connects fine with 4.1.2. The problem seems to occur in the AcceptThread while trying to initialize the BluetoothSocket . The code I'm using is based off of the chat example in the sdk. My Accept code private class AcceptThread extends Thread { // The local server socket private BluetoothServerSocket mmServerSocket;

Any way to implement BLE notifications in Android-L preview

好久不见. 提交于 2019-11-29 00:43:31
This question is not about Android notificatinos, but BLE notifications (as the title may hint) I have got basic BLE peripheral mode working on Android-L Is there any way to implement BLE notifications in Android-L preview. I could do some thing like the following to make a charecteritic be able to notify, but trying to listen for BluetoothGattCharacteristic firstServiceChar = new BluetoothGattCharacteristic( UUID.fromString(serviceOneCharUuid), BluetoothGattCharacteristic.PROPERTY_NOTIFY, BluetoothGattCharacteristic.PERMISSION_READ ); But in LightBlue app on iOS I cannot subscribe to this

Bluetooth HCI snoop log not generated

六月ゝ 毕业季﹏ 提交于 2019-11-29 00:39:30
问题 I'm running Android 4.4.2 and I enabled the "Bluetooth HCI snoop log" as described here Sniffing/logging your own Android Bluetooth traffic After turning bluetooth on and off I rebooted the phone. I could not find the log file in the expected location: $ adb pull /sdcard/btsnoop_hci.log remote object '/sdcard/btsnoop_hci.log' does not exist How can I get to the btsnoop_hci.log? 回答1: According to my experience the Bluetooth HCI snooping feature requires your device to be rooted. On my rooted