Skip to content

Commit 7ca5a7e

Browse files
committed
Fix conflict with master branch.
- Avoid single character String concatenations done via String literals instead of char literals, as this is inefficient because of temporary String creations (esp8266#6571).
1 parent f8ec4f1 commit 7ca5a7e

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

libraries/ESP8266WiFiMesh/src/ESP8266WiFiMesh.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ transmission_status_t ESP8266WiFiMesh::exchangeInfo(WiFiClient &currClient)
372372
{
373373
verboseModePrint("Transmitting"); // Not storing strings in flash (via F()) to avoid performance impacts when using the string.
374374

375-
currClient.print(getMessage() + "\r");
375+
currClient.print(getMessage() + '\r');
376376
yield();
377377

378378
if (!waitForClientTransmission(currClient, _stationModeTimeoutMs))
@@ -585,11 +585,11 @@ void ESP8266WiFiMesh::attemptTransmission(const String &message, bool concluding
585585

586586
if(_verboseMode) // Avoid string generation if not required
587587
{
588-
verboseModePrint(String(F("AP acquired: ")) + currentSSID + String(F(", Ch:")) + String(currentWiFiChannel) + " ", false);
588+
verboseModePrint(String(F("AP acquired: ")) + currentSSID + String(F(", Ch:")) + String(currentWiFiChannel) + ' ', false);
589589

590590
if(currentNetwork.networkIndex != NETWORK_INFO_DEFAULT_INT)
591591
{
592-
verboseModePrint("(" + String(WiFi.RSSI(currentNetwork.networkIndex)) + String(F("dBm) ")) +
592+
verboseModePrint('(' + String(WiFi.RSSI(currentNetwork.networkIndex)) + String(F("dBm) ")) +
593593
(WiFi.encryptionType(currentNetwork.networkIndex) == ENC_TYPE_NONE ? String(F("open")) : ""), false);
594594
}
595595

@@ -665,7 +665,7 @@ void ESP8266WiFiMesh::acceptRequest()
665665
if (_client.connected())
666666
{
667667
verboseModePrint("Responding"); // Not storing strings in flash (via F()) to avoid performance impacts when using the string.
668-
_client.print(response + "\r");
668+
_client.print(response + '\r');
669669
_client.flush();
670670
yield();
671671
}

libraries/ESP8266WiFiMesh/src/EspnowMeshBackend.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ bool EspnowMeshBackend::activateEspnow()
165165
warningPrint("Failed to set ESP-NOW role! Maybe ESP-NOW peers are already added?");
166166

167167
verboseModePrint("ESP-NOW activated.");
168-
verboseModePrint("My ESP-NOW STA MAC: " + WiFi.macAddress() + "\n"); // Get the station MAC address. The softAP MAC is different.
168+
verboseModePrint("My ESP-NOW STA MAC: " + WiFi.macAddress() + '\n'); // Get the station MAC address. The softAP MAC is different.
169169

170170
return true;
171171
}

libraries/ESP8266WiFiMesh/src/MeshBackendBase.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,11 @@ void MeshBackendBase::printAPInfo(const NetworkInfoBase &apNetworkInfo)
282282
mainNetworkIdentifier = macToString(apNetworkInfo.BSSID());
283283
}
284284

285-
verboseModePrint(String(F("AP acquired: ")) + mainNetworkIdentifier + String(F(", Ch:")) + String(apNetworkInfo.wifiChannel()) + " ", false);
285+
verboseModePrint(String(F("AP acquired: ")) + mainNetworkIdentifier + String(F(", Ch:")) + String(apNetworkInfo.wifiChannel()) + ' ', false);
286286

287287
if(apNetworkInfo.RSSI() != NetworkInfoBase::defaultRSSI)
288288
{
289-
verboseModePrint("(" + String(apNetworkInfo.RSSI()) + String(F("dBm) ")) +
289+
verboseModePrint('(' + String(apNetworkInfo.RSSI()) + String(F("dBm) ")) +
290290
(apNetworkInfo.encryptionType() == ENC_TYPE_NONE ? String(F("open")) : ""), false);
291291
}
292292

libraries/ESP8266WiFiMesh/src/TcpIpMeshBackend.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ transmission_status_t TcpIpMeshBackend::exchangeInfo(WiFiClient &currClient)
247247
{
248248
verboseModePrint("Transmitting"); // Not storing strings in flash (via F()) to avoid performance impacts when using the string.
249249

250-
currClient.print(getCurrentMessage() + "\r");
250+
currClient.print(getCurrentMessage() + '\r');
251251
yield();
252252

253253
if (!waitForClientTransmission(currClient, _stationModeTimeoutMs))
@@ -550,7 +550,7 @@ void TcpIpMeshBackend::acceptRequests()
550550
if (_client.connected())
551551
{
552552
verboseModePrint("Responding"); // Not storing strings in flash (via F()) to avoid performance impacts when using the string.
553-
_client.print(response + "\r");
553+
_client.print(response + '\r');
554554
_client.flush();
555555
yield();
556556
}

0 commit comments

Comments
 (0)