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

Function prepareDataAvail

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

Source from the content-addressed store, hash-verified

87}
88
89void prepareDataAvail(const uint8_t* dst) {
90 // resend
91 tagRecord* taginfo = tagRecord::findByMAC(dst);
92 if (taginfo == nullptr) {
93 if (config.lock) return;
94 wsErr("Tag not found, this shouldn't happen.");
95 return;
96 }
97
98 taginfo->pendingCount++;
99 taginfo->pendingIdle = 0;
100
101 struct pendingData pending = {0};
102 memcpy(pending.targetMac, dst, 8);
103 pending.availdatainfo.dataSize = taginfo->len;
104 pending.availdatainfo.dataType = taginfo->dataType;
105 pending.availdatainfo.nextCheckIn = 0;
106 memcpy(&pending.availdatainfo.dataVer, taginfo->md5, sizeof(uint64_t));
107 pending.attemptsLeft = 10;
108
109 queueDataAvail(&pending, !taginfo->isExternal);
110 if (taginfo->isExternal) {
111 udpsync.netSendDataAvail(&pending);
112 }
113
114 wsSendTaginfo(dst, SYNC_TAGSTATUS);
115}
116
117void prepareDataAvail(uint8_t* data, uint16_t len, uint8_t dataType, const uint8_t* dst) {
118 tagRecord* taginfo = tagRecord::findByMAC(dst);

Callers 6

drawNewFunction · 0.85
updateTagImageFunction · 0.85
drawTimestampFunction · 0.85
prepareNFCReqFunction · 0.85
prepareConfigFileFunction · 0.85
prepareTIME_RAWFunction · 0.85

Calls 15

wsErrFunction · 0.85
memcpyFunction · 0.85
queueDataAvailFunction · 0.85
wsSendTaginfoFunction · 0.85
clearPendingFunction · 0.85
wsClientCountFunction · 0.85
memcmpFunction · 0.85
wsLogFunction · 0.85
checkMirrorFunction · 0.85
netSendDataAvailMethod · 0.80
openMethod · 0.80
closeMethod · 0.80

Tested by

no test coverage detected