This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/WL1835MOD: How to perform a passive scan of Bluetooth Low Energy using the Bluetopia stack

Part Number: WL1835MOD

Tool/software: Linux

Using a HW based on AM335X and WL1835MOD. Operating system is linux.

Bluetopia is  BluetopiaPM-4.2.1.0.1.

External device is a ambient sensor.

Bluetopia stack provides the method DEVM_StartDeviceScan but this is documented as "...Device discovery, in this case, means to perform an active scan of the Bluetooth Low Energy advertising channels." How can I perform a passive scan?

  • You, can set scan type using the API: HCI_LE_Set_Scan_Parameters()


    BTPSAPI_DECLARATION int BTPSAPI HCI_LE_Set_Scan_Parameters ( unsigned int BluetoothStackID,
    Byte_t LE_Scan_Type,
    Word_t LE_Scan_Interval,
    Word_t LE_Scan_Window,
    Byte_t Own_Address_Type,
    Byte_t Scanning_Filter_Policy,
    Byte_t * StatusResult
    )

    Thanks
  • Thanks,

    has this command to be issued before every scan? Does this change the settings of other clients in case multiple clients are using the BTPM?

    How do I get the BluetoothStackID?

    Note: Until now I just use the APIs for BTPM, DEVM and GATT.

    Regards

  • It depends how you would like to use it.. Typically, you flow should as below:
    a) set scan params, for ex: HCI_LE_Set_Scan_Parameters(..)
    b) enable scan, for ex: HCI_LE_Set_Scan_Enable()
    c) Wait for the amount of time you need
    d) Disable scan, for ex: HCI_LE_Set_Scan_Enable

    Yes, multiple threads try to access it can mangle the above steps.. From, application you would need to serialize for setting and enabling scans.