Skip to content

Commit 774294d

Browse files
authored
Merge pull request #10012 from donatieng/ublox_odin_w2_static_random_addr
Generate BLE Static Random Address on U-blox Odin-W2 platform
2 parents b9c214b + 041d53d commit 774294d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

features/FEATURE_BLE/targets/TARGET_CORDIO_ODIN_W2/HCIDriver.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,10 +337,22 @@ void ble::vendor::odin_w2::HCIDriver::handle_reset_sequence(uint8_t *pMsg)
337337
randCnt++;
338338
HciLeRandCmd();
339339
} else {
340-
signal_reset_sequence_done();
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+
);
341348
}
342349
break;
343350

351+
case HCI_OPCODE_LE_SET_RAND_ADDR:
352+
/* send next command in sequence */
353+
signal_reset_sequence_done();
354+
break;
355+
344356
default:
345357
break;
346358
}

0 commit comments

Comments
 (0)