DA1469x\u Custom\u BLE\u服务示例中的属性权限混淆

了解更多常见问题教程

10个职位/0个新职位
最后一篇
普拉桑纳
离线
最后一次见到:3天5小时前
已加入:2020-09-29 11:56
DA1469x\u Custom\u BLE\u服务示例中的属性权限混淆

你好Dialog,

我正在测试示例“BLE_Central”和“DA1469x_Custom_BLE_Service”,以实现GATT客户机和服务器之间的一些通信。在custom service示例中,在peripheral_task.c中,有两个分别用一个和e个特征定义的服务。在这里,我为这两个服务的特性设置了一些随机权限。请查看下面所附的日志文件。

ÿÿð@BLE中央应用程序启动BLE中央应用程序启动@BLE中央应用程序启动@ble中央应用程序启动@ble中央应用程序启动@ vt_gap_connected:conn_idx = 0000 supple_evt_gattc_discover_svc:conn_idx = 0000 uuid = 0x1800 start_h = 0001 end_h = 0007 handle_evt_gattc_discover_svc:conn_idx = 0000UUID = 0x1801 start_h = 0008 end_h = 0008 handle_evt_gattc_discover_svc:conn_idx = 0000 UUID = 11111111-0000-0000-0000-111111111111 start_h = 0009 end_h = 000D handle_evt_gattc_discover_svc:conn_idx = 0000 UUID = 22222222-0000-0000-0000-222222222222 start_h = 000Eend_h = 0016 handle_evt_gattc_discover_completed:conn_idx = 0000 type = 0 status = 0 shower_t_gattc_discover_char:conn_idx = 0000 uuid = 0x2a00句柄= 0002 value_handle = 0003属性= 02(-----)supple_evt_gattc_discover_char:conn_idx = 0000 uuid = 0x2a01句柄= 0004 value_handle = 0005属性= 02(-----)supple_evt_gattc_discover_char:conn_idx = 0000 uuid = 0x2a04句柄= 0006 value_handle = 0007属性= 02(-----)hange_evt_gattc_discover_completed:conn_idx = 0000类型= 2 status = 0 shower_evt_gattc_read_completed:conn_idx = 0000把手= 0003 status = 0 43 75 75 73 74 6f 6d 20 42 4c 45 20 53 6f 6d 20 42 4c 45 20 53 65 72 76 69定制ble servi 63 65 ce handle_evt_gattc_discover_completed:conn_idx = 0000type = 2 status = 0 shower_evt_gattc_discover_char:conn_idx = 0000 uuid = 11111111-0000-0000-0000-00000000/0000-0000-000000000001句柄= 000a value_handle = 000b属性= 22(-R --- i--)supple_evt_gattc_discover_completed:conn_idx = 0000类型= 2状态= 0 handle_evt_gattc_discover_desc:conn_idx = 0000 UUID = 0x2901手柄= 000C handle_evt_gattc_discover_desc:conn_idx = 0000 UUID = 0x2902手柄= 000D handle_evt_gattc_discover_completed:conn_idx = 0000类型= 3个状态= 0 handle_evt_gattc_discover_char:conn_idx = 0000 UUID = 22222222-0000-0000-0000-000000000001 handle=000f value_handle=0010 properties=0a (-R-W----) handle_evt_gattc_discover_char: conn_idx=0000 uuid=22222222-0000-0000-0000-000000000002 handle=0012 value_handle=0013 properties=02 (-R------) handle_evt_gattc_discover_char: conn_idx=0000 uuid=22222222-0000-0000-0000-000000000003 handle=0015 value_handle=0016 properties=02 (-R------) handle_evt_gattc_discover_completed: conn_idx=0000 type=2 status=0 handle_evt_gattc_discover_desc: conn_idx=0000 uuid=0x2901 handle=0011 handle_evt_gattc_discover_completed: conn_idx=0000 type=3 status=0 handle_evt_gattc_discover_desc: conn_idx=0000 uuid=0x2901 handle=0014 handle_evt_gattc_discover_completed: conn_idx=0000 type=3 status=0 handle_evt_gap_disconnected: conn_idx=0000 address=06:06:06:01:01:01 reason=8 handle_evt_gap_connected: conn_idx=0000 handle_evt_gattc_discover_svc: conn_idx=0000 uuid=0x1800 start_h=0001 end_h=0007 handle_evt_gattc_discover_svc: conn_idx=0000 uuid=0x1801 start_h=0008 end_h=0008 handle_evt_gattc_discover_svc: conn_idx=0000 uuid=11111111-0000-0000-0000-111111111111 start_h=0009 end_h=000d handle_evt_gattc_discover_svc: conn_idx=0000 uuid=22222222-0000-0000-0000-222222222222 start_h=000e end_h=0016 handle_evt_gattc_discover_completed: conn_idx=0000 type=0 status=0 handle_evt_gattc_discover_char: conn_idx=0000 uuid=0x2a00 handle=0002 value_handle=0003 properties=02 (-R------) handle_evt_gattc_discover_char: conn_idx=0000 uuid=0x2a01 handle=0004 value_handle=0005 properties=02 (-R------) handle_evt_gattc_discover_char: conn_idx=0000 uuid=0x2a04 handle=0006 value_handle=0007 properties=02 (-R------) handle_evt_gattc_discover_completed: conn_idx=0000 type=2 status=0 handle_evt_gattc_read_completed: conn_idx=0000 handle=0003 status=0 43 75 73 74 6f 6d 20 42 4c 45 20 53 65 72 76 69 Custom BLE Servi 63 65 ce handle_evt_gattc_discover_completed: conn_idx=0000 type=2 status=0 handle_evt_gattc_discover_char: conn_idx=0000 uuid=11111111-0000-0000-0000-000000000001 handle=000a value_handle=000b properties=22 (-R---I--) handle_evt_gattc_discover_completed: conn_idx=0000 type=2 status=0 handle_evt_gattc_discover_desc: conn_idx=0000 uuid=0x2901 handle=000c handle_evt_gattc_discover_desc: conn_idx=0000 uuid=0x2902 handle=000d handle_evt_gattc_discover_completed: conn_idx=0000 type=3 status=0 handle_evt_gattc_discover_char: conn_idx=0000 uuid=22222222-0000-0000-0000-000000000001 handle=000f value_handle=0010 properties=0a (-R-W----) handle_evt_gattc_discover_char: conn_idx=0000 uuid=22222222-0000-0000-0000-000000000002 handle=0012 value_handle=0013 properties=02 (-R------) handle_evt_gattc_discover_char: conn_idx=0000 uuid=22222222-0000-0000-0000-000000000003 handle=0015 value_handle=0016 properties=02 (-R------) handle_evt_gattc_discover_completed: conn_idx=0000 type=2 status=0 handle_evt_gattc_discover_desc: conn_idx=0000 uuid=0x2901 handle=0011 handle_evt_gattc_discover_completed: conn_idx=0000 type=3 status=0

这些是我设置的愚蠢的特征权限。

const mcs \u characteristic \u config \u t custom \u service \u 1[]={/*初始化的特征属性*/特征声明(11111111-0000-0000-000000000001,特征属性值\u MAX \u BYTES,字符写入属性DIS,字符读取属性DIS,字符NOTIF指示EN,初始化特征,NULL,NULL,事件发送\u cb),};const mcs\u characteristic\u config\u t custom\u service\u 2[]={特征声明(2222222-0000-0000-000000000001,特征属性值\u MAX\u BYTES,特征写入属性EN,特征读取属性DIS,特征不存在,Hello World,NULL,设置变量值\u cb,NULL),特征声明(2222222-0000-0000-0000-000000000002,CHARACTERISTIC\u ATTR\u VALUE\u MAX\u BYTES,CHAR\u WRITE\u PROP\u DIS,CHAR\u READ\u PROP\u EN,CHAR\u NOTIF\u NONE,Hello Dialog,get\u var\u VALUE\u cb,NULL,NULL),CHARACTERISTIC\u声明(22222-0000-0000-0000-000000000003,0,CHAR\u WRITE\u PROP\u DIS,CHAR\u READ\u PROP\u DIS,CHAR\u NOTIF\u NONE,NULL,NULL,NULL),};

请将权限与附加的输出日志进行比较。您可以看到服务1的唯一特征的属性被打印为(-R---I--),即使我禁用了Read属性。

至于第二个服务特征,它们分别被打印为(-R-W----)、(-R------)和(-R------),这三个特征与我实际授予的权限形成对比。

只有第二个服务的第二个特征根据我给出的正确打印。

我请求您调查为什么会发生这种情况,并建议我如何避免这种情况。这对我的应用程序非常重要,因为我必须在GATT客户机和服务器之间交换数据。

提前谢谢。

当做,

普拉桑纳

设备:
PM\U对话框
离线
最后一次见到:2天11小时前
工作人员
已加入:2018-02-08 11:03
你好,普拉桑纳,

你好,普拉桑纳,

让我查一下,我会给你回电的。

谢谢,下午好

普拉桑纳
离线
最后一次见到:3天5小时前
已加入:2020-09-29 11:56
你好pm_dialog,

你好pm_dialog,

关于这个问题有什么最新消息吗。我用两个特征检查了这个问题,一个读禁用,另一个写禁用。写属性工作正常,我发现读取权限有问题。你找到同样的了吗?

2而且,我有时会得到一个没有定义的状态。例如,当我试图读取一个特征值时,得到的输出是“handle\u evt\u gattc\u read\u completed:conn\u idx=0000 handle=000a status=67”。在这里您可以看到状态为67。既然在ble\u att.h文件的enum att\u error\t中没有为值67声明错误值,那么这种行为意味着什么。

当做,

普拉桑纳

PM\U对话框
离线
最后一次见到:2天11小时前
工作人员
已加入:2018-02-08 11:03
你好,普拉桑纳,

你好,普拉桑纳,

因此,如果我理解正确的话,问题只存在于customservice1中,其中错误的属性似乎没有正确出现。

请尝试连接通用的BLE移动应用程序并检查权限,好吗?

另外,你能分享一下除了特征数据库之外,你在这个例子中做了哪些修改吗?您是在使用dialog提供的示例还是做了任何更改?

谢谢,下午好

普拉桑纳
离线
最后一次见到:3天5小时前
已加入:2020-09-29 11:56
你好pm_dialog,

你好pm_dialog,

我已经检查了nrf连接应用程序以及。即使我禁用了read特性,我也可以在应用程序中看到read属性。Read属性似乎有问题。即使它的读取被禁用或启用,我们也可以读取。

除了更改权限之外,我没有在自定义服务示例中修改代码。

PM\U对话框
离线
最后一次见到:2天11小时前
工作人员
已加入:2018-02-08 11:03
普拉桑纳,

普拉桑纳,

我们正在编写这个教程,希望在本周末发布一个更新版本。我会让你知道一旦新版本可供下载。

谢谢,下午好

普拉桑纳
离线
最后一次见到:3天5小时前
已加入:2020-09-29 11:56
你好,PM\U对话,

你好,PM\U对话,

谢谢你的更新。

当做,

普拉桑纳

普拉桑纳
离线
最后一次见到:3天5小时前
已加入:2020-09-29 11:56
你好Dialog,

你好Dialog,

新版本在什么时候有更新吗?

当做,

普拉桑纳

安娜玛丽
离线
最后一次见到:3天12小时前
已加入:2021-01-27 11:14
很高兴看到你的问题

很高兴看到你的问题,因为我认为我有同样的问题,我也感到困惑,并需要在这个问题上的光。我需要帮助。

MyAARPMedicare登录

PM\U对话框
离线
最后一次见到:2天11小时前
工作人员
已加入:2018-02-08 11:03
嗨,大家好,

嗨,大家好,

我将再次检查内部状态,并很快返回给您。

谢谢,下午好