Skip to content

[1.0.5-rc3] AdvertisedDevice::getServiceDataUUID() excepts when no UUID is present #4596

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mkfrey opened this issue Dec 1, 2020 · 2 comments
Labels
Status: Stale Issue is stale stage (outdated/stuck)

Comments

@mkfrey
Copy link
Contributor

mkfrey commented Dec 1, 2020

I'm preparing the migration of some of my code from 1.0.4 to 1.0.5 and found that the behaviour of AdvertisedDevice::getServiceDataUUID() has now changed.

I don't know if this is actually a bug, but this new behaviour could lead to some confusion for beginners,
since function calls like this should not throw an exception my opinion. So I'm opening this issue.

In 1.0.4 a call to AdvertisedDevice::getServiceDataUUID() would return the advertised devices member m_serviceDataUUID. If the device did not advertise any service, this would be a BLEUUID created with the default constructor.

As of 1.0.5-rc3, this call returns the first element of the vector m_serviceUUIDs. This vector contains no entries if no UUIDs were advertised, which means that m_serviceUUIDs[0] might throw an exception.

There also seems to be no function for getting the count of advertised UUIDs. This is an issue, because there is no way to determine beforehand whether AdvertisedDevice::getServiceDataUUID() or BLEAdvertisedDevice::getServiceDataUUID(int i) will cause an exception.

@stale
Copy link

stale bot commented Jan 31, 2021

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Stale Issue is stale stage (outdated/stuck) label Jan 31, 2021
@stale
Copy link

stale bot commented Feb 16, 2021

[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.

@stale stale bot closed this as completed Feb 16, 2021
me-no-dev pushed a commit that referenced this issue Feb 16, 2021
fixes #4596

* Prevent possible undefined behaviour by get methods not taking an index as parameter
* Add methods to get the count of service data UUIDs and service UUIDs
* Various code improvements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Stale Issue is stale stage (outdated/stuck)
Projects
None yet
Development

No branches or pull requests

1 participant