- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I haven't tried your code, but you can give a look at the following project, which uses something similar:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the info.
That helped a bit. But maybe I misunderstand something: Is the bonding required to use direct advertising?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.