We tested two senarios below:
A: test with connection manager + (SDK)monitor_fe_usb
B: test with the scan code developped based on smarttag ref design codes
both A and B run with dialog BLE USB dongle seperately to scan some BLE node which keep always advertising...
test result:
with A: by clicking "scan" button of connection manager, each time the log window can quickly(say within ~1 second printing on screen) report/print advertise data by the BLE advertising node
with B: we set breakpoint at first line within gapm_adv_report_ind_handler();
then click the run button in Keil.
each time click "run", it just take 1 seconds to 10 seconds(it just differs for each "run" to get the
advertise data scanned and stopped at the break point.)
in our application:
- we have below config for the scan mode configurations:
空白app_scanning(空白)
{
// create a kernel message to start the scanning
struct gapm_start_scan_cmd *味精= (struct gapm_start_scan_cmd *)KE_MSG_ALLOC(GAPM_START_SCAN_CMD, TASK_GAPM, TASK_APP, gapm_start_scan_cmd);
// Maximal peer connection
msg->mode = GAP_GEN_DISCOVERY;
// msg->mode = GAP_OBSERVER_MODE;
msg->op.code = GAPM_SCAN_ACTIVE;
msg->op.addr_src = GAPM_PUBLIC_ADDR;
msg->filter_duplic = SCAN_FILT_DUPLIC_EN;
msg->interval = 10; //APP_SCAN_INTERVAL;
msg->window = 5; //APP_SCAN_WINDOW;
// Send the message
ke_msg_send(msg);
}
void app_configuration_func(ke_task_id_t const task_id, struct gapm_set_dev_config_cmd *cmd)
{
// Operation select
cmd->operation = GAPM_SET_DEV_CONFIG;
// Device Role
cmd->role = GAP_CENTRAL_MST;
//Defined maximum transmission unit
cmd->max_mtu = 160; //APP_CFG_MAX_MTU
}
- in gapm_cmp_evt_handler(), we have below lines to make it keep scanning.
case GAPM_SCAN_PASSIVE:
case GAPM_SCAN_ACTIVE:
{
app_scanning();
}
We do not know what is about the connection manager "boot as Central" procedure, but the test result is so different ( the connection manager scan the node quickly...but our codes scan the node so slow...), pls suggest what is the major issue with it and how we should fix it.
Thank you!

Hello Alex, i have assined this to our local team in China to follow up with you. Best regards, JE_DIalog
Not yet fix it...
We tested below further:
Connection Manager + CM firmware Scan get advertise data quickly ( within 1~2s each scan);
Host app + Monitor_fe_usb Scan get advertise data slow ( from 1s~10s each scan )
SPS_Host Scan get advertise data slow ( from 1s~10s each scan ).
(in the tests, we set the advertise node adv_interval to 20ms and 100ms seperately, but make no difference with the test results)
So it looks for SDK or reference design example software(Monitor, SPS), the scan is slow. for CM, it's quick.
We'd need quick scan in our application, so please help suggest what we should do.
Thank you!
It's one week past...we do would like get some help here.
in other words, we need a guidance on how to SCAN the peer broadcasting ADV_DATA within short time(say 500ms?)...or is it feasible or not?
You could try to change your scan window/interval.
The scan window is how long time it is actually scanning, while scan interval is how long time it is waiting between each start of a scan window, i.e. scan interval minus scan window is how long time to sleep between each scan. If you set scan window equal to scan interval, you are scanning with the lowest possible probability of missing advertisement packets. Of course, this consumes more current.
A requirement is that scan window <= scan interval.
Try to set your scan window to something like 50 instead of 5.
Also, the time for discovery will also depend on your advertisement interval on the peripheral. A lower advertisement interval means lower discovery times but uses more current from your battery on the peripheral.
Thank you Joacimwe...it's fixed after I set interval to 1362 and window to 1320. Pls close this ticket.
We did more tests...below parameters set in the test:
Advertise side:
-: adv_interval = 0x20; // we do not change the value 0x20 after this initialization ; we also tried 0x40, 0x100, etc.
-: cmd->op.code = GAPM_ADV_UNDIRECT;
cmd->op.addr_src = GAPM_PUBLIC_ADDR;
cmd->intv_max = adv_interval;
cmd->intv_min = adv_interval;
cmd->channel_map = APP_ADV_CHMAP; //0x07;
cmd->info.host.mode = GAP_GEN_DISCOVERABLE;
Scanning side:
-: we tried different window/interval settings:
// msg->interval = 10; //APP_SCAN_INTERVAL;
// msg->window = 10; //APP_SCAN_WINDOW;
// msg->interval = 1336; //APP_SCAN_INTERVAL;
// msg->window = 1320; //APP_SCAN_WINDOW;
msg->interval = 100; //APP_SCAN_INTERVAL;
msg->window = 100; //APP_SCAN_WINDOW;
-: in gapm_adv_report_ind_handler(), we will cancel scanning; in gapm_cmp_evt_handler(), we restart scanning;
in most test cases (say 8 out 10 tests, we change adv data each time, so to read the scan data update ), the scan can get the adv within 1 second, but it will still need 2 seconds or more time to successfully scan the adv data.
We need each peripheral adv data update to be scanned by central within 1 second ( 500ms will be better ), pls kindly suggest any other approaches we can try to get improved? thank you.
I would appreciate more guidance to improve...thanks!
Please help...thanks!
the problem still pending...Just need factory guidance/advise, pls kindly support. Thanks!
Hello Alex, I will arrange for someone local to contact.. BR JE_Dialog