This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Bluetooth connection problem

Hi,

I am working with hid keyboard example on my Windows machine.

Problem 1 : After flashing the code, I make bluetooth connection and the code works properly. Then I remove the bluetooth device and if I try reconnecting, it does not connect. So I have to again flash the code with the soft device (SDK 15) to make it work.

Problem 2 : Bluetooth connection has been made with laptop 1 and the laptop is shut down. Now I try to connect to bluetooth of laptop 2; does not connect although I remove the device from laptop 1.

Parents Reply Children
  • Sounds to me that the case then may be that you need to allow repairing. Can you try to add the following to pm_evt_handler() in main.c

    // Insert in pm_evt_handler() in main.c
    
            case PM_EVT_CONN_SEC_CONFIG_REQ:
            {
                // Allow or reject pairing request from an already bonded peer.
                pm_conn_sec_config_t conn_sec_config = {.allow_repairing = true};
                pm_conn_sec_config_reply(p_evt->conn_handle, &conn_sec_config);
            } break; 
    

Related