cancel
Showing results for 
Search instead for 
Did you mean: 

WICED Smart Bluetooth

Anonymous
Not applicable

In WICED SDK 2.0.1,  I use hello_client as application.

I believe that connection event is done by hello_client_interrupt_handler().

Without triggering connection through button or interrupt, I'd like to make it connected.

I put following 2 lines at the end of hello_client_create() .

bleprofile_Discoverablew(NO_DISCOVERABLES, NULL);

blecen_Scan(HIGH_SCAN);

but the connection has not done when hello_client_create() ends.

After 2min 30sec about, conn up happened.

How can I put the board into connected status without button or interrupt event?

0 Likes
1 Solution
SuLe_1710756
Contributor

Hi, eyan

To connect without any interrupt, please change hello_client_create() as follows and then do test.

You don't need to change anything else.

void hello_client_create(void)

{

     ....

    blecen_Create();

#if 0   // for test

    // we will not do scan until user pushes the button for 5 seconds

    blecen_Scan(NO_SCAN);

    bleprofile_regButtonFunctionCb(NULL);

#endif   

    ...

}

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.

Thanks,

SM

View solution in original post

3 Replies
ArvindS_76
Employee

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.

0 Likes
Anonymous
Not applicable

I tested 2 cases at the same condition.

1. Peripheral - hello sensor without change of hello_sensor_cfg.

2. Central

     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.

Thank you.

0 Likes
SuLe_1710756
Contributor

Hi, eyan

To connect without any interrupt, please change hello_client_create() as follows and then do test.

You don't need to change anything else.

void hello_client_create(void)

{

     ....

    blecen_Create();

#if 0   // for test

    // we will not do scan until user pushes the button for 5 seconds

    blecen_Scan(NO_SCAN);

    bleprofile_regButtonFunctionCb(NULL);

#endif   

    ...

}

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.

Thanks,

SM

View solution in original post