UWB功耗大数据插桩调研
一、摘要
UWB功耗点 | 插桩点 | 日志关键字 | 电流 |
蓝牙持锁 | BatteryStats的锁统计 | vendor_bluetooth_lock | 30~40mA |
测距 | UwbSessionManager.startRanging UwbSessionManager.stoptRanging 或接入fadiKey Uwb状态广播 "com.fadiui.dkservice.action.uwb.state.change" | startRanging|stopRanging|UwbUciCore | 60~90mA (无持锁测距~持锁测距) |
初步结论:可行,加下代码,后面实测下是否正确触发。
UWB 命令集:
adb shell dumpsys uwb
adb shell cmd uwb help
二、UWB架构
2.1 UWB 堆栈架构
UWB 堆栈由 UWB Mainline 模块和 UWB 芯片供应商提供的 HAL 实现组成。
2.2 UWB framework
三、功耗相关日志
3.1 蓝牙持锁日志
日志关键字:vendor_bluetooth_lock
AP_Log/50_2023-07-29_101149/kernel.txt:8866:07-29 10:13:32.909 10241 10241 I PM : PM: Pending Wakeup Sources: vendor_bluetooth_lock 898000.qcom,qup_uart
AP_Log/50_2023-07-29_101149/kernel.txt:8870:07-29 10:13:32.979 10241 10241 I Abort : Pending Wakeup Sources: vendor_bluetooth_lock 898000.qcom,qup_uart
AP_Log/50_2023-07-29_101149/main.txt:34388:07-29 10:17:02.969 1301 1301 W binder:1301_2: type=1400 audit(0.0:838): avc: denied { read } for name="ssrdump" dev="dm-14" ino=259 scontext=u:r:hal_bluetooth_default:s0 tcontext=u:object_r:vendor_ramdump_vendor_data_file:s0 tclass=dir permissive=0
AP_Log/51_2023-07-29_101721_boot/kernel.txt:3286:07-29 10:17:38.461 132 132 I [fadi]: active wakeup source: vendor_bluetooth_lock, active_since: 848 ms , active_count: 3 , pending suspend count: 0
AP_Log/51_2023-07-29_101721_boot/kernel.txt:4219:07-29 10:18:58.329 132 132 I [fadi]: active wakeup source: vendor_bluetooth_lock, active_since: 1049 ms , active_count: 12 , pending suspend count: 0
AP_Log/51_2023-07-29_101721_boot/kernel.txt:5421:07-29 10:20:08.471 132 132 I [fadi]: active wakeup source: vendor_bluetooth_lock, active_since: 161 ms , active_count: 17 , pending suspend count: 0
AP_Log/51_2023-07-29_101721_boot/kernel.txt:9321:07-29 10:29:00.609 132 132 I [fadi]: active wakeup source: vendor_bluetooth_lock, active_since: 366 ms , active_count: 42 , pending suspend count: 0
3.2 UWB测距
日志关键字:startRanging|stopRanging|UwbUciCore
AP_Log/51_2023-07-29_101721_boot/main.txt:58342:07-29 10:17:42.868 1862 5087 I UwbUciCore: uwb_ucif_proc_ranging_data: ranging_measures_length = 48 range_data_ntf_len = 232
AP_Log/51_2023-07-29_101721_boot/main.txt:58343:07-29 10:17:42.868 1862 5087 I UwbUciCore: uwa_dm_uwb_response_cback:UWB_VENDOR_SPECIfIC_UCI_NTF_EVT(0x401d)
AP_Log/51_2023-07-29_101721_boot/main.txt:58347:07-29 10:17:42.869 1862 5087 I UwbUciCore: uwa_dm_uwb_response_cback:UWB_RANGE_DATA_REVT(0x4011)
AP_Log/51_2023-07-29_101721_boot/main.txt:58380:07-29 10:17:43.061 1862 5087 I UwbUciCore: uwb_ucif_process_event enter gid:0x62 status:0x1
AP_Log/51_2023-07-29_101721_boot/main.txt:58381:07-29 10:17:43.061 1862 5087 I UwbUciCore: uwb_ucif_process_event: UWB received ntf gid:2
AP_Log/51_2023-07-29_101721_boot/main.txt:58382:07-29 10:17:43.061 1862 5087 I UwbUciCore: uwb_ucif_proc_ranging_data: ranging_measures_length = 48 range_data_ntf_len = 232
AP_Log/51_2023-07-29_101721_boot/main.txt:58383:07-29 10:17:43.061 1862 5087 I UwbUciCore: uwa_dm_uwb_response_cback:UWB_VENDOR_SPECIfIC_UCI_NTF_EVT(0x401d)
AP_Log/51_2023-07-29_101721_boot/main.txt:58387:07-29 10:17:43.061 1862 5087 I UwbUciCore: uwa_dm_uwb_response_cback:UWB_RANGE_DATA_REVT(0x4011)
AP_Log/51_2023-07-29_101721_boot/main.txt:58480:07-29 10:17:43.255 1862 5087 I UwbUciCore: uwb_ucif_process_event enter gid:0x62 status:0x2
AP_Log/51_2023-07-29_101721_boot/main.txt:58481:07-29 10:17:43.255 1862 5087 I UwbUciCore: uwb_ucif_process_event: UWB received ntf gid:2
AP_Log/51_2023-07-29_101721_boot/main.txt:58482:07-29 10:17:43.255 1862 5087 I UwbUciCore: uwb_ucif_proc_ranging_data: ranging_measures_length = 48 range_data_ntf_len = 232
AP_Log/51_2023-07-29_101721_boot/main.txt:58483:07-29 10:17:43.255 1862 5087 I UwbUciCore: uwa_dm_uwb_response_cback:UWB_VENDOR_SPECIfIC_UCI_NTF_EVT(0x401d)
四、UWB 命令集
UWB 命令集:
adb shell dumpsys uwb
adb shell cmd uwb help
adb shell cmd uwb status
adb shell cmd uwb get-country-code
adb shell cmd uwb get-log-mode
adb shell cmd uwb enable-uwb
adb shell cmd uwb disable-uwb
adb shell cmd uwb simulate-app-state-change
adb shell cmd uwb start-fira-ranging-session
adb shell cmd uwb start-ccc-ranging-session
adb shell cmd uwb start-radar-session
adb shell cmd uwb reconfigure-fira-ranging-session
adb shell cmd uwb get-ranging-session-reports
adb shell cmd uwb get-all-ranging-session-reports
adb shell cmd uwb stop-ranging-session
adb shell cmd uwb stop-radar-session
adb shell cmd uwb stop-all-ranging-sessions
adb shell cmd uwb stop-all-radar-sessions
adb shell cmd uwb get-specification-info
adb shell cmd uwb enable-diagnostics-notification
adb shell cmd uwb disable-diagnostics-notification
adb shell cmd uwb take-bugreport