Configuration
Serialized Bluetooth application.
Host:
Pc running Linux.
Host application:
-Custom application linking pc-ble-driver from github.com/.../pc-ble-driver
-Implements a peripheral with 3 custom services. Only 1 service requires binding for access.
Ble connectivity chip:
nRF52832 running connectivity_2.0.1_115k2_with_s132_5.0.hex
Problem:I can not do binding. I was looking into the forum and could not find a usefull response to the problem or somebody that was able to do
the binding in this configuration.
When i try from the central to access the service that requires binding:
I get the event BLE_GAP_EVT_SEC_PARAMS_REQUEST, with the following parameters (connection handle, peer security parameters):
BLE_GAP_EVT_SEC_PARAMS_REQUEST:handle[0]current[0]
BLE_GAP_EVT_SEC_PARAMS_REQUEST:request sec params
-bond[1],io_caps[4],keypress[0],lesc[1],max_key_size[16],min_key_size[0],mitm[1],oob[0]
-kdist own enc[1]id[1]link[0]sign[0], peer enc[1]id[1]link[0]sign[0]
Accrding with "Gap peripheral Bonding: Passkey entry, Pripheral displays" i have to use the following function to reply:
sd_ble_gap_sec_params_reply(adapter_t *adapter, uint16_t conn_handle, uint8_t sec_status, ble_gap_sec_params_t const *p_sec_params, ble_gap_sec_keyset_t const *p_sec_keyset);
Looking in ble_gap_impl.cpp looks like the keyset will be copied into m_app_keys_table[index].keyset for future use
I can create the first 4 parameters of the function with no problems as follows:
adapter_t *adapter, uint16_t conn_handle, uint8_t sec_status, ble_gap_sec_params_t const *p_sec_params
I do not know how to create ble_gap_sec_keyset_t const *p_sec_keyset
typedef struct
{
ble_gap_sec_keys_t keys_own; /**< Keys distributed by the local device. For LE Secure Connections the encryption key will be generated locally and will always be stored if bonding. */
ble_gap_sec_keys_t keys_peer; /**< Keys distributed by the remote device. For LE Secure Connections, p_enc_key must always be NULL. */
} ble_gap_sec_keyset_t;
1. Where i can get the keys the peer sent?
2. Is that a API to generate own keys?
3. Are the keys stored in the connectivity chip and are they "power cycle" safe?
4. Is the binding possible in the serialized Bluetooth architecture?