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

pairing failed

Hi ,Nordics

image description when I use my host device (reffered to the example of ble_app_hrs_c)to pair and bond with a peripheral device(a gamepad) ,the pairing failed .I don't kown the reason .And when I try to enable the cccd ,image descriptionit failed . I want to know why this happened ?In my project ,I just want to receive the datas through the host . The peripheral device pairing and bonding with mobile phone process is as below .image descriptionimage descriptionimage description

  • DM configuer is :

    static void device_manager_init(bool erase_bonds) { uint32_t err_code; dm_init_param_t init_param = {.clear_persistent_data = erase_bonds}; dm_application_param_t register_param;

    err_code = pstorage_init();
    APP_ERROR_CHECK(err_code);
    
    err_code = dm_init(&init_param);
    APP_ERROR_CHECK(err_code);
    
    memset(&register_param.sec_param, 0, sizeof (ble_gap_sec_params_t));
    
    // Event handler to be registered with the module.
    register_param.evt_handler            = device_manager_event_handler;
    
    // Service or protocol context for device manager to load, store and apply on behalf of application.
    // Here set to client as application is a GATT client.
    register_param.service_type           = DM_PROTOCOL_CNTXT_GATT_CLI_ID;
    
    // Secuirty parameters to be used for security procedures.
    register_param.sec_param.bond         = SEC_PARAM_BOND;
    register_param.sec_param.mitm         = SEC_PARAM_MITM;
    register_param.sec_param.io_caps      = SEC_PARAM_IO_CAPABILITIES;
    register_param.sec_param.oob          = SEC_PARAM_OOB;
    register_param.sec_param.min_key_size = SEC_PARAM_MIN_KEY_SIZE;
    register_param.sec_param.max_key_size = SEC_PARAM_MAX_KEY_SIZE;
    register_param.sec_param.kdist_periph.enc = 1;
    register_param.sec_param.kdist_periph.id  = 1;
    

    // register_param.sec_param.kdist_periph.sign =1; err_code = dm_register(&m_dm_app_id, &register_param); APP_ERROR_CHECK(err_code); } image descriptionimage descriptionimage description

  • And if you use the same Security parameters with your own project?

Related