How to check whether the device is paired or just connected.

Peer Manager:

static 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));

	// Security parameters to be used for all security procedures.
	sec_param.bond           = SEC_PARAM_BOND;
	sec_param.mitm           = SEC_PARAM_MITM;
	sec_param.lesc           = SEC_PARAM_LESC;
	sec_param.keypress       = SEC_PARAM_KEYPRESS;
	sec_param.io_caps        = SEC_PARAM_IO_CAPABILITIES;
	sec_param.oob            = SEC_PARAM_OOB;
	sec_param.min_key_size   = SEC_PARAM_MIN_KEY_SIZE;
	sec_param.max_key_size   = SEC_PARAM_MAX_KEY_SIZE;
	sec_param.kdist_own.enc  = 0;
	sec_param.kdist_own.id   = 0;
	sec_param.kdist_peer.enc = 0;
	sec_param.kdist_peer.id  = 0;

	err_code = pm_sec_params_set(&sec_param);
	APP_ERROR_CHECK(err_code);
	err_code = pm_register(pm_evt_handler);
	APP_ERROR_CHECK(err_code);
}

 1. I am not sure whether my Nordic board and mobile app is just connected or paired, I am able to transfer data between the board and the mobile. How to check this ?

2.  I am trying to add the mobile device to the whitelist of the Nordic board after button press, but the IRQs are not stored it returns ```PM_PEER_ID_INVALID```

3.  When I change the value of ```SEC_PARAM_BOND``` to 1, it results in Fatal Error.

4. I have looked into many examples of whitelisting in sdk/examples/ble_peripheral and all implement bsp files to show the whitelist, where can I get the source code for the corresponding bsp files.

Parents Reply Children
Related