$ show yjeanrenaud/yj_nearbyglasses
Nearby Glasses is a cross-platform mobile application (native Android in Kotlin and iOS in Swift/SwiftUI) that continuously scans Bluetooth Low Energy (BLE) advertisements to alert users when smart glasses from known manufacturers (Meta, EssilorLuxottica, Snap, Zhuhai Jieli) are nearby. Detection is based on immutable BLE company IDs and device-name substrings, with configurable RSSI threshold and notification cooldown. The Android app runs a foreground service for background scanning; the iOS app currently scans only in the foreground and offers a 'Canary Mode' visual indicator instead of system notifications. The app is privacy-focused: no telemetry, no ads, local-only logs with user-initiated export.
The LLM identified 3 files worth highlighting for reuse:
Parses BLE advertisement packets, extracts manufacturer company IDs and device names, applies configurable RSSI threshold and cooldown, and classifies devices as smart glasses. The logic is self-contained enough to extract into a reusable BLE detection library and demonstrates non-obvious parsing of ADV data.
CBCentralManager delegate implementation that scans for peripherals, reads advertisement data, and matches against known company IDs and name substrings. It cleanly separates BLE hardware interaction from detection heuristics, making the heuristic portion portable to other CoreBluetooth projects.
Data model for detection events with a static isSmartGlasses() method encoding the company ID and device-name heuristics. This pure Kotlin class could be extracted as a standalone JVM module for unit testing or reuse in other BLE-based detection tools.