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.

CC2640R2F: Integrating project zero file into simple peripheral example

Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2640

Hi all,

   I am currently working on simple peripheral example. Here, I cant able to receive more than one character from smartphone. So I thought of integrating data service file from project zero into simple peripheral example. But program was not working properly. It is hanging somewhere in ICall_createRemoteTasks() function.

So, please give me a procedure to integrate data service file from project zero(ble stack) into simple peripheral example(ble stack).

Thanks,

Aslam  

  • Hi Aslam,

    I think it's likely you're importing a file incorrectly. Which files are you trying to add? I would recommend adding just the data_service.c and .h files under Profiles.

    Best,

    Nate

  • Hi Nate,

             I am managed to add files properly and now data service is working in simple peripheral example. But, I am getting one more problem, whenever I am disconnected the device, cc2640 is not advertising again, means I cant able to connect again.

    Please, reslove this query

    Thanks,

    Aslam

  • Hey Aslam,

    Which SDK are you using? In the default example, you can find the following code that restarts advertising inside GAP_LINK_TERMINATE_EVENT:

    case GAP_LINK_TERMINATED_EVENT:
        {
          gapTerminateLinkEvent_t *pPkt = (gapTerminateLinkEvent_t *)pMsg;
    
          // Display the amount of current connections
          uint8_t numActive = linkDB_NumActive();
          Display_printf(dispHandle, SP_ROW_STATUS_1, 0, "Device Disconnected!");
          Display_printf(dispHandle, SP_ROW_STATUS_2, 0, "Num Conns: %d",
                         (uint16_t)numActive);
    
          // Remove the connection from the list and disable RSSI if needed
          SimplePeripheral_removeConn(pPkt->connectionHandle);
    
          // If no active connections
          if (numActive == 0)
          {
            // Stop periodic clock
            Util_stopClock(&clkPeriodic);
    
            // Disable Connection Selection option
            tbm_setItemStatus(&spMenuMain, TBM_ITEM_NONE, SP_ITEM_SELECT_CONN);
          }
    
          // Start advertising since there is room for more connections
          GapAdv_enable(advHandleLegacy, GAP_ADV_ENABLE_OPTIONS_USE_MAX , 0);
          GapAdv_enable(advHandleLongRange, GAP_ADV_ENABLE_OPTIONS_USE_MAX , 0);
    
          // Clear remaining lines
          Display_clearLine(dispHandle, SP_ROW_CONNECTION);
    
          break;
        }