feat: 蓝牙扫描与iBeacon模块

核心功能:
- BleScanner: BLE扫描封装,SCAN_MODE_LOW_POWER低功耗
- IBeaconParser: 从ScanRecord解析UUID/Major/Minor/TxPower
- BluetoothScanManager: 状态机管理常规/特殊双模式
  - 常规模式:周期扫描→上报API→检查新任务
  - 特殊模式:RSSI采样→均值判定→任务匹配→唤醒屏幕
- 设备过滤:名称含RFstar + 功率0<p<=100

集成:
- HomeFragment: MQTT type=4更新蓝牙参数,type=5控制启停
- 解绑时停止扫描
- 电量同步给扫描管理器

新增6文件,修改2文件。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
dongliang
2026-04-29 12:06:59 +09:30
parent 866063b21c
commit e7fa7b3b1d
8 changed files with 630 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ import com.google.gson.GsonBuilder
import com.xiaoqu.watch.network.EnvConfig
import com.xiaoqu.watch.network.SignatureInterceptor
import com.xiaoqu.watch.network.UnbindInterceptor
import com.xiaoqu.watch.network.api.BluetoothApi
import com.xiaoqu.watch.network.api.CommonApi
import com.xiaoqu.watch.network.api.PunchApi
import com.xiaoqu.watch.network.api.TaskApi
@@ -76,4 +77,10 @@ object NetworkModule {
fun providePunchApi(retrofit: Retrofit): PunchApi {
return retrofit.create(PunchApi::class.java)
}
@Provides
@Singleton
fun provideBluetoothApi(retrofit: Retrofit): BluetoothApi {
return retrofit.create(BluetoothApi::class.java)
}
}