scan no adv report callback sometimes

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

cross mob
user_2139251
Level 3
Level 3

Hi All,

    I face a issue about 20736 ble scan, my SDK is Wiced smart 2.2.3, I develop application based on hell0_client app, the peripheral ble slave devices quantity is about 400 units, 20736  tries to connect scanning callback devices, sometimes it will fail and restart ble scan again, however the callback of hello_client_advertisement_report doesn't report any advertising device anymore, I use API of blecen_GetScan to check the state, the result shows that it is low scan mode, does anyone face such this issue? thanks a lot.

0 Likes
1 Solution

For the record, disconnection reason "3e" is "Connection Failed to be Established". My guess is that that your slave is not responding in due time before the event is aborted. There could be a myriad of reasons to this, especially in your case which you have like 400 units transmitting simultaneously! Anyhow, your client would only be able to support up to 8 slaves. Can you try this scenario? And if possible, try to capture a log file on the slave side, this might shed some light to the issue.

View solution in original post

0 Likes
11 Replies
BoonT_56
Employee
Employee
500 likes received 250 likes received 100 likes received

What is the max number of slaves did you configure for your client? For the hello_client, once the link is down, it will exert

bleprofile_regAppEvtHandler(BLECM_APP_EVT_LINK_DOWN, hello_client_connection_down);

Then if we look at hello_client_connection_down, then we see the below:

if (hello_client.num_slaves < HELLO_CLIENT_MAX_SLAVES)

    {

        blecen_Scan(LOW_SCAN);

    }

}

This is consistent with what you see if you are using hello_client as a reference.

Are you doing this re-connection in the presence of 400 slaves? Can you take a step back and try only say 4 slaves?

Hi Btta,

    I configure max slave number as 4, if connected slave number less than 4, I will continue to low scan, when adv report finds a new slave device, I try to connect it, if connection fail, I will restart low scan, when peripheral slave device less, for example, just only 4, this issue doesn't occur.

0 Likes

OK, what you have described is the expected behaviour. Then what is the issue here?

0 Likes

sometimes 20736 just connected two or three slave devices successfully, at the same time, low scan was ongoing, however, no any adv report was callback forever although there were many slave devices nearby

0 Likes

Did you change any of the default blecen parameters? For example the below:

    //blecen_cen_cfg.high_scan_interval       = 96;       // slots

    //blecen_cen_cfg.low_scan_interval        = 2048;     // slots

    //blecen_cen_cfg.high_scan_window         = 48;       // slots

    //blecen_cen_cfg.low_scan_window          = 18;       // slots

    //blecen_cen_cfg.high_scan_duration       = 30;       // seconds

    //blecen_cen_cfg.low_scan_duration        = 300;      // seconds 

What do you experience if you use the actual hello_client app?

0 Likes

I change //blecen_cen_cfg.low_scan_interval        = 1024;     // slots

I expect hello_client app can connect 4 slave devices, if no reaching this number, it can start low scan, if scan timeout, I will trigger low scan again with the timeout callback; if adv report finds new slave device, try to connect it; if connections number reaches 4, stop ble scan.

0 Likes
lock attach
Attachments are accessible only for community members.

sometimes connection timeout event occurs or  disconnect reason is 0x3e, my hello client app tries to scan new device, there isn't any device report, I attach two log here, when the log  occurs "_getBondedInfoIdx, Out of memory" or "Delete Bonded Info, out of memory",

and my app begins new scan, there isn't any adv report any more.

0 Likes

For the record, disconnection reason "3e" is "Connection Failed to be Established". My guess is that that your slave is not responding in due time before the event is aborted. There could be a myriad of reasons to this, especially in your case which you have like 400 units transmitting simultaneously! Anyhow, your client would only be able to support up to 8 slaves. Can you try this scenario? And if possible, try to capture a log file on the slave side, this might shed some light to the issue.

0 Likes
BoonT_56
Employee
Employee
500 likes received 250 likes received 100 likes received

On the advertisement report, check again on the handler in your _create app:

void app_advertisement_report(HCIULP_ADV_PACKET_REPORT_WDATA *evt)

void app_create(void)

{

...

blecm_RegleAdvReportCb((BLECM_FUNC_WITH_PARAM) app_advertisement_report);

...

}

0 Likes

Hi Btta,

     The register callback is no problem!

0 Likes

Hi Btta,

    Now my test slave device number is only about 80 ~~90, when the link is down, the lower layer should be prepare for next time scanning, it shouldn't occur no adv report return.

0 Likes