Merge pull request #10012 from donatieng/ublox_odin_w2_static_random_addr

Generate BLE Static Random Address on U-blox Odin-W2 platform
pull/10026/head
Martin Kojtal 2019-03-09 17:40:21 +01:00 committed by GitHub
commit 774294d1e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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++;
HciLeRandCmd();
} 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;
case HCI_OPCODE_LE_SET_RAND_ADDR:
/* send next command in sequence */
signal_reset_sequence_done();
break;
default:
break;
}