Force quit connection?

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

cross mob
legic_1490776
Level 5
Level 5
25 likes received 10 likes received First like received

I have a problem where my connection gets hung in a strange way (see forum post Connection drops after a while -- trying to figure out how to debug ).

As part of a possible work-around I implemented a callback to trigger on the idle connection timer.  This callback fires when the connection gets stuck - but I can't figure out how to do anything at that point to recover.  Is there any way to quit the current connection and return to advertising?  I tried turning advertisements back on, but until the connection drops it won't send them.  Is there any way to reset the stack somehow to cause it to recover from the broken connection state?

0 Likes
1 Solution
Anonymous
Not applicable

Hello idgirod,

This solution will work for both Central Mode and Peripheral Mode.

Thanks

JT

View solution in original post

0 Likes
3 Replies
asridharan
Employee
Employee
10 comments on KBA 5 comments on KBA First comment on KBA

Have you tried something like:

#include "blecm.h"

#include "error.h"

blecm_disconnect( BT_ERROR_CODE_CONNECTION_TERMINATED_BY_LOCAL_HOST);

0 Likes

This doesn’t seem to work — maybe this is only for use in central mode?

0 Likes
Anonymous
Not applicable

Hello idgirod,

This solution will work for both Central Mode and Peripheral Mode.

Thanks

JT

0 Likes