Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a34566b

Browse files
ABOSTMfpistm
authored andcommitted
fix: HCI only Firmware not supporting ACI_GAP_INIT ACI_GATT_INIT
On STM32WB, Cube FW version 1.14.1, messages ACI_GATT_INIT and ACI_GAP_INIT are not available on HCI only BLE firmware (stm32wb5x_BLE_HCILayer_fw.bin) This imply to move Random Address to host instead of relying on controller Signed-off-by: Alexandre Bourdiol <[email protected]>
1 parent c6e7932 commit a34566b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/local/BLELocalDevice.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,20 @@ int BLELocalDevice::begin()
124124
return 0;
125125
}
126126

127+
uint8_t randomNumber[8];
128+
if (HCI.leRand(randomNumber) != 0) {
129+
end();
130+
return 0;
131+
}
132+
/* Random address only requires 6 bytes (48 bits)
133+
* Force both MSB bits to b00 in order to define Static Random Address
134+
*/
135+
randomNumber[5] |= 0xC0;
136+
if (HCI.leSetRandomAddress((uint8_t*)randomNumber) != 0) {
137+
end();
138+
return 0;
139+
}
140+
127141
uint8_t hciVer;
128142
uint16_t hciRev;
129143
uint8_t lmpVer;

0 commit comments

Comments
 (0)