完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
SimpleBLEPeripheral中的Characteristic 1 2 3 4 5的模式都是定死的吗??
不能修改其中的参数吗??为什么我把程序修改成这样还不能读出CHAR3的UUID static uint8 simpleProfileChar1Props = GATT_PROP_READ | GATT_PROP_WRITE; static uint8 simpleProfileChar2Props = GATT_PROP_READ| GATT_PROP_WRITE; static uint8 simpleProfileChar3Props = GATT_PROP_READ | GATT_PROP_WRITE; static uint8 simpleProfileChar4Props = GATT_PROP_READ | GATT_PROP_NOTIFY; [ [ 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 Descriptin [ [ 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 | GATT_PERMIT_WRITE, 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_READ|GATT_PERMIT_WRITE, 0, &simpleProfileChar3 ], // Characteristic 3 User Description [ [ ATT_BT_UUID_SIZE, charUserDescUUID ], GATT_PERMIT_READ, 0, simpleProfileChar3UserDesp ], |
|
相关推荐
5 个讨论
|
|
还有个地方要改吧:
static uint8 simpleProfile_ReadAttrCB( uint16 connHandle, gattAttribute_t *pAttr, uint8 *pValue, uint8 *pLen, uint16 offset, uint8 maxLen ) [ ...... switch ( uuid ) [ // No need for "GATT_SERVICE_UUID" or "GATT_CLIENT_CHAR_CFG_UUID" cases; // gattserverapp handles those reads // characteristics 1 and 2 have read permissions // characteritisc 3 does not have read permissions; therefore it is not // included here // characteristic 4 does not have read permissions, but because it // can be sent as a notification, it is included here case SIMPLEPROFILE_CHAR1_UUID: case SIMPLEPROFILE_CHAR2_UUID: case SIMPLEPROFILE_CHAR4_UUID: *pLen = 1; pValue[0] = *pAttr->pValue; break; case SIMPLEPROFILE_CHAR5_UUID: *pLen = SIMPLEPROFILE_CHAR5_LEN; VOID osal_memcpy( pValue, switch ( uuid ) [ // No need for "GATT_SERVICE_UUID" or "GATT_CLIENT_CHAR_CFG_UUID" cases; // gattserverapp handles those reads // characteristics 1 and 2 have read permissions // characteritisc 3 does not have read permissions; therefore it is not // included here // characteristic 4 does not have read permissions, but because it // can be sent as a notification, it is included here case SIMPLEPROFILE_CHAR1_UUID: case SIMPLEPROFILE_CHAR2_UUID: case SIMPLEPROFILE_CHAR4_UUID: *pLen = 1; pValue[0] = *pAttr->pValue; break; case SIMPLEPROFILE_CHAR5_UUID: *pLen = SIMPLEPROFILE_CHAR5_LEN; VOID osal_memcpy( pValue, pAttr->pValue, SIMPLEPROFILE_CHAR5_LEN ); break; |
|
|
|
|
|
只有小组成员才能发言,加入小组>>
NA555DR VCC最低电压需要在5V供电,为什么用3.3V供电搭了个单稳态触发器也使用正常?
683 浏览 3 评论
MSP430F249TPMR出现高温存储后失效了的情况,怎么解决?
599 浏览 1 评论
对于多级放大电路板,在PCB布局中,电源摆放的位置应该注意什么?
1054 浏览 1 评论
740 浏览 0 评论
普中科技F28335开发板每次上电复位后数码管都会显示,如何熄灭它?
524 浏览 1 评论
请问下tpa3220实际测试引脚功能和官方资料不符,哪位大佬可以帮忙解答下
163浏览 20评论
请教下关于TAS5825PEVM评估模块原理图中不太明白的地方,寻求答疑
127浏览 14评论
在使用3254进行录音的时候出现一个奇怪的现象,右声道有吱吱声,请教一下,是否是什么寄存器设置存在问题?
127浏览 13评论
TLV320芯片内部自带数字滤波功能,请问linein进来的模拟信号是否是先经过ADC的超采样?
123浏览 12评论
TPA6304-Q1: TPA6304 两片公用一组I2C的话,其中一片配置不成功怎么办
170浏览 10评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-25 07:57 , Processed in 0.841317 second(s), Total 52, Slave 46 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号