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

static passkey demo code for S110 stackV8.0/SDK10 of nrf51822

Dear all

I want to add the static pin to my project(s110 stackV8.0, based on SDK10), add the follow code to gap_params_init:

uint8_t passkey[] = STATIC_PASSKEY;
m_static_pin_option.gap_opt.passkey.p_passkey = passkey;
err_code =  sd_ble_opt_set(BLE_GAP_OPT_PASSKEY, &m_static_pin_option);

init the device manager. But it seems not work as phone can connect it successfully without type in passkey. Any link or demo code can I refer to ?

Regards Jenson

Parents
  • A peripheral will allow any central to connect to it, as long as it is not using a whitelist. You connect before you pair, you pair to increase the security level of the link so that you can access characteristic values or descriptors that require a certain security level.

    You can set the security requirement of the characteristic values and descriptors by using the GAP attribute security requirement setters, see for example in glucose_feature_char_add() where you need security level 2 (BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM(&attr_md.read_perm);) to read the characteristic value. This question may also give some insight.

    The central device, here the smart phone, must send the pairing request. The smart phone will normally send this pairing request when it tries to access a peripheral that requires encryption without success.

  • Np :) Then I would appreciate if you would accept my answer by clicking the check mark next to it. Thx.

Reply Children
No Data
Related