我检查了两种情况。With DEF_SEC_REQ_ON_CONNECT authorization required but I can skip it and read and write data through the device. With DEF_SEC_REQ_NEVER I can do everything without any security requests. Moreover, I found the same problem on the forums with DA14580 devices (link attached).https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bl...–-软件/仅允许配对请求pin码
需求方参考应用程序不支持curity, so if you want to use this application you need to implement it by your own. As I have already mentioned the DSPS demo doesn't use the security feature, so there's no pairing between the devices, that’s why you are able to read/write into the characteristics without pairing. You can enable security by setting the CFG_APP_SECURITY definition in the da1458x_config_basic.h and also change the member security_request_scenario to DEF_SEC_REQ_ON_CONNECT in order for your device to request security upon connection. That will bond your device according to the parameters located in the user_config.h file in the user_security_information. Please, check theble_app_securityexample of the SDK in order to understand how the security features are implemented. Also, I strongly recommend you to follow the steps of the教程5:配对、结合与安全“在DSP中启用安全性。您可以在“教程”部分的“文档”选项卡中或通过以下链接找到教程
所有这些步骤我都是从your last post before starting writing at the forum. The problem is that after enabling all security features (according to the training 5 manual), and recommendations from software portion guide I have the next situation: 1. After trying to connect the device to phone, the device sends a pairing request to the phone app 2我看到一个带有pin码输入文本框的系统对话框窗口 3. I can skip this window and reading and writing services still be able from the phone
So I need a help in changing the user_app_callbacks structure or default_app_on_connection function because It enables all services, before getting results of code exchange procedure.
Thanks, but the program enters in case "GAPC_PAIRING_FAILED:" in "gapc_bond_ind_handler" only if I enter the wrong passkey. If I escape this window on phone screen or ignore it the program will still work.
Hi Andrey_Kiselnikov,
请您澄清一下您使用的是哪种SDK?请注意,安全教程是基于sdk6.0.4的。强烈建议使用最新版本的SDK6.0.8。
谢谢,总理对话
我用的是SDKin the package of this project. In the release note attached to this project wrote that it is based on SDK 6.0.6.
你好,有什么最新消息吗on this issue?
Hi Andrey_Kiselnikov,
您必须更改每个特征的权限才能获得授权。如果将特征设置为AUTH,这意味着您将向特征添加安全性,并且需要授权。请您澄清一下您使用的是哪种安全方案?请将user_default_hnd_conf结构的.security_request_场景检查到user_config.h头文件中。使用DEF_SEC_REQ_NEVER选项时,在读/写特征时需要授权;使用DEF_SEC_REQ_ON_CONNECT时,连接期间需要授权
谢谢,总理对话
我检查了两种情况。With DEF_SEC_REQ_ON_CONNECT authorization required but I can skip it and read and write data through the device. With DEF_SEC_REQ_NEVER I can do everything without any security requests. Moreover, I found the same problem on the forums with DA14580 devices (link attached).https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bl...–-软件/仅允许配对请求pin码
很奇怪,读写操作的安全请求是通过选择参数“DEF_SEC_REQ_NEVER”来启用的。
你好,有什么最新消息吗on this issue?
Hi Andrey_Kiselnikov,
你能从SDK6的默认安全示例下载固件吗?你也面临同样的问题吗?我已经测试过了,我不能复制你的问题。另外,请您澄清一下,您是开发自己的应用程序,还是试图修改默认的bleu app_安全示例?DEF_SEC_REQ_从不涉及安全场景,它并不意味着在请求读写操作时通过选择参数启用安全性。请注意,每个特性都有其自身的安全性。请检查您是否正在使用app_set_prf_srv_perm(TASK_ID_CUSTS1,app_CUSTS1_SEC_REQ);命令。此命令启用所有特征的安全性,并覆盖您赋予它们的权限数据库。所以,如果您正在使用它,您将能够访问数据库的所有特征,而无需任何安全请求。您过去发布的线程是针对DA14680芯片而不是针对DA14580的,所以这对您没有帮助。
谢谢,总理对话
I work with DSPS V6.150.2 reference project (https://support.dialog semiconductor.com/resource/da14585 dialog serial-。。。),而不是ble_app_安全示例。所以,我需要在这个参考项目中启用安全性。问题是,这个参考设计提供了电话配对请求的所有服务,但我启用了所有的安全设置。
Hi Andrey_Kiselnikov,
需求方参考应用程序不支持curity, so if you want to use this application you need to implement it by your own. As I have already mentioned the DSPS demo doesn't use the security feature, so there's no pairing between the devices, that’s why you are able to read/write into the characteristics without pairing. You can enable security by setting the CFG_APP_SECURITY definition in the da1458x_config_basic.h and also change the member security_request_scenario to DEF_SEC_REQ_ON_CONNECT in order for your device to request security upon connection. That will bond your device according to the parameters located in the user_config.h file in the user_security_information. Please, check theble_app_securityexample of the SDK in order to understand how the security features are implemented. Also, I strongly recommend you to follow the steps of the教程5:配对、结合与安全“在DSP中启用安全性。您可以在“教程”部分的“文档”选项卡中或通过以下链接找到教程
https://support.dialog-semiconductor.com/system/files/restricted/Training_05_ble_security_example_v1.1.pdf
谢谢,总理对话
所有这些步骤我都是从your last post before starting writing at the forum. The problem is that after enabling all security features (according to the training 5 manual), and recommendations from software portion guide I have the next situation:
1. After trying to connect the device to phone, the device sends a pairing request to the phone app
2我看到一个带有pin码输入文本框的系统对话框窗口
3. I can skip this window and reading and writing services still be able from the phone
So I need a help in changing the user_app_callbacks structure or default_app_on_connection function because It enables all services, before getting results of code exchange procedure.
Hi Andrey_Kiselnikov,
请从SDK的bl_app_security示例检查user_app_init()函数。如果定义了BLE_APP_SEC,则将执行APP_set_prf_srv_perm(任务_ID_CUSTS1,APP_CUSTS1_SEC_REQ)。根据此服务配置文件的访问权限,设置CUSTU权限。请将APP_CUSTS1_SEC_REQ更改为SRV_PERM_AUTH,好吗?似乎从配置文件数据库禁用了安全性
谢谢,总理对话
此函数-app\u set\u prf_srv_perm() definded in "dsps-v61502" project, but never executed, where should I add it to execute?
你好,有什么最新消息吗on this issue?
嗨,有人吗?
Hi Andrey_Kiselnikov,
3. I can skip this window and reading and writing services still be able from the phone
如果拒绝配对,则应调用gapc\u bond\u ind\u handler(),此函数将断开电话连接。
static const struct ke_msg_handler app_sec_process_handlers[] =
{
.......
{GAPC_BOND_IND, (ke_msg_func_t)gapc_bond_ind_handler},
Thanks, but the program enters in case "GAPC_PAIRING_FAILED:" in "gapc_bond_ind_handler" only if I enter the wrong passkey. If I escape this window on phone screen or ignore it the program will still work.
Hi Andrey,
你可以在use-config.h中测试不同的IO功能类型。我认为你应该禁用手机上的用户退出配对窗口。
Could you use light bule to test your firmware?
/************************************************************
*Device IO Capability (@see gap_io_cap)
*
*- GAP_IO_CAP_DISPLAY_ONLY Display Only
*-GAP_IO_CAP峎显示峎否显示YES NO
*-仅限于键盘
*- GAP_IO_CAP_NO_INPUT_NO_OUTPUT No Input No Output
*-GAP_IO_CAP_KB_显示键盘显示
*
*Select only one option.
************************************************************
*/
#define USER_CFG_FEAT_IO_CAP GAP_IO_CAP_NO_INPUT_NO_OUTPUT //GAP_IO_CAP_DISPLAY_YES_NO
Tested them, it is still able connecting without confirming the passkey.
我找到了解决办法replacing a sending a features message function in security task state machine after PAIRING_SUCCEED case.
Hi Andrey_Kiselnikov,
Glad that your problem has been fixed. Thanks for your indication.
谢谢,总理对话
HI Andrey_Kiselnikov
I want add Pair Function on DSPS too,
你能给我你的源代码参考吗