Hi,all.
在DSPS项目“DA14580_DSPS_3.150.2”中,主机是发送扫描CMD但不扫描任何终点设备。
But in phone app can scan perpheral device.
why ?
please help me.
the code is not change but add some tips by uart.the place is follow:
空白app_scanning(空白)
{
ke_state_set(TASK_APP, APP_CONNECTABLE);
// create a kernel message to start the scanning
struct gapm_start_scan_cmd * msg =(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->op.code = GAPM_SCAN_PASSIVE;
msg->op.addr_src = GAPM_PUBLIC_ADDR;
msg-> filter_duplic = scan_filt_duplic_en;
msg-> interval = app_scan_interval;
msg->window = APP_SCAN_WINDOW;
UART_WRITE(“\ r \ ns7 \ r \ n”,6,null);//////添加我
//发送消息
ke_msg_send(msg);
}
in gapm_cmp_evt_handler function add tips:
案例GAPM_SCAN_PASSIVE:
案例Gapm_scan_active:
{
if (param->status == GAP_ERR_CANCELED)
{
uart_write("\r\nS6\r\n", 6, NULL); //add by me
app_connect();
}
else
{
UART_WRITE(“\ r \ ns7 \ r \ n”,6,null);//添加我
app_scanning();
}
}
break;
in app_set_dev_config_complete_func function:
void app_set_dev_config_complete_func(void)
{
//我们现在处于初始化状态
ke_state_set(TASK_APP, APP_DB_INIT);
// Add the first required service in the database
if(app_db_init()))
{
// When the data base is already made start advertising
UART_WRITE(“\ r \ ns1 \ r \ n”,6,null);//添加我
app_scanning();
}
}
In gapm_adv_report_ind_handler function :
int gapm_adv_report_ind_handler(ke_msg_id_t const msgid,
const struct gapm_adv_report_ind * param,
ke_task_id_t const dest_id,
ke_task_id_t const src_id)
{
/ *
if(!memcmp(¶m->report.data[3], APP_DFLT_ADV_DATA, APP_DFLT_ADV_DATA_LEN))
{
//将找到的bd_addr保存到全局变量
memcpy(&connect_bdaddr, param->report.adv_addr.addr, sizeof(struct bd_addr));
uart_write("\r\nS5\r\n", 6, NULL); //add by me
app_cancel_scanning();
}
else
*/
uart_write("\r\nS6\r\n", 6, NULL); //add by me
return (KE_MSG_CONSUMED);
}
I close the sleep mode in da14580_config.h.
not change any thing.
the result is :
S1
S7
S7
S7
S7
每个S7尖端都是大约10秒的间隙。
我使用了“da14580_dsps_3.150.2”,sps_device和sps_host。
but not go in to gapm_adv_report_ind_handler function.
手机应用程序可以扫描14580's perpheral device. .
why not go into gapm_adv_report_ind_handler function?
wait for your help.
Hi,
Did you change anything on the peripheral side? How does the code work for you without modification on either side?
Hi,
because there is no 32.768K,so
the peripheral change only this place:
#define cfg_lp_clk 0x00到0xaa;
and the central also change this place:
#define cfg_lp_clk 0x00到0xaa;
there is no change
no other place change any more.
袁汉武
Hi,all.
I used "DA14580_DSPS_3.150.2" sps_host.
when GAPM_START_SCAN_CMD send,
but not go in to gapm_adv_report_ind_handler function.
手机应用程序可以扫描14580's perpheral device. .
why ?
how to used sps_host project to get perpheral device advertising data?
in somewhere the get advertising data store?
谢谢。
或者需要等待很长时间扫描广告数据,
how to faster scan out the advertising data ?
谢谢。
我不确定如何帮助你。我要求一位当地代表直接联系到您。
我有类似的问题。什么时候I use PASSIVE_SCAN there isn't any adv data. Would you please help me ?
我的代码中有一个错误,所以问题得到了解决。谢谢。
嗨,夏季,2014年,
你的问题已经解决了。
So,I want you for help me.
Used host role in DA14580_DSPS_3.150.2,
how to make scan result faster and more effective?
谢谢 。
I didn't use DA14580_DSPS_3.150.2, instead I use DA14580_SDK_3.0.4.0\host_apps\windows\proximity\monitor. Of course, I modified the project on PC to work on STM32 as one external host and DA14580 running the ble stack, which is DA14580_SDK_3.0.4.0\dk_apps\keil_projects\proximity\monitor_fe_usb. Due to some commercial reasons, I can not provide the project to you, but I think you can look into these projects to get inspired, and in fact, it's quite easy.
Hi,MHv_dialog
I test many times used host to scan advertising data, just one time scan out the advertising data in gapm_adv_report_ind_handler function.
So I want to get the scan result faster and more effective.
How to do then?
谢谢。
Hi,MHv_dialog,
我的意思是,主机设备扫描第一次或第二次,然后扫描百周的广告数据。
Yes ,with a short number scan time get the scan result.
怎么办?
谢谢。
Hi,MHv_dialog,
我只是在Keil U4中调试。
当我这样的时候:
/// Advertising minimum interval
#define app_adv_int_min 0x30.
/// Advertising maximum interval
#define app_adv_int_max 0x30.
I click dubug --run-(have scan out perpheral advertising data)--dubug.
当我这样的时候:
/// Advertising minimum interval
#define APP_ADV_INT_MIN 0xA0
/// Advertising maximum interval
#define app_adv_int_max 0xa0.
I click dubug --run---dubug.
I inset tip tell me that many time pass ,but also cannot scan out perpheral advertising data.
怀用?
For low comsumption ,So the Advertising interval should set how long to be is the best?
谢谢。
Hi,MHv_dialog,
我已经得到了。
Now the result is:
peripheral:
0.5 second advertsing gap.
central:
Host scan out every 7.5 second,but the consumption is 3.6MA average.
The speed of scan is not very fast,but the consumption is already high.
wyh and how to make scan result faster and more effective?
或者如何获得最佳平衡。
how do you solve this problem? I get the same issue now, thanks.
"not go in to gapm_adv_report_ind_handler"