| 321 | } |
| 322 | |
| 323 | int findBytes(const std::vector<uint8_t> &data, const String &needle) { |
| 324 | if (needle.isEmpty() || data.size() < static_cast<size_t>(needle.length())) return -1; |
| 325 | for (size_t i = 0; i <= data.size() - needle.length(); ++i) { |
| 326 | bool match = true; |
| 327 | for (int j = 0; j < needle.length(); ++j) { |
| 328 | if (data[i + j] != static_cast<uint8_t>(needle[j])) { |
| 329 | match = false; |
| 330 | break; |
| 331 | } |
| 332 | } |
| 333 | if (match) return i; |
| 334 | } |
| 335 | return -1; |
| 336 | } |
| 337 | |
| 338 | bool writeUploadData(File &file, const uint8_t *data, size_t len, size_t written) { |
| 339 | if (!update) return file.write(data, len) == len; |
no outgoing calls
no test coverage detected