How to get currently connected BLE peripherals in Android
up vote
0
down vote
favorite
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!
add a comment |
up vote
0
down vote
favorite
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!
check this answer
– Salman Naseem
Nov 12 at 10:46
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
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!
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!
asked Nov 9 at 2:39
final static
1,23231948
1,23231948
check this answer
– Salman Naseem
Nov 12 at 10:46
add a comment |
check this answer
– Salman Naseem
Nov 12 at 10:46
check this answer
– Salman Naseem
Nov 12 at 10:46
check this answer
– Salman Naseem
Nov 12 at 10:46
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
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.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
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.
add a comment |
up vote
0
down vote
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.
add a comment |
up vote
0
down vote
up vote
0
down vote
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.
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.
answered Nov 11 at 11:09
Emil
5,56921123
5,56921123
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53219083%2fhow-to-get-currently-connected-ble-peripherals-in-android%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
check this answer
– Salman Naseem
Nov 12 at 10:46