Tool/software:
I found that there is a new marco called FPGA_AUTO_CONNECT in the SimpleLink SDK for CC2640R2F version 5.30.0.11 example code for simple central role which control the function call to SimpleCentral_startGapDiscovery(). And I notice that when I manually call this function, the program will stop working at function GAPCentralRole_StartDiscovery. Can anyone tell me the exact meaning of the marco FPGA_AUTO_CONNECT in this simplelink SDK? Is it required to enable the GAP discovery?
Here is related SDK example code:
#ifdef FPGA_AUTO_CONNECT /********************************************************************* * @fn SimpleCentral_startGapDiscovery * * @brief Start discovering devices * * @param none * * @return none */ static void SimpleCentral_startGapDiscovery(void) { // Start discovery if ((state != BLE_STATE_CONNECTED) && (!scanningStarted)) { scanningStarted = TRUE; scanRes = 0; Display_print0(dispHandle, 2, 0, "Discovering..."); Display_clearLines(dispHandle, 3, 4); GAPCentralRole_StartDiscovery(DEFAULT_DISCOVERY_MODE, DEFAULT_DISCOVERY_ACTIVE_SCAN, DEFAULT_DISCOVERY_WHITE_LIST); } } /********************************************************************* * @fn SimpleCentral_connectToFirstDevice * * @brief Connect to first device in list of discovered devices * * @param none * * @return none */ static void SimpleCentral_connectToFirstDevice(void) { uint8_t addrType; uint8_t *peerAddr; scanIdx = 0; if (state == BLE_STATE_IDLE) { // connect to current device in scan result peerAddr = devList[scanIdx].addr; addrType = devList[scanIdx].addrType; state = BLE_STATE_CONNECTING; GAPCentralRole_EstablishLink(DEFAULT_LINK_HIGH_DUTY_CYCLE, DEFAULT_LINK_WHITE_LIST, addrType, peerAddr); Display_print0(dispHandle, 2, 0, "Connecting"); Display_print0(dispHandle, 3, 0, Util_convertBdAddr2Str(peerAddr)); Display_clearLine(dispHandle, 4); } } #endif // FPGA_AUTO_CONNECT
case GAP_DEVICE_INIT_DONE_EVENT: { maxPduSize = pEvent->initDone.dataPktLen; Display_print0(dispHandle, 1, 0, Util_convertBdAddr2Str(pEvent->initDone.devAddr)); Display_print0(dispHandle, 2, 0, "Initialized"); // Prompt user to begin scanning. Display_print0(dispHandle, 5, 0, "Discover ->"); #ifdef FPGA_AUTO_CONNECT SimpleCentral_startGapDiscovery(); #endif // FPGA_AUTO_CONNECT } break;