directed advertising

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
MaLe_1269846
Level 1
Level 1

Does somebody has experience, or even better an example, how to use directed advertising with the PRoC modules?

   

I have a project where i use one PRoC module as Central, and another one as peripheral.

   

Everything is working fine, as long as i do not use directed advertising.

   

Please have a look a the following code  snippet:

   

    apiResult = CyBle_Start(BLE_StackEventHandler);
    
    memcpy(&discParam, &cyBle_discoveryParam, sizeof(discParam));
    memcpy(discParam.directAddr, PairingAddress.bdAddr, sizeof(discParam.directAddr));
    discParam.directAddrType = PairingAddress.type;
    discParam.advFilterPolicy = CYBLE_GAPP_SCAN_CONN_WHITELIST_ONLY;
    discParam.ownAddrType = ownAddr.type;
//    discParam.advType = CYBLE_GAPP_CONNECTABLE_HIGH_DC_DIRECTED_ADV;
//    discParam.advType = CYBLE_GAPP_CONNECTABLE_LOW_DC_DIRECTED_ADV;
    
    discModeInfo.discMode = CYBLE_GAPP_GEN_DISC_MODE;
    discModeInfo.advParam = &discParam;
    discModeInfo.advData = &cyBle_discoveryData;
    discModeInfo.scanRspData = &cyBle_scanRspData;
    discModeInfo.advTo = 0;

   

    CYBLE_API_RESULT_T apiResult = CyBle_GappEnterDiscoveryMode(&discModeInfo);

   

This code snippet works as expected. But as soon as I uncomment one of the lines which sets "discParam.advType" to  one of the *DIRECTED_ADV modes, no further connections are possible.

   

BTW: PairingAddress holds the address of the associated peer.

   

I am using the BLE component V2.30.

   

What am I missing?

   

 

   

Best regards,

   

Martin

0 Likes
3 Replies
Anonymous
Not applicable

I haven't tried your code, but you can give a look at the following project, which uses something similar:

   

https://github.com/cypresssemiconductorco/PSoC-4-BLE/tree/master/100_Projects_in_100_Days/Day030_Tim...

0 Likes

Thanks for the info.

   

That helped a bit. But maybe I misunderstand something: Is the bonding required to use direct advertising?

0 Likes
Anonymous
Not applicable

You do NOT need to be bonded to send directed advertising, but normally you are advertising to a bonded device, no? 🙂

   

It should always be possible to do directed advertising, as it just attaches an address of the device you are directing the advertising towards.

0 Likes