| 53 | // ---- Scan cache helpers ---- |
| 54 | |
| 55 | void cacheScanAddr(const uint8_t addr[6], uint8_t addr_type) { |
| 56 | auto lock = scan_cache_mutex.asScopedLock(); |
| 57 | lock.lock(); |
| 58 | for (auto& entry : scan_addr_cache) { |
| 59 | if (memcmp(entry.addr, addr, 6) == 0) { |
| 60 | entry.addr_type = addr_type; |
| 61 | return; |
| 62 | } |
| 63 | } |
| 64 | CachedAddr e = {}; |
| 65 | memcpy(e.addr, addr, 6); |
| 66 | e.addr_type = addr_type; |
| 67 | scan_addr_cache.push_back(e); |
| 68 | } |
| 69 | |
| 70 | bool getCachedScanAddrType(const uint8_t addr[6], uint8_t* addr_type_out) { |
| 71 | auto lock = scan_cache_mutex.asScopedLock(); |
no test coverage detected