I have 2 DA14580AK EVB and loaded DSPS device & host application into 2 different EVB. I set the break point in gapm_adv_report_ind_handler of host, and display the values of param->report.adv_addr.addr & param->report.data in watch view. The Dialog host can display the Dialog device name and BD address correctly. If the Dialog host receives another brand BLE's advertisement message, only BD address can be received correctly but received device name is garbage. However, DSPS android app can display those device names correctly, please kindly advise.
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)
{
memset(gBdAddress, 0, sizeof(struct bd_addr));
memcpy(gBLEname, param->report.data, param->report.data_len);
memcpy(gBdAddress, param->report.adv_addr.addr, sizeof(struct bd_addr));
if(!memcmp(¶m->report.data[3], APP_DFLT_ADV_DATA, APP_DFLT_ADV_DATA_LEN))
{
//Save found bd_addr to global variable
memcpy(&connect_bdaddr,param-> eport.addr.addr,sizeof(struct bd_addr));
app_cancel_scanning();
}
return(ke_msg_consumed);
}
Hi jackiechau,
当你说“垃圾”时,你的意思是什么,当你得到广告指示时,十六进制价值是应该是的一个?也许您还看到了先前迹象的数据,因为您不会将您存储广告字符串存储的数组。
Thanks MT_dialog
Hi MT_dialog,
"garbage" means correct device name can't be got although relevant BdAddress can be received. However, DSPS android app can display those device names correctly. Thanks.
Hi jackiechau,
What about the hex values that you are getting when you get an advertising indication, can you please check them and not the ascii characters ? Can you please check the param->report.data parameter and not the array that you are copying the data ? Or perhaps due to optization you cant check the actual data, can you please try to print the data instead of checking them in the debugger ? althougn i was able to see valid data when an advertising indication come on my setup.
Thanks MT_dialog
Hi MT_dialog,
请找到附件。它是显示不正确的十六进制值的设备名称。我试图通过控制台打印Param-> Report.Data参数,结果是相同的。对话设备名称可以显示,我不认为它与优化问题有关,请诚挚建议。
Hi jackiechau,
似乎有点奇怪,只要我从屏幕截图看,AD标志在调试器0x02,0x01和0x06中正确显示了,1A是广告字符串报告的数据的长度,FF是制造商特定的数据。如果580过滤出下一个字节,它有点奇怪。您确定要在广告字符串中放置的值吗?请您使用只解析像BlueLoupe这样的广告字符串的应用程序。也许在您使用的应用中看到的是您所使用的应用程序是由手机缓存而不是实际广告字符串的设备名称。
Thanks MT_dialog
Hi MT_dialog,
Actually, the advertising strings are received via the air, they aren't transmitted by me. I just wondered why DSPS apk or my BLE monitor(PC app with USB BLE module) could receive those advertisements but it's not the case in my Dialog host.
此外,我还有另一个问题。在主机DSP项目中,睡眠模式是禁用。我在main_func的while循环中放了一个printf_string(“t”)。当程序由调试器运行时,打印几百个“T”,然后没有。我停止了调试器并再次运行,再打印一个“T”。这是怎么回事?我预计持续的“T”被印在印刷,请诚挚建议。
Hi jackiechau,
正如我在屏幕截图中提到的那样,我可以看到广告字符串的标志,主机(至少在我的侧面可以正确接收广告字符串,当我在广告字符串中放置名称我可以检查名称在额外的阵列变量中),现在考虑到您的其他设备能够检查每个用户的名称是因为这些设备可以缓存所连接的设备的名称或类似于该设备或设备可以从扫描响应数据字符串读取名称。为了确保您可以使用外设宣传,并通过中央捕获外设的广告,并检查您放置在设备的广告字符串中的名称。还有另一件事
就打印“t”尝试使用直接使用UART的函数,例如UART_WRITE(“T”,1,NULL);
Thanks MT_dialog
Hi MT_dialog,
我发现,当调用app_cancel_scanning()或app_disconnect()时,未打印“t”。调用app_scanning()或app_connect()后,打印连续的“t”。在运行App_cancel_scanning()或app_disconnect()时,程序计数器似乎停止,直到收到中断。它通过添加Systick计时器证明。请诚挚建议。另外,是否有可能为您的HK员工提供帮助我,谢谢?
Also, many developers requested help on I2C slave issue, will your side plan to take a look on this?
Hi Jackiechau,
邮件被发送到已注册的电子邮件地址。
Thanks MT_dialog
Hi MT_dialog,
因为有时外围设备断开连接并无法永久连接Central,我尝试在断开按钮后发出App_reset_App()。此时,虽然中心可以接收广告并连接到外围设备,但外围设备无法接收中心的发送数据。调用app_reset_app()后,是否有任何状态更改,或者我应该需要初始一些代码,以便中央可以再次连接它?
Also, it seems the BLE timer stopped after issuing app_reset_app(), I observed that the handler of app_timer_set wasn't triggered. Thanks.
Hi jackiechau,
您不必发送重置命令才能重新连接到设备,大多数可能是向外设发出连接请求的方式出现问题。您能否粘贴所使用的代码以便从中央连接?您正在开发哪些SDK,您正在使用SDK5或SDK3上的DSP作为示例?您是介于什么意思,外围设备无法接收居民的语气数据(通知/指示)?在GAPM_RESET后,您的设备应从APP_EASY_GAP_DEV_CONFIGURE()(在SDK5)函数中设置,该函数将设置设备的角色,操作等。
Thanks MT_dialog
I'm using DSPS on SDK5.
在中心侧,I通过UART输入字符以手动扫描,取消扫描,连接和断开外围设备。我刚刚使用了所有的API。
静态void UART_RX_CALLBALL(UINT8_T RES,UINT32_T READ_SIZE)
{
struct bd_addr testdeviceaddr;
开关(rx_read_pointer [0]){
case 's':
app_scanning();
break;
case 'x':
app_cancel_scanning();
break;
case 'c':
if(ke_state_get(task_app)== app_connectable){
printf_string(“connect \ r \ n”);
app_connect();
}
break;
case 'd':
if(ke_state_get(task_app)== app_connected){
app_disconnect();
printf_string(“disconnect \ r \ n”);
}
break;
案例'r':
printf_string("RESET stack\r\n");
app_reset_app();
break;
case 't':
printf_string(“set app_connectable \ r \ n”);
ke_state_set(task_app,app_connectable);
break;
default:
break;
}
#endif
//重新回调
uart_sps_read(rx_read_pointer, RX_CALLBACK_SIZE, &rx_state_ptr, &uart_rx_callback);
}
int gapc_disconnect_ind_handler(ke_msg_id_t const msgid,
struct gapc_disconnect_ind const *param,
ke_task_id_t const dest_id,
ke_task_id_t const src_id)
{
app_disconnect();
ke_state_set(task_app,app_connectable);
printf_string("BLE connection lost\r\n");
return(ke_msg_consumed);
}
At the peripheral side, debug message would be printed in gapc_connection_req_ind_handler and and gapc_disconnect_ind_handler such that I could know whether the connection of peripheral device was connected or not.
In the last post, what I would like to say was sometimes the peripheral device may disconnect because of remote disconnection. When central trys to connect the periheral device again, it can't connect it again. Then I tried to issue app_reset_app in periheral device. At this moment, although central could receive advertisemnet and connect to peripheral device, when central tried to send data by app_uart_push in connected mode, peripher device couldn't receive anything.
此外,在外围侧,我通过调用app_timer_set()来添加计时器以每1秒打印调试消息。但是,当发出APP_RESET_APP时,我观察到打印调试消息被停止。
Hi Jackiechau,
When you are connecting to the device (when using the app_connect() function) how do you allocate the gapm_start_connection_cmd message you are using the KE_MSG_ALLOC_DYN() or the KE_MSG_ALLOC() macro. For a proper connection the应使用ke_msg_alloc_dyn()。通过使用此缩小命令,不需要,外围设备应该能够重新连接。
Thanks MT_dialog
Hi MT_dialog,
I'm using KE_MSG_ALLOC() as provided by the original source codes of SDK5. Why KE_MSG_ALLOC() isn't the best solution?
If I use KE_MSG_ALLOC_DYN() marco, how to define the parameter "length"?
中央边由于超时而断开连接吗?
Have you tried to test the connection of DSPS central and peripheral overnight?
实际上,无论扫描,停止扫描,连接或断开连接,中心都会通过外部事件手动操作。谢谢。
Hi jackiechau,
在SDK5中的DSP主机中,APP_CONNECT() - (是SDK3函数)函数未使用,而是使用API函数app_easy_gap_start_connection_to_msg_create()的API函数app_easy_gap_start_connection_to_msg_create(),这反过来调用app_connect_start_msg_create(),稍后的函数是使用ke_msg_alloc_dyn分配gapm_start_connection_cmd消息的函数。参数长度应为(sizeof(struct gap_bdaddr))。关于为什么要使用ke_msg_alloc_dyn,在附带的参数中的每一个消息/结构都具有一个名为空数组,必须与ke_msg_alloc_dyn分配。在SDK3中,使用KE_MSG_ALLOC,并且撰写为什么我们之后重置堆栈,但这不是启动或重新启动连接的正确方法。是的,由于超时,有一个断开连接。我不知道QA是否在DSP上进行了过夜测试,所以我无法肯定地告诉你,但我想那些测试的那种测试是标准的,所以我想他们有。
Thanks MT_dialog
I checked SDK3 should be used because DSPS project is only available for SDK3.
Hi jackiechau,
DSP也在SDK 5中实现,请在参考设计中检查对话框串行端口服务。最新版本基于5.0.3 SDK版本。
Thanks MT_dialog