MCPcopy Create free account
hub / github.com/OpenEPaperLink/OpenEPaperLink / getDataForFile

Function getDataForFile

ESP32_AP-Flasher/src/newproto.cpp:44–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44uint8_t* getDataForFile(fs::File& file) {
45 const size_t fileSize = file.size();
46 uint8_t* ret = (uint8_t*)malloc(fileSize);
47 if (ret) {
48 file.seek(0);
49 file.readBytes((char*)ret, fileSize);
50 } else {
51 Serial.printf("malloc failed for file with size %d\r\n", fileSize);
52 wsErr("malloc failed while reading file");
53 util::printHeap();
54 }
55 return ret;
56}
57
58void prepareCancelPending(const uint8_t dst[8]) {
59 struct pendingData pending = {0};

Callers 6

init_webFunction · 0.85
compress_imageFunction · 0.85
get_ATC_BLE_OEPL_imageFunction · 0.85
processBlockRequestFunction · 0.85
checkMirrorFunction · 0.85
queueDataAvailFunction · 0.85

Calls 4

wsErrFunction · 0.85
printHeapFunction · 0.85
printfMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected