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.

how to initiate a BLE connection after scaned a adv peripheral device in simple central project



Hi,

I am using CC2642 lanchpadxl now. I want to change the demo simple central from using key button to build a connection to connecting itself. So I add a sentence  in the case GAP_DEVICE_INIT_DONE_EVENT

before break. as following

  numScanRes = 0;
  GapScan_enable(0, DEFAULT_SCAN_DURATION, 0);

in case SC_EVT_SCAN_DISABLED:

after the display_printf  added as following

       Display_printf(dispHandle, SC_ROW_NON_CONN, 0,
                      "%d devices discovered", numReport);
       GapInit_connect(scanList[0].addrType & MASK_ADDRTYPE_ID,
                       scanList[0].addr, DEFAULT_INIT_PHY, 0);

and predefine:  DEFAULT_DEV_DISC_BY_SVC_UUID

then if I do not comment out the sentence " SimpleCentral_buildMenu();"   ,then the connection can finish itself, that is, can enter case GAP_LINK_ESTABLISHED_EVENT. However, when I comment out it, the putty says it stops at 1 device discovered, rather connected.

So, my question is

1. why the menu button still relate with the connection progress, is there any other steps which I ignored?

2. after I finish the academy of adv and scan, it says, when receiver receives a adv, it should do a scan request to peripheral, then the peripheral do a scan answer. after these steps, the connection can finish. However, in our simple central project, I can not find the scan request from receiver, and I can not find scan answer from peripheral either. So how the connection finished in the project? the academy only gives the example in node manager from the command console, there is no any details in the project. thank you.

yanpo, Li