mirror of https://github.com/ARMmbed/mbed-os.git
STM32WB: Set a random static address during init
parent
dbfe97d649
commit
79568dbe6d
|
@ -311,11 +311,22 @@ public:
|
||||||
randCnt++;
|
randCnt++;
|
||||||
HciLeRandCmd();
|
HciLeRandCmd();
|
||||||
} else {
|
} else {
|
||||||
/* last command in sequence; set resetting state and call callback */
|
uint8_t addr[6] = { 0 };
|
||||||
tr_debug("signal_reset_sequence_done\r\n");
|
memcpy(addr, pMsg, sizeof(addr));
|
||||||
signal_reset_sequence_done();
|
DM_RAND_ADDR_SET(addr, DM_RAND_ADDR_STATIC);
|
||||||
|
// note: will invoke set rand address
|
||||||
|
cordio::BLE::deviceInstance().getGap().setAddress(
|
||||||
|
BLEProtocol::AddressType::RANDOM_STATIC,
|
||||||
|
addr
|
||||||
|
);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case HCI_OPCODE_LE_SET_RAND_ADDR:
|
||||||
|
/* send next command in sequence */
|
||||||
|
signal_reset_sequence_done();
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
tr_debug("Complete Event in reset seq with unknown opcode =0x%4X\r\n", opcode);
|
tr_debug("Complete Event in reset seq with unknown opcode =0x%4X\r\n", opcode);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue