File tree Expand file tree Collapse file tree 5 files changed +54
-39
lines changed
features/FEATURE_BLE/targets
TARGET_Cypress/COMPONENT_CYW43XXX Expand file tree Collapse file tree 5 files changed +54
-39
lines changed Original file line number Diff line number Diff line change @@ -144,14 +144,17 @@ void CordioHCIDriver::handle_reset_sequence(uint8_t *pMsg)
144
144
/* parse and store event parameters */
145
145
BdaCpy (hciCoreCb.bdAddr , pMsg);
146
146
147
- ble::address_t static_address;
148
-
149
- if (get_random_static_address (static_address)) {
147
+ const ble::peripheral_privacy_configuration_t configuration = {
148
+ .use_non_resolvable_random_address = false ,
149
+ .resolution_strategy = ble::peripheral_privacy_configuration_t ::DO_NOT_RESOLVE
150
+ };
151
+
152
+ if (
153
+ cordio::BLE::deviceInstance ().getGap (
154
+ ).setPeripheralPrivacyConfiguration (&configuration)
155
+ ) {
150
156
// note: will send the HCI command to send the random address
151
- cordio::BLE::deviceInstance ().getGap ().setAddress (
152
- BLEProtocol::AddressType::RANDOM_STATIC,
153
- static_address.data ()
154
- );
157
+ cordio::BLE::deviceInstance ().getGap ().enablePrivacy (false );
155
158
} else {
156
159
/* send next command in sequence */
157
160
HciLeReadBufSizeCmd ();
Original file line number Diff line number Diff line change @@ -337,14 +337,17 @@ void ble::vendor::odin_w2::HCIDriver::handle_reset_sequence(uint8_t *pMsg)
337
337
randCnt++;
338
338
HciLeRandCmd ();
339
339
} else {
340
- uint8_t addr[6 ] = { 0 };
341
- memcpy (addr, pMsg, sizeof (addr));
342
- DM_RAND_ADDR_SET (addr, DM_RAND_ADDR_STATIC);
343
- // note: will invoke set rand address
344
- cordio::BLE::deviceInstance ().getGap ().setAddress (
345
- BLEProtocol::AddressType::RANDOM_STATIC,
346
- addr
347
- );
340
+ const ble::peripheral_privacy_configuration_t configuration = {
341
+ .use_non_resolvable_random_address = false ,
342
+ .resolution_strategy = ble::peripheral_privacy_configuration_t ::DO_NOT_RESOLVE
343
+ };
344
+ if (
345
+ cordio::BLE::deviceInstance ().getGap (
346
+ ).setPeripheralPrivacyConfiguration (&configuration)
347
+ ) {
348
+ // note: will invoke set rand address
349
+ cordio::BLE::deviceInstance ().getGap ().enablePrivacy (false );
350
+ }
348
351
}
349
352
break ;
350
353
Original file line number Diff line number Diff line change @@ -297,14 +297,17 @@ class HCIDriver : public cordio::CordioHCIDriver {
297
297
randCnt++;
298
298
HciLeRandCmd ();
299
299
} else {
300
- uint8_t addr[6 ] = { 0 };
301
- memcpy (addr, pMsg, sizeof (addr));
302
- DM_RAND_ADDR_SET (addr, DM_RAND_ADDR_STATIC);
303
- // note: will invoke set rand address
304
- cordio::BLE::deviceInstance ().getGap ().setAddress (
305
- BLEProtocol::AddressType::RANDOM_STATIC,
306
- addr
307
- );
300
+ const ble::peripheral_privacy_configuration_t configuration = {
301
+ .use_non_resolvable_random_address = false ,
302
+ .resolution_strategy = ble::peripheral_privacy_configuration_t ::DO_NOT_RESOLVE
303
+ };
304
+ if (
305
+ cordio::BLE::deviceInstance ().getGap (
306
+ ).setPeripheralPrivacyConfiguration (&configuration)
307
+ ) {
308
+ // note: will invoke set rand address
309
+ cordio::BLE::deviceInstance ().getGap ().enablePrivacy (false );
310
+ }
308
311
}
309
312
break ;
310
313
Original file line number Diff line number Diff line change @@ -261,14 +261,17 @@ class HCIDriver : public cordio::CordioHCIDriver {
261
261
randCnt++;
262
262
HciLeRandCmd ();
263
263
} else {
264
- uint8_t addr[6 ] = { 0 };
265
- memcpy (addr, pMsg, sizeof (addr));
266
- DM_RAND_ADDR_SET (addr, DM_RAND_ADDR_STATIC);
267
- // note: will invoke set rand address
268
- cordio::BLE::deviceInstance ().getGap ().setAddress (
269
- BLEProtocol::AddressType::RANDOM_STATIC,
270
- addr
271
- );
264
+ const ble::peripheral_privacy_configuration_t configuration = {
265
+ .use_non_resolvable_random_address = false ,
266
+ .resolution_strategy = ble::peripheral_privacy_configuration_t ::DO_NOT_RESOLVE
267
+ };
268
+ if (
269
+ cordio::BLE::deviceInstance ().getGap (
270
+ ).setPeripheralPrivacyConfiguration (&configuration)
271
+ ) {
272
+ // note: will invoke set rand address
273
+ cordio::BLE::deviceInstance ().getGap ().enablePrivacy (false );
274
+ }
272
275
}
273
276
break ;
274
277
Original file line number Diff line number Diff line change @@ -307,14 +307,17 @@ class HCIDriver : public cordio::CordioHCIDriver
307
307
randCnt++;
308
308
HciLeRandCmd ();
309
309
} else {
310
- uint8_t addr[6 ] = { 0 };
311
- memcpy (addr, pMsg, sizeof (addr));
312
- DM_RAND_ADDR_SET (addr, DM_RAND_ADDR_STATIC);
313
- // note: will invoke set rand address
314
- cordio::BLE::deviceInstance ().getGap ().setAddress (
315
- BLEProtocol::AddressType::RANDOM_STATIC,
316
- addr
317
- );
310
+ const ble::peripheral_privacy_configuration_t configuration = {
311
+ .use_non_resolvable_random_address = false ,
312
+ .resolution_strategy = ble::peripheral_privacy_configuration_t ::DO_NOT_RESOLVE
313
+ };
314
+ if (
315
+ cordio::BLE::deviceInstance ().getGap (
316
+ ).setPeripheralPrivacyConfiguration (&configuration)
317
+ ) {
318
+ // note: will invoke set rand address
319
+ cordio::BLE::deviceInstance ().getGap ().enablePrivacy (false );
320
+ }
318
321
}
319
322
break ;
320
323
You can’t perform that action at this time.
0 commit comments