I'm using pc-ble-driver on Windows7 (from master as I'm using a s130v2 programmed dongle) to connect a BLE device (developer.nordicsemi.com/.../a00053.html).
This device supports bounding and I could find no example explaining how this should be handled using the pc-ble-driver API.
When I connect the "Nordic_Mouse" device, I receive BLE_GAP_EVT_CONNECTED event and BLE_GAP_EVT_DISCONNECTED right after it (with reason set to 0x3E, BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED).
How should I bound the device? What pc-ble-driver function should I use to bound the device as I do in the "Master Control Panel" when I click "Bound"?
Edit: With metch and Hung Bui help, I started trying to call sd_ble_gap_authenticate
, like this:
ble_gap_sec_params_t params;
params.bond = (pairing != BTLE::Bound); // 1 to bond, 0 to pair?
params.mitm = 0;
params.lesc = 0;
params.keypress = 0;
params.io_caps = 1;
params.oob = 0;
params.min_key_size = 8;
params.max_key_size = 15;
params.kdist_own.enc = 1;
params.kdist_own.id = 1;
params.kdist_own.link = 1;
params.kdist_own.sign = 1;
params.kdist_peer.enc = 1;
params.kdist_peer.id = 1;
params.kdist_peer.link = 1;
params.kdist_peer.sign = 1;
uint32_t err_code = sd_ble_gap_authenticate(adapter, connectionHandle, ¶ms );
However, this fails with code 6. Is there no working C-based example able to connect Dev kit programmed with "Nordic Mouse " example?