# Classic Bluetooth scan & connect

## Purpose

Show how the phone app scans for Glass 3 devices, lists peers, and launches the classic Bluetooth handshake.

## Entry points

Phone home:

- Tap add device from `MainPhoneActivity`.

Sample screen:

- `com.rokid.phone.ui.classicbt.ui.ClassicBtActivity`

## Platform

- Phone

## Main files

- [ClassicBtActivity.kt](https://gitee.com/as_pixar/glass3sdkdemo/blob/main/glass3sdkphonedemo/app/src/main/java/com/rokid/phone/ui/classicbt/ui/ClassicBtActivity.kt)
- [ClassicBtViewModel.kt](https://gitee.com/as_pixar/glass3sdkdemo/blob/main/glass3sdkphonedemo/app/src/main/java/com/rokid/phone/ui/classicbt/viewmodel/ClassicBtViewModel.kt)
- [ClassicBtRepository.kt](https://gitee.com/as_pixar/glass3sdkdemo/blob/main/glass3sdkphonedemo/app/src/main/java/com/rokid/phone/ui/classicbt/repository/ClassicBtRepository.kt)

## Flow

1. Ensure system Bluetooth is powered on.  
2. After entering the scan UI, call `startScanBt`.  
3. ViewModel events stream results back to Compose / UI.  
4. When the user taps a row, remember which device is pending.  
5. Navigate to the unified pairing hub `BtWifiConnectActivity`.

## Notes for developers

### Why pairing is not finished here

This page only **discovers + selects** peers. Connection and P2P follow-up are centralized in `BtWifiConnectActivity` so Bluetooth and P2P pairing do not each implement their own duplicated state machine.

### What you are listing

Classic Bluetooth devices — not raw BLE advertisements.

## Caveats

- If BT is off, the flow guides the user through enabling it.  
- On exit, animations / loading states are cleared.  
- If discovery returns nothing, navigation routes to a dedicated “not found” helper screen.  
