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
  • Is there any example code for oob other than gls because its mitm ..?

  • */ static void sec_params_init(void) {

    m_sec_params.bond         = SEC_PARAM_BOND;
    m_sec_params.mitm         = SEC_PARAM_MITM;
    m_sec_params.io_caps      = SEC_PARAM_IO_CAPABILITIES;
    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;
    

    }

    #define SEC_PARAM_TIMEOUT 30 /< Timeout for Pairing Request or Security Request (in seconds). */ #define SEC_PARAM_BOND 1 /< Perform bonding. */ #define SEC_PARAM_MITM 1 /< Man In The Middle protection not required. */ #define SEC_PARAM_IO_CAPABILITIES BLE_GAP_IO_CAPS_NONE /< No I/O capabilities. */ #define SEC_PARAM_OOB 0 /< Out Of Band data not available. */ #define SEC_PARAM_MIN_KEY_SIZE 7 /< Minimum encryption key size. */ #define SEC_PARAM_MAX_KEY_SIZE 16

    gap_params_init(); { 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); }

    services_init();
    
Reply
  • */ static void sec_params_init(void) {

    m_sec_params.bond         = SEC_PARAM_BOND;
    m_sec_params.mitm         = SEC_PARAM_MITM;
    m_sec_params.io_caps      = SEC_PARAM_IO_CAPABILITIES;
    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;
    

    }

    #define SEC_PARAM_TIMEOUT 30 /< Timeout for Pairing Request or Security Request (in seconds). */ #define SEC_PARAM_BOND 1 /< Perform bonding. */ #define SEC_PARAM_MITM 1 /< Man In The Middle protection not required. */ #define SEC_PARAM_IO_CAPABILITIES BLE_GAP_IO_CAPS_NONE /< No I/O capabilities. */ #define SEC_PARAM_OOB 0 /< Out Of Band data not available. */ #define SEC_PARAM_MIN_KEY_SIZE 7 /< Minimum encryption key size. */ #define SEC_PARAM_MAX_KEY_SIZE 16

    gap_params_init(); { 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); }

    services_init();
    
Children
No Data
Related