MCPcopy Create free account
hub / github.com/FastLED/FastLED / readString

Method readString

src/fl/system/serial.cpp.hpp:141–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139}
140
141fl::string SerialPort::readString() {
142 fl::string result;
143 u32 startTime = fl::millis();
144
145 while (fl::millis() - startTime < mTimeoutMs) {
146 if (available() > 0) {
147 int c = read();
148 if (c != -1) {
149 result += static_cast<char>(c);
150 startTime = fl::millis(); // Reset timeout on successful read
151 }
152 }
153 }
154
155 return result;
156}
157
158fl::string SerialPort::readStringUntil(char delimiter) {
159 fl::string result;

Callers

nothing calls this directly

Calls 3

millisFunction · 0.50
availableFunction · 0.50
readFunction · 0.50

Tested by

no test coverage detected