The documentation here:
https://docs.zephyrproject.org/apidoc/latest/group__bt__gap.html#gae11eb8ad254418c38a0e8689df25a159
says, I can call l bt_id_create() before bt_enable(). I tried it like this:
uint8_t irk[16] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }; int err = bt_id_create(BT_ADDR_LE_ANY, irk); if (err < 0) { LOG_ERROR("bt_id_create failed (err %d)", err); }
[00:00:11.336,578] <inf> bt_hci_core: Identity: 00:00:00:00:00:00 (public)