Any callback from timeout of blecm_CreateConnection?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
hachc_2137126
Level 5
Level 5
10 likes given 5 likes given First like received

Hi,

  Is there timeout check after call of blecm_CreateConnection to one device which is not reachable?

  If yes, any callback will be invoked? And what't the timeout value? 10 s?

0 Likes
1 Solution
JaWa_2142591
Level 5
Level 5
25 likes received 10 likes received First like received

You should use blecen_Conn() instead of using blecm_CreateConnection() directly.

In blecen_Conn(), you can set high_scan_duration and low_scan_duration within the structure blecen_cen_cfg when you attempt to create a ble connection.

By default,

When high_scan_duration is expired, stack will switch to use low_scan_window/low_scan_interval with low_scan_duration to continue scan.

When low_scan_duration again gets expired, the connection attempt would stop.

Or you can overwrite the behavior above by registering blecen_usertimerCb() in app_create(). In the sample application hello_client in SDK 2.1.1, hello_client_timer_callback(), it keeps low_scan forever after scan timed out and cancels original connection attempt.

Only when connect is up a call back is invoked.

View solution in original post

0 Likes
3 Replies
JaWa_2142591
Level 5
Level 5
25 likes received 10 likes received First like received

You should use blecen_Conn() instead of using blecm_CreateConnection() directly.

In blecen_Conn(), you can set high_scan_duration and low_scan_duration within the structure blecen_cen_cfg when you attempt to create a ble connection.

By default,

When high_scan_duration is expired, stack will switch to use low_scan_window/low_scan_interval with low_scan_duration to continue scan.

When low_scan_duration again gets expired, the connection attempt would stop.

Or you can overwrite the behavior above by registering blecen_usertimerCb() in app_create(). In the sample application hello_client in SDK 2.1.1, hello_client_timer_callback(), it keeps low_scan forever after scan timed out and cancels original connection attempt.

Only when connect is up a call back is invoked.

0 Likes

Hi janusw,

  Thanks!

  It looks that only blecm_CreateConnectionCancel can stop the initiator process.

0 Likes

When you call “blecen_Conn(NO_CONN, NULL, 0);”, it will call to blecm_CreateConnectionCancel().

So you don’t have to call blecm_CreateConnectionCancel() separately in your application.

0 Likes