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.

CC2640 Concurrent discover and initiate.

Other Parts Discussed in Thread: CC2640

Hello
Is it possible with the CC2640 to initiate and discover at the same time?
My goal is to be always ready to connect very fast to a upcomming slave who wants to connect with direct advertise. (whitelisted)
But also I want to receive all broadcasts from other devices.


Up to now I did not manage to realize it and I work with the following workaround:

1: Discovering

  GAP_RegisterForHCIMsgs(selfEntity);                                                  //receive Broadcast & DirectAdvertise
  GAP_SetParamValue(TGAP_FILTER_ADV_REPORTS, FALSE);      // do not filter advertise reports
  GAPRole_StartDiscovery(DEVDISC_MODE_ALL, FALSE, FALSE);   //start scan

I do only discovering all the time to receive broadcasts and direct advertise.
(To receive the direct advertise events I changed the properties.)
When I receive a direct advetise event I go to step 2:

2: Initiating
  GAPRole_CancelDiscovery();
  GAPRole_EstablishLink(FALSE, FALSE, addrType, peerAddr);           //connect
 
  When the discovering receives a event from a direct advertise slave I stop discovering and I start initiating.

This solution is quite complicated and slow. Isn't it possible to discover and initiate at the same time?
I mean the radio receiver does the same if I discover or initiate. He just listen.

Thanks

  • Hi Thomas,

    As far as I know this is not possible. Maybe has more input.

    Cheers,
    Fredrik
  • Hello,

    If you initiate a connection to the White List, then do a scan, a connection will be initiated automatically when a white listed device is detected.

    Otherwise, you will need to scan, then initiate the connection.

    Best wishes
  • Hi JXS

    Thanks for your respond.
    I tried your suggestion:

    1: Initiate with white list
    ----------------------------------
    //prepare whitelist
    HCI_LE_ClearWhiteListCmd();
    for(i = 0; i<DEVICE_FILTER_LIST_SIZE; i++){
    uint8 *peerAddr = &(m_DeviceFilterList[i].addr);
    HCI_LE_AddWhiteListCmd( ADDRTYPE_PUBLIC, peerAddr);
    }

    //set filter policy & establish link
    uint8_t value = GAP_FILTER_POLICY_WHITE;
    GAPRole_SetParameter(GAPROLE_ADV_FILTER_POLICY, sizeof(uint8_t), &value, NULL);
    GAPRole_EstablishLink(FALSE, WL_USED, 0x00, NULL);


    2: Scan
    -----------------
    GAPRole_StartDiscovery(DEVDISC_MODE_ALL, FALSE, FALSE);


    Result:
    --------------
    A connection with direct advertise and white list now works. Also very fast.
    But I can not receive any more all broadcast events from other devices. Some I loose some I receive.
    I also played arround with the scan/discover window:

    GAP_SetParamValue(TGAP_CONN_SCAN_INT, u8InitiateScanInterval);
    GAP_SetParamValue(TGAP_CONN_SCAN_WIND, u8InitiateScanWindow);
    GAP_SetParamValue(TGAP_GEN_DISC_SCAN_INT, u8DiscoverScanInterval);
    GAP_SetParamValue(TGAP_GEN_DISC_SCAN_WIND, u8DiscoverScanWindow);


    Scan Window Initiate > Scan Window Discover:
    --> No discover events, fast direct advertise connect

    Scan Window Initiate = Scan Window Discover :
    --> Sometimes discover events, sometimes slow, sometimes fast direct advertise connect

    Scan Window Initiate < Scan Window Discover:
    --> Receive of all discover events. No connect with direct advertise possible

    Depending if the initiate or scan window is bigger or smaller discover or direct advertise works. But I never can initiate with whitelist and receive all broadcast event at the same time.

    Any ideas?
    Regards Thomas