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

Writing password to pheripheral

Hi Gentlemen,

i want to pair my mobile(central) with peripheral device by entering passkey note: No input or display on peripheral device

suggest the method with sample codes if possible am using sdk 8.0.0 and nrf51dk

Parents
  • Hi, You can set static passkey in peripheral and all central should be able to pair using this passkey. Here is an example,

    { 
    uint8_t passkey[] = "123456"; 
    ble_opt_t ble_opt; 
    ble_opt.gap_opt.passkey.p_passkey = &passkey[0]; 
    (void) sd_ble_opt_set(BLE_GAP_OPT_PASSKEY, &ble_opt); 
    }
    

    And also set, sec_param.io_caps = SEC_PARAM_IO_CAPABILITIES; sec_param.mitm = 1;

Reply
  • Hi, You can set static passkey in peripheral and all central should be able to pair using this passkey. Here is an example,

    { 
    uint8_t passkey[] = "123456"; 
    ble_opt_t ble_opt; 
    ble_opt.gap_opt.passkey.p_passkey = &passkey[0]; 
    (void) sd_ble_opt_set(BLE_GAP_OPT_PASSKEY, &ble_opt); 
    }
    

    And also set, sec_param.io_caps = SEC_PARAM_IO_CAPABILITIES; sec_param.mitm = 1;

Children
No Data
Related