完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
小Qhhui 发表于 2019-10-17 12:18 你好,我就按照这篇博客改的,但是到了最后的 “据说主机对开启notify的操作是基于16bitUUID的,所以要这样改: 关于ATTRTBL_CHAR4_CCC_IDX的定义实际是属性表的特征值char4的config项的偏移位置,我的代码属性表中这项位置为12, 所以定义为 #define ATTRTBL_CHAR4_CCC_IDX 12//Ccc ADD” 这句不知道该加哪里了。 |
|
|
|
|
|
|
|
Sandyjia 发表于 2019-10-17 12:36 static gattAttribute_t simpleProfileAttrTbl[SERVAPP_NUM_ATTR_SUPPORTED] =[ // Simple Profile Service [ [ ATT_BT_UUID_SIZE, primaryServiceUUID ], /* type */ GATT_PERMIT_READ, /* permissions */ 0, /* handle */ (uint8 *)&simpleProfileService /* pValue */ ], // Characteristic 1 Declaration [ [ ATT_BT_UUID_SIZE, characterUUID ], GATT_PERMIT_READ, 0, &simpleProfileChar1Props ], // Characteristic Value 1 [ [ ATT_BT_UUID_SIZE, simpleProfilechar1UUID ], GATT_PERMIT_READ | GATT_PERMIT_WRITE, 0, &simpleProfileChar1 ], // Characteristic 1 User Description [ [ ATT_BT_UUID_SIZE, charUserDescUUID ], GATT_PERMIT_READ, 0, simpleProfileChar1UserDesp ], // Characteristic 2 Declaration [ [ ATT_BT_UUID_SIZE, characterUUID ], GATT_PERMIT_READ, 0, &simpleProfileChar2Props ], // Characteristic Value 2 [ [ ATT_BT_UUID_SIZE, simpleProfilechar2UUID ], GATT_PERMIT_READ, 0, &simpleProfileChar2 ], // Characteristic 2 User Description [ [ ATT_BT_UUID_SIZE, charUserDescUUID ], GATT_PERMIT_READ, 0, simpleProfileChar2UserDesp ], // Characteristic 3 Declaration [ [ ATT_BT_UUID_SIZE, characterUUID ], GATT_PERMIT_READ, 0, &simpleProfileChar3Props ], // Characteristic Value 3 [ [ ATT_BT_UUID_SIZE, simpleProfilechar3UUID ], GATT_PERMIT_WRITE, 0, &simpleProfileChar3 ], // Characteristic 3 User Description [ [ ATT_BT_UUID_SIZE, charUserDescUUID ], GATT_PERMIT_READ, 0, simpleProfileChar3UserDesp ], // Characteristic 4 Declaration [ [ ATT_BT_UUID_SIZE, characterUUID ], GATT_PERMIT_READ, 0, &simpleProfileChar4Props ], // Characteristic Value 4 [ [ ATT_BT_UUID_SIZE, simpleProfilechar4UUID ], 0, 0, &simpleProfileChar4 ], // Characteristic 4 configuration [ [ ATT_BT_UUID_SIZE, clientCharCfgUUID ], GATT_PERMIT_READ | GATT_PERMIT_WRITE, 0, (uint8 *)&simpleProfileChar4Config ], // Characteristic 4 User Description [ [ ATT_BT_UUID_SIZE, charUserDescUUID ], GATT_PERMIT_READ, 0, simpleProfileChar4UserDesp ], // Characteristic 5 Declaration [ [ ATT_BT_UUID_SIZE, characterUUID ], GATT_PERMIT_READ, 0, &simpleProfileChar5Props ], // Characteristic Value 5 [ [ ATT_BT_UUID_SIZE, simpleProfilechar5UUID ], GATT_PERMIT_AUTHEN_READ, 0, simpleProfileChar5 ], // Characteristic 5 User Description [ [ ATT_BT_UUID_SIZE, charUserDescUUID ], GATT_PERMIT_READ, 0, simpleProfileChar5UserDesp ],]; 致力于帮助更多使用TI平台的开发者! |
|
|
|
|
|
|
|
victorlekwk 发表于 2019-10-17 12:44 那这个宏需要在哪里用呢? |
|
|
|
|
|
|
|
victorlekwk 发表于 2019-10-17 12:44 不好意思,点错了,能否发一份修改过的代码给我啊?我的邮箱:chenxing@szba-mobile.com |
|
|
|
|
|
|
|
|
请把以下几篇博客好好看看,ok? http://blog.csdn.net/feilusia/article/details/52334125 http://blog.csdn.net/feilusia/article/details/50723016 http://blog.csdn.net/feilusia/article/details/47020073 http://blog.csdn.net/feilusia/article/details/46909847 自己多动手动脑,多查资料。不要有问题就来问,ok? |
|
|
|
|
|
|
|
|
请把以下几篇博客好好看看,ok? http://blog.csdn.net/feilusia/article/details/52334125 http://blog.csdn.net/feilusia/article/details/50723016 http://blog.csdn.net/feilusia/article/details/47020073 http://blog.csdn.net/feilusia/article/details/46909847 自己多动手动脑,多查资料。不要有问题就来问,ok? |
|
|
|
|
|
|
|
victorlekwk 发表于 2019-10-17 12:44 你好!第一,ATTRTBL_CHAR4_CCC_IDX这个宏定义需要在哪里定义的啊? 第二,这个句柄的值需要怎么计算呢? 现在一直想不明白的就是这两个问题。能请帮忙解答一下吗? |
|
|
|
|
|
|
|
|
Hi,
Please reference below links. http://software-dl.ti.com/lprf/simplelink_academy/modules/ble_01_custom_profile/ble_01_custom_profile.html Client Characteristic Configuration Descriptor The name of this descriptor type is perhaps not very poetic. Often abbreviated to CCCD, the descriptor is an attribute with the UUID 0x2902 and is readable and writable. The value a GATT Client writes to this attribute will determine whether the GATT Server is allowed to send Notifications (if 0x0001 is written) or Indications (if 0x0002 is written). How to get handle: Several of these attributes are needed to define a Characteristic. A Characteristic always consists of a at least Valueattribute, where you in your Profile have decided what the value means, and a Declaration. The Declaration always comes before the value attribute and describes whether the value attribute can be read or written, contains the UUID of the Characteristic and the handle of the Characteristic Value's attribute. Other attributes of a characteristic can give a description of the characteristic in string format, or describe how the Value should be interpreted, or configure whether the GATT Server may send Notifications about value changes. These are called Descriptors. 致力于帮助更多使用TI平台的开发者! |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
550 浏览 0 评论
1613 浏览 0 评论
2047 浏览 0 评论
为啥BQ7693003DBTR芯片在和BQ769X0盒子通讯时收不到信号?
1514 浏览 0 评论
DSP 28027F 开发板 XDS100v2调试探针诊断日志显示了 Error -150 (SC_ERR_FTDI_FAIL)如何解决
1338 浏览 0 评论
AT32F407在USART2 DMA发送数据时,接包接到了要发送的数据,程序还是处于等待传输完成的标识判断中,为什么?
1757浏览 29评论
2782浏览 23评论
请问下tpa3220实际测试引脚功能和官方资料不符,哪位大佬可以帮忙解答下
1724浏览 20评论
请教下关于TAS5825PEVM评估模块原理图中不太明白的地方,寻求答疑
1634浏览 14评论
两个TMP117传感器一个可以正常读取温度值,一个读取的值一直是0,为什么?
1645浏览 13评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 14:06 , Processed in 3.231656 second(s), Total 85, Slave 70 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1204