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.

Connecting to a particular device using white list as per choice.

Other Parts Discussed in Thread: CC2650

Hello everyone,

I need to connect a central device to two Peripheral. I tried it with White list and device get connected easily and white list was successful.
 
Now what i need is that when i press LEFT key in central it should connect to one device and when RIGHT Key it should get connected to Other device.
Is it possible?? Do i need to make any change i white list??




Thanks
Pranav

  • Are you considering this from the peripheral or central perspective?
  • Hy Tim,

    I am using central for this purpose.
    As i press the Left or RIGHt key it should shart scanning for a particular devices only not all the devices which are in white list.

    Thanks
    Pranav
  • Hey Tim,

    Any solution?
  • Yes, just select the desired address in the connection request when the button is pushed. See simpleBLEcentral for an example of handling button presses and sending connection requests.
  • Hey Tim,

    Actually i am using Auto Sync White list so after finding a device should this code will work?

    // if there is a scan result
          if (scanRes > 0)
          {
            // connect to current device in scan result
            peerAddr = devList[scanIdx].addr;
            addrType = devList[scanIdx].addrType;
    
            HCI_LE_ClearWhiteListCmd();
            HCI_LE_AddWhiteListCmd(HCI_PUBLIC_DEVICE_ADDRESS,peerAddr);
    
            state = BLE_STATE_CONNECTING;
    
            GAPCentralRole_EstablishLink(DEFAULT_LINK_HIGH_DUTY_CYCLE,
                                         DEFAULT_LINK_WHITE_LIST,
                                         addrType, peerAddr);
    
            LCD_WRITE_STRING("Connecting", LCD_PAGE2);
            LCD_WRITE_STRING(Util_convertBdAddr2Str(peerAddr), LCD_PAGE3);
            LCD_WRITE_STRING("", LCD_PAGE4);
    


    Please guide me if i'm going some where wrong.

  • Yes that should work.
  • Hey TIm,

    I tried this method but its actually not working.
    Actually the thing is White list is getting Created properly in Peripheral side but same is not happening on Central Side.
    As when we try to do that no devices Got Found.

    One more thing is that this white function work properly if we give the Address in the program only but when same concept is applied via Auto sync white list its not happening at all.
    Please Guide me in this.

    Thanks
    Pranav
  • How is not working?

    What is the status returned from the establish link command? How do you know that the whitelist is created properly on the peripheral side but not on the central side?

    Can you provide a top-level summary of what you are trying to do? Is it the following?

    1. Peripheral Advertises
    2. Central Scans
    3. Central finds peripheral and adds it to the whitelist
    4. Central establishes connection with peripheral

  • Hey Tim,

    This is what i am doing:
    1. 2 Peripheral advertises
    2. Central UP Button Click and it scans for all the devices.
    3. Connect to available devices and Peripheral add them in white list.
    4. Central when Click Right Button it should connect to one of peripheral and on LEFT Button connect to other devices.

    From these Points Point 1,2,3 are Getting done but not able to do the 4th point.
    While in case of hard coded Bluetooth address the 4th Point is also getting true but i need it to be automatic instead of hard-coded.
    For Central i am using Smart RF Board and For Peripheral i am using cc2650 Custom Device.

    Thanks
    Pranav