bluetooth-lowenergy

Debugging BLE HID device

谁说我不能喝 提交于 2019-12-13 03:19:39
问题 I'm trying to make an Android application for Android Things running on raspberry pi that takes USB joystick inputs (including DJI Mavic controller) and passes it over BLE HID as a gamepad. Windows, Oculus Quest and Mac all recognize it as a gamepad, but when I try to connect to it, they connect and disconnect right away. I'm not sure why Is there any tool on any OS that logs the BLE HID pairing process to find out what went wrong? https://github.com/darvin/USBMavicBLEHIDAndroidThing/blob

Looping on beacons

余生长醉 提交于 2019-12-13 03:14:41
问题 @Override public void onBeaconServiceConnect() { BeaconManager beaconManager = BeaconManager.getInstanceForApplication(this); beaconManager.setRangeNotifier(new RangeNotifier() { @Override public void didRangeBeaconsInRegion(Collection<Beacon> beacons, Region region) { for (Beacon beacon : beacons) { Beacon.setHardwareEqualityEnforced(true); Log.i("MainActivity", "I see a beacon that is about "+ beacon.getDistance() +" meters away. "); } } }); try { beaconManager.startRangingBeaconsInRegion

Simultaneous BLE connection

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 03:14:22
问题 How to determine maximum number simultaneous BLE connection possible with a Bluetooth Chipset like CSR8510.Where CSR8510 act as a BLE Master and end device act as a BLE slave. What should all parameter we consider to determine? 回答1: There is no HCI protocol message to get this number. You need to create connections with LE Create Connection Command to slaves until you get the HCI error 0x09 (Connection Limit Exceeded). The CSR8510 can have 5 connections in master mode to slave devices. It can

Android BLE Beacon scanning on different phone models

僤鯓⒐⒋嵵緔 提交于 2019-12-13 02:49:47
问题 I am writing Android Application on finding and detecting IBeacons(These are BLE devices) and ranging them(depending on RSSI value) I use Sample code from https://developer.android.com/guide/topics/connectivity/bluetooth-le.html But this Code works different on my android devices (Samsung Galaxy S3 and LG G3). On my S3 the "onLeScan" callback rises many times in loop (about 5 per second) and give me different RSSI values every time depending on the range. But on my LG G3 the "onLeScan"

BLE receiving GATT notifications from a characteristic

隐身守侯 提交于 2019-12-13 02:49:02
问题 I want to receive notifications when this characteristic is changed Micro:Bit. What I'm doing is basically the following: 1) Check if the system is compatible with BLE 2) Enable bluetooth in case it's disabled 3) Connect to the only one paired device (Micro:Bit) 4) Activate this code when connectivity changes (¿Connected/Disconnected?) 5) Activate this code when characteristic is updated ¿? public class MainActivity extends Activity { BluetoothAdapter bleAdapter; @Override protected void

BluetoothCrashResolver detects a crash on app launch

雨燕双飞 提交于 2019-12-13 00:29:20
问题 BluetoothCrashResolver detects a crash on app launch the sequence of flow is as follows: 1.the device's bluetooth is off initially 2.the app is launched 3.the app first checks whether bluetooth is on 4.if not ON,app displays a popup to enable bluetooth 5.User allows bluetooth to be switched on 6.bluetoothresolver says "crash detected" as lastBluetoothTurningOnTime=01/01/1970; lastBluetoothOffTime=01/01‌​/1970; so the if statement inside "case BluetoothAdapter.STATE_ON" fails. Let me know if

How can I create a secured connection to BLE peripheral through CBCentralManager?

孤街醉人 提交于 2019-12-13 00:12:30
问题 I am new to iOS and Core Bluetooth. What I would like to know is how to create a secured connection to the device. What I understand is: [manager connectPeripheral:peripheral options:nil] is the API provided to connect to the BLE device. From this, how do I establish a secured connection? 回答1: All BT4.0 connections are secured and managed by the device/sensor and iOS, you do not have control over this. BT4.0 devices you also have bounded and unbounded connections. Bounded connections are in a

Cannot establish BLE connection between Android 5 and BLE device

牧云@^-^@ 提交于 2019-12-12 21:34:27
问题 I'm stuck with implementing connection between Android Lollipop smartphone and BLE device (TI experimenter board with BLE module). I use following call to connect: device.connectGatt(context, true, mGattCallback); I've managed to establish connection for Android 4.3 and 4.4, but when I use this same code for Android 5, I get following error on BluetoothGattCallback::onConnectionStateChange : onClientConnectionState() - status=133 clientIf=5 device=D0:36:12:CD:73:49 Error code 133 means GATT

How to connect the Bluetooth device by click the item of listview in Android?

徘徊边缘 提交于 2019-12-12 21:14:37
问题 I am developing an application where I have to connect to Bluetooth device on Android 4.3. I can scan the bluetooth device, but it can not connect the bluetooth device. I have already add the permission in Manifest of the following: <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <uses-permission android:name="android.permission.BLUETOOTH" /> My Operation is when I push SCAN Button, it will scan the Bluetooth device and show on the ListView. When I click the bluetooth

android- ble device status shows connected for some seconds even after turning off the device

匆匆过客 提交于 2019-12-12 20:08:53
问题 I m developing a ble app that goes out of range many times or turns off, it is designed to do so. if connected to android if i turn off my Bluetooth low energy (smart) device the Bluetooth manager still keeps that profile for some time and then removes it after calling the onClientConnectionState() method. Even the device is visible in the list i get from getConnectedDevices(int) . how can i invoke the method device removal from the android device 回答1: There are two parameters used in ble