Android BLE Passive scan

前端 未结 2 2067
甜味超标
甜味超标 2021-02-02 00:26

I want to scan BLE advertisers passively within my Android App.
But I couldn\'t found how to do this.

  • According Bluetooth 4.0 Core spec, There exists passi

2条回答
  •  -上瘾入骨i
    2021-02-02 01:06

    Find btif_gatt_client.c in AOSP repo, Edit it,

    replace

    BTM_BleSetScanParams(p_cb->scan_interval, p_cb->scan_window, BTM_BLE_SCAN_MODE_ACTI);
    

    with

    BTM_BleSetScanParams(p_cb->scan_interval, p_cb->scan_window, BTM_BLE_SCAN_MODE_PASS);
    

    then build AOSP, flash the image to phone, then passive scan works.

提交回复
热议问题