Generate BLE Random Static Address on U-blox Odin-W2 platform

pull/10067/head
Donatien Garnier 2019-03-08 12:48:02 +00:00 committed by Cruz Monrreal II
parent 92e076e3ad
commit b984dbdfa3
1 changed files with 13 additions and 1 deletions

View File

@ -337,10 +337,22 @@ void ble::vendor::odin_w2::HCIDriver::handle_reset_sequence(uint8_t *pMsg)
randCnt++; randCnt++;
HciLeRandCmd(); HciLeRandCmd();
} else { } else {
signal_reset_sequence_done(); uint8_t addr[6] = { 0 };
memcpy(addr, pMsg, sizeof(addr));
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:
break; break;
} }