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.

CC2564C: BLE discovery

Part Number: CC2564C

   CC2564C BT3.0 products have been mass-produced, and the discovery function is realized in this way. CC2564C has a button input. After pressing, it enables the discovery of 300s. After connecting with the host, it is forbidden to find.
    In this way, the connected mobile phone can be directly connected, which can prevent the unallowed mobile phone from connecting to my Bluetooth device. How to implement such a function by BLE, I am using SPPLEdemo。

  • Hello,

    To make sure I understand. You want to know how to disable discover after a connection to a host is established? Please confirm.

    Jesu

  • Hi,Jesu

    Thank you for reply。

    We have to do two Bluetooth modules, a classic Bluetooth module, a dual-mode Bluetooth module.

    In Classic Bluetooth module(SPPdemo), I call the following API implementation to enable discovery for 300 seconds:

      GAP_Set_Discoverability_Mode(BluetoothStackID, dmGeneralDiscoverableMode, 300);

    When the pairing is successful, I will store the connection information in SNV,I call the following API to disable discovery:

      GAP_Set_Discoverability_Mode(BluetoothStackID, dmNonDiscoverableMode, 0);

    In this way, the successfully paired mobile phone can still connect to the Bluetooth device normally,

    and the Bluetooth device cannot be found without the paired mobile phone.

    In dual-mode Bluetooth module,I use SPPLEdemo。

    SPPLEdemo is SPP + BLE, In SPP mode, I can use the above method to achieve similar functionality,

    How to achieve the above functions in SPPLE mode?

  • Hello,

    Apologies for the delay. If you look at the SetDisc function you will see an example of how discoverability is managed on the BLE side. Basically the API is the same but there is also an LE_Parameters parameters variable. Just set it to dmNonDiscoverableMode whenever you are ready.

    Jesu

  • Hello,

    There are two problems:

    1. dmNonDiscoverableMode has no effect, The test software I use lightblue in IOS , Please see the log file below: 

    SPP+LE>
    SPP+LE>RegisterSPPLE
    Successfully registered SPPLE Service.

    SPP+LE>
    SPP+LE>SetDiscoverabilityMode 0
    Discoverability: Non.

    SPP+LE>

    SPP+LE>SetCBDiscoverabilityMode 0
    Discoverability: Non.

    SPP+LE>
    SPP+LE>AdvertiseLE 1
    GAP_LE_Advertising_Enable success.

    SPP+LE>
    SPP+LE>
    etLE_Connection_Complete with size 16.
    Status: 0x00.
    Role: Slave.
    Address Type: Random.
    BD_ADDR: 0x49836B1706DF.

    SPP+LE>
    etGATT_Connection_Device_Connection with size 16:
    Connection ID: 1.
    Connection Type: LE.
    Remote Device: 0x49836B1706DF.
    Connection MTU: 23.

    SPP+LE>
    SPP+LE>
    etGATT_Connection_Device_Disconnection with size 12:
    Connection ID: 1.
    Connection Type: LE.
    Remote Device: 0x49836B1706DF.

    2. IOS is random address every time, how can I use the whitelist?

    I want to achieve this goal. After each connection, I will save the IOS Bluetooth address to the whitelist,

    and then I use the whitelist mechanism(AdvertisingParameters.Connect_Request_Filter    = fpWhiteList) when connecting, so that the IOS phone can't connect to my device

    if it is not whitelisted.But the IOS phone connection uses a random address, which changes every time. What can I do to use the whitelist mechanism?

  • Hello,

    Try adding the call below to SetLEDiscoverabilityMode in SPPLEDemo.c and let me know if it works.

    SetCBDiscoverabilityMode(TempParam);

    I just tested it and it works for me. The issue seems to be that it disables discovery for BLE but not for BT classic and the CLI does not distinguish a command for disabling it across both. 

    Let me know if this fixes your issue.

    Jesu