@@ -84,7 +84,7 @@ class NimBLEAttValue {
8484 * @param[in] init_len The initial size in bytes.
8585 * @param[in] max_len The max size in bytes that the value can be.
8686 */
87- NimBLEAttValue (uint16_t init_len = CONFIG_NIMBLE_CPP_ATT_VALUE_INIT_LENGTH, uint16_t max_len = BLE_ATT_ATTR_MAX_LEN);
87+ explicit NimBLEAttValue (uint16_t init_len = CONFIG_NIMBLE_CPP_ATT_VALUE_INIT_LENGTH, uint16_t max_len = BLE_ATT_ATTR_MAX_LEN);
8888
8989 /* *
9090 * @brief Construct with an initial value from a buffer.
@@ -99,7 +99,7 @@ class NimBLEAttValue {
9999 * @param value A pointer to the initial value to set.
100100 * @param[in] max_len The max size in bytes that the value can be.
101101 */
102- NimBLEAttValue (const char * value, uint16_t max_len = BLE_ATT_ATTR_MAX_LEN)
102+ explicit NimBLEAttValue (const char * value, uint16_t max_len = BLE_ATT_ATTR_MAX_LEN)
103103 : NimBLEAttValue((uint8_t *)value, (uint16_t )strlen(value), max_len) {}
104104
105105 /* *
@@ -115,15 +115,15 @@ class NimBLEAttValue {
115115 * @param str A std::string containing to the initial value to set.
116116 * @param[in] max_len The max size in bytes that the value can be.
117117 */
118- NimBLEAttValue (const std::string str, uint16_t max_len = BLE_ATT_ATTR_MAX_LEN)
118+ explicit NimBLEAttValue (const std::string& str, uint16_t max_len = BLE_ATT_ATTR_MAX_LEN)
119119 : NimBLEAttValue(reinterpret_cast <const uint8_t *>(&str[0 ]), str.length(), max_len) {}
120120
121121 /* *
122122 * @brief Construct with an initial value from a std::vector<uint8_t>.
123123 * @param vec A std::vector<uint8_t> containing to the initial value to set.
124124 * @param[in] max_len The max size in bytes that the value can be.
125125 */
126- NimBLEAttValue (const std::vector<uint8_t > vec, uint16_t max_len = BLE_ATT_ATTR_MAX_LEN)
126+ explicit NimBLEAttValue (const std::vector<uint8_t >& vec, uint16_t max_len = BLE_ATT_ATTR_MAX_LEN)
127127 : NimBLEAttValue(&vec[0 ], vec.size(), max_len) {}
128128
129129# ifdef NIMBLE_CPP_ARDUINO_STRING_AVAILABLE
0 commit comments