Hello All,
I am struggling with setting up the BLE5-Stack on CC2640R2 modules, to perform following scenario (I am using simple_peripheral and simple_central examples):
Scenario is taken from BLE5 spec:
Let’s call peripheral device as PD, and central device as CD.
- Pair of IRKs is given (one for PD and one for CD).
- Generated IRKs are flashed into PD and CD firmware and are added to their Resolving Lists (so that each device knows its peer).
- Both PD and CD uses Resolvable Private Address (RPA) modes.
- PD enters Advertising state and sends Directed Advertisements (Directed, Connectable, Legacy) to the CD.
- CD enters Scanning state and passively scans for Directed Advertisements. When one is received and its advertiser’s and target's identity is resolved, I would like to see the Advertisement Report e.g. print it.
The issue is, that I am able to receive the report on CD only when PD's advertisement payload contains "TargetA" field equal to current CD's RPA (exactly equal to). According the BLE 5 Spec:
"When an initiator receives a directed connectable advertising event that contains a resolvable private address for the target’s address (TargetA field), the Link Layer shall resolve the private address using the Local IRK values(see Section 1.3.2.3)."
When I use following code:
GapAdv_params_t advParamLegacy = GAPADV_PARAMS_DIRECT_ADV_CONN; advParamLegacy.peerAddrType = PEER_ADDRTYPE_RANDOM_OR_RANDOM_ID; LL_PRIV_GenerateRPA(thisIrk, generatedRpa); memcpy(&(advParamLegacy.peerAddr[0]), &generatedRpa[0], 6); // Create Advertisement set #1 and assign handle status = GapAdv_create(&SimplePeripheral_advCallback, &advParamLegacy, &advHandleLegacy);
to create an advertisement, the CD device cannot resolve TargetA address. Why is that?
Of course I have set the IRK on the CD device equal to "thisIrk" from the code snippet.
Can anybody help me with my isse? Maybe my conception is wrong, and it is only possible to send ADV_DIRECT_IND using TargetA equal to current CD's RPA? But why?
BR,
Krzysztof