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

Setting a Passkey to my Device

I'm working on a project & I followed the procedure found here in the answer, it works with me when I tested it when pairing from the bluetooth devices shown, when I tested it with Nordic Master Control Panel, I found it connects directly without asking to enter a passkey? ?

I'm asking also if I can change that passkey through my mobile application, if yes please inform me with the procedure.

also I'm asking about, what is the normal operation of the chip, I mean is it in the lowpwer mode or not,

what will happen if I didn't include NRF_POWER->TASKS_LOWPWR = 1; in my code.

	int main(void)
	{  
            ble_opt_t static_pin_option;
			bool  erase_bonds;
			leds_init();
			timers_init();
			gpiote_init();
            ble_stack_init();
            static_pin_option.gap_opt.passkey.p_passkey = passkey;
			sd_ble_opt_set(BLE_GAP_OPT_PASSKEY, &static_pin_option);			
			scheduler_init();
			conn_params_init(); 
			sec_params_init();				
	        device_manager_init(erase_bonds);
			gap_params_init();
			services_init();
			advertising_init();
			sensor_simulator_init();
			NRF_POWER->TASKS_LOWPWR = 1;
			if (NRF_POWER->TASKS_LOWPWR != 1)
				pattern_ID_1(70,100,0x01);
			// Start execution
			advertising_start();
			LPCOMP_init();
			// Enter main loop
			for (;;)
			{
					app_sched_execute();
					power_manage();
			}
	}
Related