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.

CC2340R5: BLE Central Example On CC2340R5.

Part Number: CC2340R5

Tool/software:

Hi,

Chipset Used:CC2340R5

SDK Version: simplelink_lowpower_f3_sdk_8_10_01_02

Currently we are using CC2340R5 for our development and we would like to run the device in "Central + Peripheral" role.

But before we do that, we would like to test the peripheral and central roles independently and then merge the two together. So far we have not faced issues in peripheral role and the "Basic_BLE" SDK example provided is working fine. However, We are having issues when looking for an example for configuring the chip in Central role. 

When in central role, we would like to know how to:

TASK 1- Initiate a scan.    ---------------------------> Done

TASK 2- Get Scan Data List.------------------------->Done

TASK 3- Connect to a specific device received from the scan list. ------------------------>Done

TASK 4-Do Service discovery of the connected device and fetch the attribute table. ------------------> Pending

TASK 5- Exchange data via read/write and notify when connected to a peripheral device.------------> Pending

So far, Using the "BASIC_BLE" project we have been able to do TASK1-TASK3. i.e initiate scan, get scan list and connect to a device(Done). 

We would like your assistance with Tasks 4&5. 

In addition to the above, we would also like to know how to initiate pairing via "Numeric Comparison" and "PassKey Entry".

Do let me know if  I have missed out on anything. Awaiting for a swift and prompt response.

Regards,

Sandeep Singh

  • Hi Sandeep,

    Thank you for reaching out. 

    If not already done, I would recommend referring to the following example: https://github.com/TexasInstruments-Sandbox/ble_examples/tree/simplelink_low_power_f3_sdk-7.40.01/examples/rtos/LP_EM_CC2340R5/ble5stack/basic_ble_GATT_client 

    I hope this will help,

    Best regards, 

  • Hi, 

    Thanks for sharing the Github link. I will test it out and see if it meets our requirements. Until then I request you to keep the ticket open.

  • Hi Clément,

    I have gone through the Example code for the GATT client and I see that there are options to read and write an attribute. However, I see that in the read and write functions the handle values are hardcoded. Even in the readme file they mentioned that this example code only works with a peripheral device with a certain criteria.

    In our use case we may have fewer services and characteristics and our GATT table would look different. If we were to do a service discovery and get the GATT table then we can write our client code without making any assumptions of the peripheral device.

    How do we do service discovery and get the GATT attribute table with all the handles and properties?

    I have added a screenshot below of the code which contains the hardcoded handle values.

  • Hi, 

    The GATT table discovery can be done using the GATT API - among others GATT_DiscCharsByUUID.

    If further support for GATT table discovery is required, lease open a dedicated thread. 

    Thanks and regards, 

  • Hi Clément,

    As service discovery is part of TASK4 mentioned in the query on top, I would suggest that we continue.

    I have connected to a peripheral which has 3 services, Once it connection is established I change the MTU and then call service discovery using the below function.

    I have also registered for the relevant events in dataGATTHandler as shown below.

    After 20 seconds, I get a BLEAPPUTIL_ATT_READ_BY_GRP_TYPE_RSP event but the there are no handles present in "attReadByTypeRsp_t" structure.

  • Hi, 

    To keep the forum easy to read and ensure the right experts are assigned to each topic, we should avoid having multiple questions in the same thread. 

    Please open a new thread to continue the discussion. When opening a new thread, please ensure to:

    • provide the content of the structure received with the BLEAPPUTIL_ATT_READ_BY_GRP_TYPE_RSP event and the code used to parse it
    • provide the list of Primary Services in the GATT table considered
    • use the code insert function of the forum 

    Appreciate your understanding, 

    Best regards, 

  • Hi clement,

    I had state my queries very clearly in the first post asking for support on TASKs 4&5. If you had mentioned that a separate thread is needed for Tasks 4&5 then I would've initiated a parallel thread immediately on Day 1 itself but thank you for explaining the correct procedure in detail 3 days later.