| 87 | } |
| 88 | |
| 89 | void 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 | |
| 117 | void prepareDataAvail(uint8_t* data, uint16_t len, uint8_t dataType, const uint8_t* dst) { |
| 118 | tagRecord* taginfo = tagRecord::findByMAC(dst); |
no test coverage detected