Repository navigation
Add explicit keyword to constructors #1206
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -281,6 +281,26 @@ void NimBLEService::removeCharacteristic(NimBLECharacteristic* pChar, bool delet | |
| * @param idx The index of the characteristic to return (used when multiple characteristics have the same UUID). | ||
| * @return A pointer to the characteristic object or nullptr if not found. | ||
| */ | ||
| NimBLECharacteristic* NimBLEService::getCharacteristic(uint16_t uuid, uint16_t idx) const { | ||
| return getCharacteristic(NimBLEUUID(uuid), idx); | ||
| } // getCharacteristic | ||
|
|
||
| /** | ||
| * @brief Get a pointer to the characteristic object with the specified 32-bit UUID. | ||
| * @param [in] uuid The characteristic's 32-bit UUID. | ||
| * @param idx The index of the characteristic to return (used when multiple characteristics have the same UUID). | ||
| * @return A pointer to the characteristic object or nullptr if not found. | ||
| */ | ||
| NimBLECharacteristic* NimBLEService::getCharacteristic(uint32_t uuid, uint16_t idx) const { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Accept ordinary integer literals in numeric lookups. Arr,
|
||
| return getCharacteristic(NimBLEUUID(uuid), idx); | ||
| } // getCharacteristic | ||
|
|
||
| /** | ||
| * @brief Get a pointer to the characteristic object with the specified UUID. | ||
| * @param [in] uuid The characteristic UUID string. | ||
| * @param idx The index of the characteristic to return (used when multiple characteristics have the same UUID). | ||
| * @return A pointer to the characteristic object or nullptr if not found. | ||
| */ | ||
| NimBLECharacteristic* NimBLEService::getCharacteristic(const char* uuid, uint16_t idx) const { | ||
| return getCharacteristic(NimBLEUUID(uuid), idx); | ||
| } // getCharacteristic | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Match equivalent 16-bit and 32-bit UUIDs.
Arr, after
createCharacteristic("2A19"),getCharacteristic(uint32_t{0x2A19})returnsnullptr.NimBLEUUID::operator==rejects a 16-bit UUID compared with a 32-bit UUID, although these values represent the same Bluetooth UUID. The reverse width combination also fails. Normalize numeric lookups or fix UUID equality for both combinations. (raw.githubusercontent.com)Also applies to: 295-295