Add ==,!= operators to NimBLEAddress, pass parameters by const reference.

This commit is contained in:
h2zero
2020-05-10 07:21:46 -06:00
parent fba7e0fd68
commit f0191eb1e6
41 changed files with 217 additions and 183 deletions
+3 -3
View File
@@ -187,7 +187,7 @@ void NimBLEDescriptor::setHandle(uint16_t handle) {
* @param [in] data The data to set for the descriptor.
* @param [in] length The length of the data in bytes.
*/
void NimBLEDescriptor::setValue(uint8_t* data, size_t length) {
void NimBLEDescriptor::setValue(const uint8_t* data, size_t length) {
if (length > BLE_ATT_ATTR_MAX_LEN) {
NIMBLE_LOGE(LOG_TAG, "Size %d too large, must be no bigger than %d", length, BLE_ATT_ATTR_MAX_LEN);
return;
@@ -201,7 +201,7 @@ void NimBLEDescriptor::setValue(uint8_t* data, size_t length) {
* @brief Set the value of the descriptor.
* @param [in] value The value of the descriptor in string form.
*/
void NimBLEDescriptor::setValue(std::string value) {
void NimBLEDescriptor::setValue(const std::string &value) {
setValue((uint8_t*) value.data(), value.length());
} // setValue
@@ -245,4 +245,4 @@ void NimBLEDescriptorCallbacks::onWrite(NimBLEDescriptor* pDescriptor) {
} // onWrite
#endif /* CONFIG_BT_ENABLED */
#endif /* CONFIG_BT_ENABLED */