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: Central connect Peripheral

Part Number: CC2340R5


Other Parts Discussed in Thread: SYSCONFIG

CCS version : 12.7.0

SDK version : 7.40.00.64

Project : basic_ble_LP_EM_CC2340R5_freertos_ticlang

I scan the device in app.central.c, and after I scan the device I want, I call BLEAppUtil_connect() and return success, but then it does not jump to Connection_ConnEventHandler() of app.connection.c to establish the connection.

I also looked at https://github.com/TexasInstruments/ble_examples/blob/simplelink_low_power_f3_sdk-7.20/examples/rtos/LP_EM_CC2340R5/ble5stack/basic_ble_GATT_client/app/app_central.c,In this project example, there is only a call to BLEAppUtil_connect() and there is no subsequent connection process.

Can provide me guidance?


  • Hi Ryan,

    If I understand correctly your question, you're saying that Connection_ConnEventHandler is not called within the BLEAppUtil_connect() function am I right?

    The Connection_ConnEventHandler will be called asynchronously after the stack notify a connection event to the application, so if you put a breakpoint inside the Connection_ConnEventHandler function it should be reached once you return from the observerScanHandler.

    Please take a look at the Processing Stack Events from the ICall Message Queue section of the User's Guide, Introduction — SimpleLinkTm CC23xx SDK BLE5-Stack User's Guide 3.02.04.00 documentation

    On a side note, I also see that your code is trying to connect to several device please ensure that Max Number of Connections under General Configuration in SysConfig is configured to match your expectations.

    Regards

    Tanguy

  • Hi Tanguy,

    I called BLEAppUtil_connect and it also returned success, which means that the launcher has been enabled, right? But it did not enter Connection_ConnEventHandler (). I set a breakpoint in Connection_ConnEventHandler to make sure it did not enter.

    The picture below shows that BLEAppUtil_connect () returns successfully but does not enter the breakpoint.
    Or is it because I did not stop Scan after calling BLEAppUtil_connect(), causing it to fail to establish a connection?




  • Hi Ryan,

    Do you see any output on the uart when you run the program without debugging it? if the connection is successful, you should see something like Conn status: Established. ....

    Also, can you connect to the same device with the SimpleLink connect app on your phone?

    Finally, could you provide us with Bluetooth Sniffer Log to see if the central is sending the connection request and how the peripheral is responding.

    Regards
    Tanguy

  • Hi Tanguy,

    (1) I set up to stop scanning when BLEAppUtil_connect () is called, and the connection is stable.

    (2)I can connect to the device on my mobile phone

    (3) Sorry, I currently don’t have a Bluetooth Sniffer on hand to use.

  • Hi Ryan,

    Could you check how you are registering the handler? Make sure BLEAPPUTIL_LINK_ESTABLISHED_EVENT is set in the eventMask as shown below

    Please also check that BLEAppUtil_registerEventHandler(&connectionConnHandler); in Connection_start() is returning SUCCESS.

    Finally, please also expect delays for the next answer as May 17th and May 20th are public holiday here.

    Regards

    Tanguy