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

Static Passkey with PCA10028 board and UART example

Dear Nordic Developers

I'm using ble_app_uart example with PCA10028 development board. SDK version is 8.0.0. I'm trying to program the PCA10028 board for having a static passkey. Below you can see my modified and added code

define STATIC_PASSKEY   "123456"

static uint8_t          passkey[] = STATIC_PASSKEY;

static void sec_params_init(void)

{

    m_sec_params.bond         = SEC_PARAM_BOND;   
    m_sec_params.mitm         = 1;
    m_sec_params.io_caps      = BLE_GAP_IO_CAPS_DISPLAY_ONLY;
    m_sec_params.oob          = SEC_PARAM_OOB;  
    m_sec_params.min_key_size = SEC_PARAM_MIN_KEY_SIZE;
    m_sec_params.max_key_size = SEC_PARAM_MAX_KEY_SIZE;
		
	ble_opt_t             static_pin_option;
	uint32_t               err_code;    	
	
	static_pin_option.gap_opt.passkey.p_passkey = &passkey[0];
				
	err_code = sd_ble_opt_set(BLE_GAP_OPT_PASSKEY, &static_pin_option);
}

I'm trying to connect using my smartphone (using nRF UART v2.0 application), It connects without asking to type a passkey.

Can you please tell me where I'm wrong? Thanks a lot, looking forward to your responses.

Related