CC2642R: About how to get the device name after connecting to the smartphone.

Part Number: CC2642R
Other Parts Discussed in Thread: SYSCONFIG

Dear All,

We are building a system using CC2642R to connect iPhone and Android smartphones via Bluetooth.
For example, when a Windows PC and an iPhone are connected via Bluetooth, the PC side can see the device name of the connection partner as shown below.

I think this is because Windows is somehow getting the device name of the connected smartphone.

In the same way, we would like to get the device name of the connection partner after connection in our system.
What API is suitable for this purpose?

SDK Version: simplelink_cc13xx_cc26xx_sdk_6_30_00_84

Best regards,

Makino

  • Hello Makino,

    Thanks for reaching out.

    Could you please confirm if you are using the CC2642R in peripheral or central mode and if you are using an out of the box example?

    If a peripheral device is configured to include the name of the device as part of the advertisement report, then this structure can be read by the central device. Please see the following training material that gives more details about it: Scanning and Advertisement Fundamentals. For example, the central device (scanner) will have to look for the GAP_ADTYPE_LOCAL_NAME_SHORT GAP AD type and based on the size (0x03 in the example), read the name that follows ("SP" in the example).

    // Advertisement data
    uint8_t advData1[] =
    {
      0x03,
      GAP_ADTYPE_LOCAL_NAME_SHORT,
      'S',
      'P',
    
      0x02,
      GAP_ADTYPE_FLAGS,
      GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED | GAP_ADTYPE_FLAGS_GENERAL,
    
      0x03,
      GAP_ADTYPE_16BIT_MORE,
      LO_UINT16(0xfff0),
      HI_UINT16(0xfff0),
    
    };

    You can easily add/modify the name by using the SysConfig file of the project (I would suggest starting with the simple_peripheral example that you can find inside the SDK: <SDK>\examples\rtos\CC26X2R1_LAUNCHXL\ble5stack\simple_peripheral).

    Hope it helps.

    David.

  • Dear David,

    Thank you for your reply.

    >gives more details about it: Scanning and Advertisement Fundamentals. 

    It seems that this link is unavailable (403 Forbidden). Could you check?

    Best regards,

    Makino

  • P.S.

    >Could you please confirm if you are using the CC2642R in peripheral or central mode and if you are using an out of the box example?

    This time, CC2642R is a peripheral. Is there a way for a peripheral to get the device name of the central?

    Best regards,

    Makino

  • Hello Makino,

    Could you please try from this link and select Scanning and Advertisement Fundamentals?

    Both links should be actually working. If not, please try going to https://dev.ti.com/ and search for the device --> CC2642R1F --> Learn About SimpleLink MCU platform --> Scanning and Advertisement Fundamentals.

    Let me know how it goes.

    BR,

    David.

  • Hello Makino,

    If you want to get the name of the central device after the connection has been established, you could just send it as the value of an attribute, same as any other value/data you would like to exchange during connection events. What I mention earlier is how to get this data from the peripheral before connection, while advertising, which is how you are able to see the name of the device (if configured) before a connection has be established.

    In the same way, we would like to get the device name of the connection partner after connection in our system.
    What API is suitable for this purpose?

    BR,

    David.

  • Hello David,

    This time I was able to refer to the contents. Thank you.

    Best regards,

    Makino

  • Hello David,

    We are using GATTServApp_ProcessCharCfg to send our self-defined message. What kind of parameter do we need to ask for central’s device name? Or there is an API that is designed for this purpose?

    Best regads,

    Makino

  • Hello Makino,

    The device hosting the gatt server (the peripheral in your case) has specific APIs to expose the device information. I don't think there are specific ones for the gatt client (central in your case). I would suggest looking into the GATT Services and Profile section of our user guide. You will see device specific information in basically the first three services (GAP GATT Service (GGS), Generic Attribute Service, Device Info Service) however information related to the peripheral. Figure 74. shows the attribute table of these services. Therefore, I would suggest following the idea of simple_gatt_profile Service to create one characteristic that the central can write its name into so that the peripheral can dispose of that information as needed. To understand better how this is implemented, please use as reference the simple_peripheral example (found inside: <SDK>\examples\rtos\CC26X2R1_LAUNCHXL\ble5stack\simple_peripheral) and look into the Profiles folder.

    Hope it helps.

    David.

  • Hello David,

    I understood your comments as below. Is this correct?

    1. When CC2642R is started in peripheral mode, there is no API to obtain the central device name.
    2. It is possible if I create the following mechanism.
    - Build an original characteristics that can be exchanged between peripherals and central.
    - Central writes device name in response to peripheral request.

    Best regards,

    Makino

  • Hello Makino,

    Apologies for the delay. That would be right.

    Do you have any concern I can help with regarding this approach?

    BR,

    David