@@ -79,8 +79,8 @@ void BLERemoteService::gattClientEventHandler(esp_gattc_cb_event_t event, esp_ga
7979
8080 // This is an indication that we now have the characteristic details for a characteristic owned
8181 // by this service so remember it.
82- m_characteristicMap.insert(std::pair<String , BLERemoteCharacteristic*>(
83- BLEUUID(evtParam->get_char.char_id.uuid).toString(),
82+ m_characteristicMap.insert(std::pair<std::string , BLERemoteCharacteristic*>(
83+ BLEUUID(evtParam->get_char.char_id.uuid).toString().c_str() ,
8484 new BLERemoteCharacteristic(evtParam->get_char.char_id, evtParam->get_char.char_prop, this) ));
8585
8686
@@ -134,7 +134,7 @@ BLERemoteCharacteristic *BLERemoteService::getCharacteristic(BLEUUID uuid) {
134134 if (!m_haveCharacteristics) {
135135 retrieveCharacteristics ();
136136 }
137- String v = uuid.toString ();
137+ std::string v = uuid.toString (). c_str ();
138138 for (auto &myPair : m_characteristicMap) {
139139 if (myPair.first == v) {
140140 return myPair.second ;
@@ -179,7 +179,9 @@ void BLERemoteService::retrieveCharacteristics() {
179179 // We now have a new characteristic ... let us add that to our set of known characteristics
180180 BLERemoteCharacteristic *pNewRemoteCharacteristic = new BLERemoteCharacteristic (result.char_handle , BLEUUID (result.uuid ), result.properties , this );
181181
182- m_characteristicMap.insert (std::pair<String, BLERemoteCharacteristic *>(pNewRemoteCharacteristic->getUUID ().toString (), pNewRemoteCharacteristic));
182+ m_characteristicMap.insert (
183+ std::pair<std::string, BLERemoteCharacteristic *>(pNewRemoteCharacteristic->getUUID ().toString ().c_str (), pNewRemoteCharacteristic)
184+ );
183185 m_characteristicMapByHandle.insert (std::pair<uint16_t , BLERemoteCharacteristic *>(result.char_handle , pNewRemoteCharacteristic));
184186 offset++; // Increment our count of number of descriptors found.
185187 } // Loop forever (until we break inside the loop).
@@ -192,7 +194,7 @@ void BLERemoteService::retrieveCharacteristics() {
192194 * @brief Retrieve a map of all the characteristics of this service.
193195 * @return A map of all the characteristics of this service.
194196 */
195- std::map<String , BLERemoteCharacteristic *> *BLERemoteService::getCharacteristics () {
197+ std::map<std::string , BLERemoteCharacteristic *> *BLERemoteService::getCharacteristics () {
196198 log_v (" >> getCharacteristics() for service: %s" , getUUID ().toString ().c_str ());
197199 // If is possible that we have not read the characteristics associated with the service so do that
198200 // now. The request to retrieve the characteristics by calling "retrieveCharacteristics" is a blocking
0 commit comments