如题
void peer_manager_init(void)
{
ble_gap_sec_params_t sec_param;
ret_code_t err_code;
err_code = pm_init();
APP_ERROR_CHECK(err_code);
memset( &sec_param, 0, sizeof(ble_gap_sec_params_t) );
sec_param.bond = SEC_PARAM_BOND;
sec_param.mitm = SEC_PARAM_MITM;
sec_param.io_caps = SEC_PARAM_IO_CAPABILITIES;
sec_param.oob = SEC_PARAM_OOB;
sec_param.max_key_size = SEC_PARAM_MAX_KEY_SIZE;
sec_param.min_key_size = SEC_PARAM_MIN_KEY_SIZE;
sec_param.kdist_own.enc = 1;
sec_param.kdist_own.id = 1;
sec_param.kdist_peer.enc = 1;
sec_param.kdist_peer.id = 1;
err_code = pm_sec_params_set(&sec_param);
APP_ERROR_CHECK(err_code);
err_code = pm_register(pm_evt_handle);
APP_ERROR_CHECK(err_code);
err_code = fds_register(fds_evt_handle);
APP_ERROR_CHECK(err_code);
}
从机案例里面拷贝了个,但是没用。
两个事件都没进去