Merge pull request #99 from taichunmin/device-address

Fix device address is not the same with APP
This commit is contained in:
Philippe Teuwen
2023-08-26 16:19:45 +02:00
committed by GitHub
2 changed files with 6 additions and 1 deletions
+1
View File
@@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file.
This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log...
## [unreleased][unreleased]
- Fix device address is not the same with APP (@taichunmin)
- Added initial version of the user guides (@GameTec-live)
- Added support for pasting several command lines at once with prompt_toolkit (@doegox)
- Added support for interrupting sleep sequence with a button press during animation (@doegox)
+5 -1
View File
@@ -83,8 +83,12 @@ data_frame_tx_t *cmd_processor_get_device_chip_id(uint16_t cmd, uint16_t status,
data_frame_tx_t *cmd_processor_get_device_address(uint16_t cmd, uint16_t status, uint16_t length, uint8_t *data) {
uint32_t device_address[2];
// The FICR value is a just a random number, with no knowledge
// of the Bluetooth Specification requirements for random addresses.
// So we need to set a Bluetooth LE random address as a static address.
// See: https://github.com/zephyrproject-rtos/zephyr/blob/7b6b1328a0cb96fe313a5e2bfc57047471df236e/subsys/bluetooth/controller/hci/nordic/hci_vendor.c#L29
device_address[0] = NRF_FICR->DEVICEADDR[0];
device_address[1] = NRF_FICR->DEVICEADDR[1];
device_address[1] = NRF_FICR->DEVICEADDR[1] | 0xC000;
return data_frame_make(cmd, STATUS_DEVICE_SUCCESS, 6, (uint8_t *)(&device_address[0]));
}