Docs / iglooworks / BLE SDK / Scanning
Scanning
Discover nearby Igloohome smart locks via Bluetooth.
scanDevice
Scans for nearby Igloo locks via Bluetooth. Emits a ScanResult for each discovered device. The scan runs for as long as the Flow has active collectors.
Signature
Return Type
| Field | Description |
|---|---|
deviceId |
Bluetooth device name (e.g. "IGM4-XXXX", "SP2Xo01231"). |
isPaired |
true if the device is already paired with an account. |
isActive |
true if the device is actively broadcasting. |
rssi |
Signal strength in dBm. Higher (closer to 0) means closer. |
Error Codes
| Exception | Code | Description |
|---|---|---|
BluetoothException |
708 | Bluetooth is off or unavailable. |
Example
Notes
- The scan runs indefinitely until the collecting coroutine is cancelled (Android) or
stopScan()is called and the enclosingTaskis cancelled (iOS). - Ensure BLE permissions are granted before calling
scanDevice()/scansLock(). On iOS this meansNSBluetoothAlwaysUsageDescriptionis set inInfo.plist— there is no runtime permission prompt to request explicitly. - The
deviceId/bluetoothDeviceNameprefix indicates the lock type (e.g.IGM4= mortise lock,SP2X= smart padlock,EB1= bridge). On iOS this is also exposed structurally viaScanResult.type: LockType. - Unpaired devices (
isPaired = false) can be registered viapair(). - Filter by
rssito find nearby devices — typical threshold is-70for "close enough to connect". Not available on iOS (norssifield).