Is any device advertising?
> but the connection has not done when hello_client_create() ends.
blecen_Scan() will only start scanning for advertisements. If there are no other devices advertising what the hello_client app expects, then you won't get into a connection.
I tested 2 cases at the same condition.
1. Peripheral - hello sensor without change of hello_sensor_cfg.
A. blecen_scan() at the end of hello_client_create()
B. blecen_scan() at the button interrupt.
I reset peripheral and central at the same time.
A took 30 sec until pairing.
B took 5 sec until pairing (I set the button press duration as 1sec).
I can not understand why scan does not happen in a short time at A case.
One more thing what I'd like to ask is that blecen_scan() in blecen.c is the right function used for paring ?
I put trace0 in the blecen_scan(), but message did not display.
1 of 1 people found this helpful
To connect without any interrupt, please change hello_client_create() as follows and then do test.
You don't need to change anything else.
#if 0 // for test
// we will not do scan until user pushes the button for 5 seconds
Connection between hello_client and hello_sensor were always successful after booting up.
If you still have some problem, let me know with debug message.