完善资料让更多小伙伴认识你,还能领取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; |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
590 浏览 0 评论
1645 浏览 0 评论
2084 浏览 0 评论
为啥BQ7693003DBTR芯片在和BQ769X0盒子通讯时收不到信号?
1537 浏览 0 评论
DSP 28027F 开发板 XDS100v2调试探针诊断日志显示了 Error -150 (SC_ERR_FTDI_FAIL)如何解决
1376 浏览 0 评论
AT32F407在USART2 DMA发送数据时,接包接到了要发送的数据,程序还是处于等待传输完成的标识判断中,为什么?
1788浏览 29评论
2816浏览 23评论
请问下tpa3220实际测试引脚功能和官方资料不符,哪位大佬可以帮忙解答下
1746浏览 20评论
请教下关于TAS5825PEVM评估模块原理图中不太明白的地方,寻求答疑
1662浏览 14评论
两个TMP117传感器一个可以正常读取温度值,一个读取的值一直是0,为什么?
1676浏览 13评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-12 04:10 , Processed in 1.028720 second(s), Total 65, Slave 52 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
578