question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: access to advertised data

See original GitHub issue

While debugging my BLE Android app, I felt the need to access advertised data (to check that my BLE server app was advertising correctly). Unless I’m wrong, there’s not much about this in the library.

For example, getServices() allows to get the list of services available from a connected peripheral, but it would be nice to also have a way to get the list of advertised/exposed services from a not-connected peripheral (returned by onDiscoveredPeripheral()).

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
weliemcommented, May 25, 2021

The advertised data is also available and encapsulated by the ScanResult object. You get this along with the peripheral object:

onDiscoveredPeripheral(@NotNull BluetoothPeripheral peripheral, @NotNull ScanResult scanResult)

The ScanResult is a plain Android object, see ScanResult

The information about which services are advertised is in the ScanRecord: List<ParcelUuid> serviceUUIDs = scanResult.getScanRecord().getServiceUuids();

0reactions
steph643commented, May 26, 2021

But since that is rather obvious…

My point exactly: it sounds obvious at first but it’s not, as getServices() could have returned the advertised services of a non-connected peripheral.

After being connected, a connection might drop any time. So instead of throwing exceptions for totally normal situations I decided to handle it gracefully. Otherwise your code would be full of try/catch statements…

“Not handling” and “handling gracefully” are two different things. The user is informed of a connection drop through onPeripheralDisconnected(), and I think it should be his choice to manage the exceptions or not.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Enable Remarketing and Advertising Reporting Features in ...
In the Property column, click Tracking Info, then click Data Collection. Under Data Collection for Advertising Features: To enable Remarketing, set Remarketing ...
Read more >
If an app asks to track your activity - Apple Support
If you choose Ask App Not to Track, the app developer can't access the system advertising identifier (IDFA), which is often used to...
Read more >
Savio: Track feature requests and organize customer feedback
Track feature requests and product feedback from your support and NPS tools, CRM, and Google Docs. Prioritize your roadmap with data.
Read more >
Let Users Request Access to Content and Projects - Tableau
When someone requests access, the owner who controls permissions for that content (either at the project or workbook level) receives an email with...
Read more >
Feature Request - Enterprise Data Erasure
Product(s) you require support for... *. XErase; XImage; EraseSURE; Octane Erasure Appliance; Portable Erasure Appliance; Ultra Portable Erasure Appliance
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found