MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / cacheScanAddr

Function cacheScanAddr

Tactility/Source/bluetooth/Bluetooth.cpp:55–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53// ---- Scan cache helpers ----
54
55void 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
70bool getCachedScanAddrType(const uint8_t addr[6], uint8_t* addr_type_out) {
71 auto lock = scan_cache_mutex.asScopedLock();

Callers 1

cachePeerRecordFunction · 0.85

Calls 2

asScopedLockMethod · 0.80
lockMethod · 0.45

Tested by

no test coverage detected