You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
[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.
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
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 memberm_serviceDataUUID
. If the device did not advertise any service, this would be aBLEUUID
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 thatm_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()
orBLEAdvertisedDevice::getServiceDataUUID(int i)
will cause an exception.The text was updated successfully, but these errors were encountered: