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.

Compiler/CC2650: I wold like to connect a specific peripheral via device name.

Part Number: CC2650

Tool/software: TI C/C++ Compiler

Hi All,
I am using CC2650 chip with ble_cc26xx_2_01_00_44423 for test. I am usin SimpleBLECentral project for Central device.
I have a Peripheral device which name is TEST_PERIPHERAL. It can be finded in my cellphone.

I wold like to connect a specific peripheral via device name.
As I know "when receive an advertisment packet or a scan response that will produce a GAP_DEVICE_INFO_EVENT",
So I add some code to test. Please refer to following picture.

It's not work. I can not see line 672 ane any peripjeral.
Why does not into case GAP_DEVICE_INFO_EVENT ?

Best Regards,

Louis

  • Hi,

    Since you are just starting with our CC2650, I would recommend you to use ble_cc26xx_2_02_02_xxxx instead.

    Make sure your scan window is longer than the advertising interval.
    To configure the scan interval and window, please do
    GAP_SetParamValue(TGAP_GEN_DISC_SCAN_INT , theScanIntervalYouWant);
    GAP_SetParamValue(TGAP_GEN_DISC_SCAN_WIND , theScanWindowYouWant);
    #define TGAP_GEN_DISC_SCAN_INT 16 //!< Scan interval used during Link Layer Scanning state, when in General Discovery proc (n * 0.625 mSec)
    #define TGAP_GEN_DISC_SCAN_WIND 17 //!< Scan window used during Link Layer Scanning state, when in General Discovery proc (n * 0.625 mSec)
  • Hi Christin Lee
    Thanks your quickly response.
    The gap.h default define
    #define TGAP_GEN_DISC_SCAN_INT 16 //16*0.625=10ms
    #define TGAP_GEN_DISC_SCAN_WIND 17 //17*0.625=10.625ms
    The scan window is longer than the advertising interval already.
    Should I need use GAP_SetParamValue() to set ScanInterval and ScanWindow? And where to add these codes ?
    Furthermore, The advertising interval of Peripheral be set 40ms.

    Best Regards,

    Louis
  • The gap.h defines are the enums, not the actual values used for scanning.

    You should write the code under
    simple_central_init:
    GAP_SetParamValue(TGAP_GEN_DISC_SCAN_INT , theScanIntervalYouWant);
    GAP_SetParamValue(TGAP_GEN_DISC_SCAN_WIND , theScanWindowYouWant);

    For the scan window to be longer than advertising interval you need to do
    GAP_SetParamValue(TGAP_GEN_DISC_SCAN_INT , numberbiggerthan64);
    GAP_SetParamValue(TGAP_GEN_DISC_SCAN_WIND , numberbiggerthan64);
  • Hi Christin
    I writed the code under
    simple_central_init:
    GAP_SetParamValue(TGAP_GEN_DISC_SCAN_INT ,240 );
    GAP_SetParamValue(TGAP_GEN_DISC_SCAN_WIND , 240);

    240*0.625=150ms is big than advertising interval(40ms).

    But SimpleBLECentral_processRoleEvent also can not get event:GAP_DEVICE_INFO_EVENT
    static void SimpleBLECentral_processRoleEvent(gapCentralRoleEvent_t *pEvent)
    {
    ...
    case GAP_DEVICE_INFO_EVENT:
    {
    System_printf("%s():%d \r\n",__FUNCTION__,__LINE__);
    if(pEvent->deviceInfo.eventType == GAP_ADRPT_SCAN_RSP)//scan response
    {
    //pEvent->deviceInfo.dataLen;
    //pEvent->deviceInfo.pEvtData;
    System_printf("%s():%d peripheral_name=%s\r\n",__FUNCTION__,__LINE__,pEvent->deviceInfo.pEvtData);
    }
    if(pEvent->deviceInfo.eventType == GAP_ADRPT_ADV_IND )//adv
    {
    //pEvent->deviceInfo.dataLen;
    //pEvent->deviceInfo.pEvtData;
    System_printf("%s():%d peripheral_name=%s\r\n",__FUNCTION__,__LINE__,pEvent->deviceInfo.pEvtData);
    }
    ....
    }


    Could you please provide me some suggestions ?

    Best Regards,
    Louis
  • Can you take down the optimization and make sure DEFAULT_DEV_DISC_BY_SVC_UUID is set to FALSE?
    Then set a breakpoint accordingly to check the result.
  • Close due to inactivity