I'm unable to pair my device with Windows 8.1. Pairing with Android works just fine whereas when I try to do it on my computer it just tells me that the device is no longer discoverable. Also, at the end of pairing with Android I seem to be geting 24 and 23 events (no idea what those are), when pairing with Windows I only get 23.
I've read it's a known problem and somebody suggested to add the following code to GAP initialization:
ble_gap_addr_t bleAddress;
sd_ble_gap_address_get(&bleAddress);
sd_ble_gap_address_set(BLE_GAP_ADDR_CYCLE_MODE_NONE, &bleAddress);
It didn't change anything though, both of those functions return NRF_SUCCESS. I'm using device manager as suggested, also here's my event handler for BLE:
void bleEventHandler(ble_evt_t *event)
{
uint32_t errorCode;
bleServiceEventHandler(drSmartService, event);
switch(event->header.evt_id)
{
case BLE_GAP_EVT_TIMEOUT:
debugOut("Advertising timeout\r\n");
break;
case BLE_GAP_EVT_CONNECTED:
connectionHandle = event->evt.gap_evt.conn_handle;
debugOut("Connection estabilished\r\n");
break;
case BLE_GAP_EVT_SEC_PARAMS_REQUEST:
debugOut("Providing security parameters\r\n");
securityKeyset.keys_periph.p_enc_key = NULL;
if((errorCode = sd_ble_gap_sec_params_reply(connectionHandle, BLE_GAP_SEC_STATUS_SUCCESS, &securityParams, &securityKeyset)) != NRF_SUCCESS)
debugOut("Error %lu: security params reply failed\r\n", errorCode);
break;
case BLE_GAP_EVT_SEC_INFO_REQUEST:
debugOut("Providing security information\r\n");
// ?
break;
case BLE_GAP_EVT_DISCONNECTED:
connectionHandle = BLE_CONN_HANDLE_INVALID;
debugOut("Disconnected.. Resuming advertising\r\n");
if((errorCode = bleAdvertisingStart()) != NRF_SUCCESS)
debugOut("Error %lu: failed to resume advertising\r\n", errorCode);
case BLE_GATTS_EVT_SYS_ATTR_MISSING:
debugOut("Setting system attribute access\r\n");
if((errorCode = sd_ble_gatts_sys_attr_set(connectionHandle, NULL, 0, 0)) != NRF_SUCCESS)
debugOut("Error %lu: failed to set sys attr access\r\n", errorCode);
break;
case BLE_GATTC_EVT_TIMEOUT:
debugOut("Client connection timeout..\r\n");
break;
case BLE_GATTS_EVT_TIMEOUT:
debugOut("Server connection timeout. Terminating..\r\n");
if((errorCode = sd_ble_gap_disconnect(connectionHandle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION)) != NRF_SUCCESS)
debugOut("Error %lu: failed to terminate connection\r\n", errorCode);
break;
default:
debugOut("Unknown event: %d\r\n", event->header.evt_id);
}
}
Thank you