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.

Connection information

Other Parts Discussed in Thread: CC2564

Hello!

As far as i understand my cc2564 can be paired with multiple devices (such as smartphones or laptops) but can be connected to

only one at a time (simultaneously). is this correct?

if so, i wish to understand which data is saved during the pairing process and where is it stored?

My final aim is to be able to filter certain devices (host such as smartphones/laptops/tablets) during the connection proccess, 

meaning i want to choose out of all paired devices who can connect and who cant.

thank you,

Yuri.

  • Hi Yuri,

    1. If you are using the TI Bluetooth Stack for MCU platforms (such as MSP432, MSP430, Tiva or other MCU), the paired device list (BD_ADDR and the Link Key) are stored in the LinkKeyInfo[] structure. The BT stack will store this structure in the RAM of the MCU, so the list will not be retained over a power cycle. It is the responsibility of the application (using the TI BT stack) to store this info in the device's non-volatile memory.

    2. If using the TI dual mode bluetooth stack for Linux, the paired device list will be stored as a .dtb file (e.g. BTPMDEV.dtb) in the BluetopiaPM/bin directory.

    Best regards,
    Vihang
  • Hi Vihang,

    I am using the MCU platform.
    I have tried using the BD_ADDR as my filtering information - the problam is that this address changes every time that the master device (smartphone) turns off its Blutooth. So i am not sure that this can help me.

    I tried to look into using the Link Key, but i couldnt find the stucture you were talking about in my code (based on the HOGPDemo). purhaps it has a different name?

    thank you,

    Yuri
  • Hi Yuri,

    For all the BT classic demos, the paired devices are stored in the LinkKeyInfo[].

    The paired BLE device information in the BLE profiles (such as HOGPDemo) is stored in the DeviceInfoList. You will need to use this structure to store the Paired device BD_ADDR, IRK etc. in NVM. 

    Best regards,

    Vihang

  • Vihang hello!

    i have looked into this and these are the results.
    i can find the DeviceInfoList and it does store the info about devices connected to the app, however,
    when i turn off the BT on one of the devices, the next time it connects it has a new, different BD_ADDR.

    this doesn't allow me to keep track of the devices and allow/disallow connection process.

    Is there something i am missing? could you please recommend something?

    thanks,
    Yuri.
  • Vihang,

    Please advise how we can connect to a specific device out of several paired devices.

    What parameter should we store in order to recognize the device that tries to connect, even if the smartphone is re-powered.

    Thanks,

    Eyal.

  • Hi Yuri,

    Looks like the change in the BD_ADDR you are experiencing is the Resolvable Private Address of the remote LE device. Please refer to the Vol3 [Part C] Section 10.8.2 of the Bluetooth Core specs regarding the details.

    This is the reason both IRK and BD_ADDR of the device need to be stored. These parameters will need to be used when calling the GAP_LE_Resolve_Address() API to check if the new random address is from the same device that was paired before.

    I also found this relevant post that has a discussion on the same topic : 

    Best regards,

    Vihang

  • Thank you!

    I will check these things and respond after testing.

  • Hello Vihang!

    I am currently working and checking the stuff you recommended.
    I will inform about results as soon as possible.

    I also wanted to ask,
    during connection do i get from the host device regarding its details
    such as:
    - what kind of device am i dealing with? (Smartphone/Tablet/Laptop)
    - which is the specific model of the host device?
  • I found this function: (GAP_Query_Remote_Device_Name)

    could you please refer me to a code example using this function? i couldnt find any
  • hello Vihang!

    Could you please respond on the issue , especially regarding the "GAP_Query_Remote_Device_Name" function?

    i dont seem to be able to get a valid name from android smartphones.

    thank you.

  • I use it as follows:

    /* Attempt to submit the command.                              */
    Result = GAP_Query_Remote_Device_Name(BluetoothStackID, ConnectionBD_ADDR, GAP_Event_Callback, (unsigned long)0);
    /* Check the return value of the submitted command for success.*/
    if(!Result)
    {
       /* Display a messsage indicating that Remote Name request   */
       /* was initiated successfully.                              */
       DisplayFunctionSuccess("GAP_Query_Remote_Device_Name");
    
       /* Flag success to the caller.                              */
       Result = 0;
    }
    else
    {
       /* Display a message indicating that an error occured while */
       /* initiating the Remote Name request.                      */
       DisplayFunctionError("GAP_Query_Remote_Device_Name", Result);
    
       Result = FUNCTION_ERROR;
    }
    
    and in GAP_Event_Callback() i have:
    case etRemote_Name_Result:
       /* Bluetooth Stack has responded to a previously issued     */
       /* Remote Name Request that was issued.                     */
       GAP_Remote_Name_Event_Data = GAP_Event_Data->Event_Data.GAP_Remote_Name_Event_Data;
       if(GAP_Remote_Name_Event_Data)
       {
          /* Inform the user of the Result.                        */
          BD_ADDRToStr(GAP_Remote_Name_Event_Data->Remote_Device, Callback_BoardStr);
    
          Display(("etRemote_Name_Result(%d): %s\n", GAP_Remote_Name_Event_Data->Remote_Name_Status, Callback_BoardStr));
    
          if(!GAP_Remote_Name_Event_Data->Remote_Name_Status && GAP_Remote_Name_Event_Data->Remote_Name)
          {
             Connection_Name = GAP_Remote_Name_Event_Data->Remote_Name;
             Display(("Name: %s\n", GAP_Remote_Name_Event_Data->Remote_Name));
          }
          else
          {
             Connection_Name = NULL;
             Display(("Name: NULL\n"));
          }
       }
    

    Works for me fine with Android devices - however I suspect that is because I am using BDR and LE on my CC2564 and I think that call is for the BDR stack.

    To get the names from iOS devices I had to perform on the connected/desired device

    GATT_Start_Service_Discovery()

    Then in the callback for the case etGATT_Service_Discovery_Complete I needed to call

    Result = GATT_Read_Value_Request(GetBluetoothStackID(), GetConnectionID(), DeviceInfo->GAPSClientInfo.DeviceNameHandle, GATT_ClientEventCallback_GAPS, (unsigned long)DeviceInfo->GAPSClientInfo.DeviceNameHandle);

    There was an example in one of the samples that I based this off.

  • closing old thread. pls open new thread if issue still persists
    Saurabh