mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 06:32:19 +03:00
избавился от string в приеме веб сокетов
This commit is contained in:
@@ -1,5 +1,20 @@
|
||||
#include "Utils/FileUtils.h"
|
||||
|
||||
void writeFileUint8(const String& filename, uint8_t*& payload, size_t length, size_t headerLenth) {
|
||||
String path = filepath(filename);
|
||||
auto file = FileFS.open(path, "w");
|
||||
if (!file) {
|
||||
Serial.println(F("failed write file uint8"));
|
||||
}
|
||||
for (size_t i = 0; i < length; i++) {
|
||||
if (i >= headerLenth) {
|
||||
file.print((char)payload[i]);
|
||||
yield();
|
||||
}
|
||||
}
|
||||
file.close();
|
||||
}
|
||||
|
||||
File seekFile(const String& filename, size_t position) {
|
||||
String path = filepath(filename);
|
||||
auto file = FileFS.open(path, "r");
|
||||
|
||||
Reference in New Issue
Block a user