嗨对话框,
我的客户想要使用通用访问(0x1800)的设备名称(0x2A00)来修改设备名称。
我在user_config中修改了user_gapm_conf.h如下......
。att_cfg = GAPM_MASK_ATT_SVC_CHG_EN | GAPM_MASK_ATT_NAME_PERM,
I also add some debug log in "default_app_on_set_dev_info" function but it seems not working.
有没有错?
My device info. DA14585, SDK:6.0.4
Thanks.
Device:

嗨斯坦利_yeh,
Well there seems to be a problem in the callback function gapc_set_dev_info_req_ind_handler() the task that the confirmation is send should be TASK_GAPC and not TASK_GAPM, also the callback doesn't actually change the devices name, so as soon as you get the callback you should change the devices name in the application callback. I am checking with the SDK team on this, i will let you know as soon as i have some feedback.
谢谢mt_dialog.
Thank you so much!
Hi MT_dialog,
我试图在app_entry_point_handler和gapc_set_dev_info_req_ind_handler函数中打印一些消息。
但是,似乎DA14585没有收到任何事件。
我可以自己解决这个问题吗?这个问题是否必须更新system_library.lib,即我无法修复它?
Thanks.
嗨斯坦利_yeh,
The current implementation allows you to have a callback notifying you when someone writes at that specific characteristic, but there is no actual implementation in changing the name in the database, and this is what the SDK team is investigating. So if you are interested in just getting the callback when someone writes at that specific characteristic all you have to do is make the below changes:
在上面的更改之后,您应该看到默认_happ_on_set_dev_info()要进行回调,但是再次占中央写在该特性的指示,这不会在数据库中更改名称。
谢谢mt_dialog.
Hi MT_Dialog,
非常感谢你。我现在可以收到这个活动。
对不起,我无法理解以下句子的含义是什么:
1.“这不会更改数据库中的名称。”
如果数据库中的名称无法更改,您能否告诉我风险,会发生什么?
你的意思是,设备名称是SDK中的定义(#define user_device_name“da14585”),因此没有实际实现更改它?
实际上,我已经实现了一个可以将设备名称存储到外部闪存中的函数。所以你说的句子对我的情况没有影响,对吗?
2. "to enable the write with no security to the specific characteristic."
My customer said the write characteristic must be with security. I can't understand why the GAPM_MASK_ATT_NAME_PERM doesn't work?
非常感谢。
嗨斯坦利_yeh,
1)关于将发生什么,正如SDK的情况下,目前您在设备上写的任何内容时,SDK都不会将您提供的名称存储在设备上只会将值发送到设备,您将能够得到它,但是读取IT后,设备的名称AGAN不会更改,设备将像以前一样报告相同的名称。因此,在SDK中是没有实际实现来改变它。我不知道你的意思是说你已经实现了一个在外部闪存中存储了设备名称的函数。但是为了能够通过该特征来改变设备的名称,您必须将更改应用于SDK本身,显然您将必须为user_device_name分配指针而不是固定名称,指针将显示为将用于存储实际设备名称的数组,并在通过写入该特性时更改名称时,您必须将数据从写入复制到该数组。
2) Each characteristic has some security features, if enabled. That means that if you have assigned the value of 0x03 (GAPM_MASK_ATT_NAME_PERM) to the device's name characteristic, that means that in order to be able to write at that characteristic the device demands the link to be secured with authentication. So if the link has no authentication, that means that the device wont allow you to write at that specific characteristic since you dont comply to the requirements that device has set. On the other hand if you apply the value of 0x01, that means that you enable the writting of the characteristic but with no additional security, meaning that whoever connects to the device is able to write the characteristic.
谢谢mt_dialog.
Hi MT_dialog,
I am really grateful for your detail information.
对于第一个问题,我可以自己保存设备名称。那没问题。
对于第二个问题,我仍需要安全功能,请告诉我是否有任何新的SDK版本。
非常感谢。
嗨斯坦利_yeh,
最新版本的SDK是6.0.6,并且有一个项目实现安全性(BLE_APP_SECURY),我不完全得到什么问题。如果应用值Gapm_mask_att_svc_chg_en | 0x03然后为了写入特性需要安全性,如果未启动配对,则无法写入特性。如果您不希望对该特性的保护,那么GAPM_MASK_ATT_SVC_CHG_EN | 0x01对于.ATT_CFG将允许您在没有安全性的情况下写入特性。
谢谢mt_dialog.
Hi MT_Dialog,
我现在正在使用SDK 6.0.6,我还设置了“.att_cfg =(gapm_mask_att_svc_chg_chg_chg_chg_chg_chg_chg_chg_chg_chg_chg_chg_chg_chg_chg_chg_chg_ch_chg_chg_chg_chg_ch_ch_ce)”。
第一次我写一个字符串到特征,应用程序显示他们绑定。
After bonding, I still cannot set the device name. The app shows "Error 0x5: GATT INSUF AUTHENTICATION"
我应该在“GAPC_SET_DEV_INFO_REQ_IND_HAND_HAND_HAND_HAND_HAND_HAND_HANDLER”功能中将来自TASK_GAPM的参数修改为TASK_GAPC?
struct gapc_set_dev_info_cfm* cfm = KE_MSG_ALLOC(GAPC_SET_DEV_INFO_CFM,
task_gapc,/ * task_gapm,* /
task_app,
gapc_set_dev_info_cfm);
你能给我一些建议吗?
多谢。
嗨斯坦利_yeh,
As stated in my previous post the SDK as is doesn't implement changing the device's name but it will trigger you an indication in application level, so i suppose that you have applied a custom modification, also you will have to change from TASK_GAPM to TASK_GAPC in order to send back a verification to the peer device that you have accepted or not the change. Regarding the GATT_INSUF_AUTHENTICATION this is what you should get the first time you try to set the name and the central initiates bonding (in the case of the ble_app_security), after bonding is done the callback (default_app_on_set_dev_info) will occur and you will have to handle the reception of the name in the application and decide either to accept or reject the new name and send back the GAPC_SET_DEV_INFO_CFM with the appropriate status, in order to properly send back the confirmation you will have to change from TASK_GAPM to TASK_GAPC.
谢谢mt_dialog.