JLT
JLT

Reputation: 3172

How to get currently connected BLE peripherals in Android

Sometime a user can directly connect a ble peripheral under settings. But when the app is launched and started scanning for devices, the peripheral cannot be discovered because it is already connected and stopped advertising.

So, is there anyway to get all currently connected ble peripherals in Android filtered by service UUID?

Thanks!

Upvotes: 0

Views: 806

Answers (1)

Emil
Emil

Reputation: 18452

You can use https://developer.android.com/reference/android/bluetooth/BluetoothManager#getConnectedDevices(int). However, you can't filter on service uuid. In that case you need to first make your own gatt connection and perform a service discovery.

Upvotes: 0

Related Questions