Page 1 of 1

Nimble BLE config

Posted: Wed Jan 11, 2023 9:58 am
by Alberk
Hi,

I am looking as some sample code. Does this code apply to both Peripheral and Central BLE implementation?

Code: Select all

ble_hs_cfg.store_status_cb = ble_store_util_status_rr;
ble_hs_cfg.sm_io_cap = 0;
ble_hs_cfg.sm_bonding = 1;
ble_hs_cfg.sm_mitm = 1;
ble_hs_cfg.sm_sc = 1;
ble_hs_cfg.sm_our_key_dist = 1 | BLE_SM_PAIR_KEY_DIST_ID;
ble_hs_cfg.sm_their_key_dist = 1 | BLE_SM_PAIR_KEY_DIST_ID;

Re: Nimble BLE config

Posted: Fri Jan 13, 2023 10:43 am
by irahul
No, not specific to peripheral role. It depends upon use case and end user requirement. This is host configuration structure fields.

Re: Nimble BLE config

Posted: Fri Jan 13, 2023 10:52 am
by Alberk
Thank you for the information. There is another function.

Code: Select all

ble_gap_security_initiate(conn_id);
Is this a client/central function?

Re: Nimble BLE config

Posted: Fri Jan 13, 2023 10:55 am
by irahul
As per my understanding, this API is used to initiate security .It would either go for pairing /encryption or initiate security request. So not specific to central or peripheral role.

Re: Nimble BLE config

Posted: Sun Jan 15, 2023 4:54 pm
by ujurmsde
In esp-idf examples folder there are sample codes in bluetooth subdirectory for various roles.