微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 无线和射频 > TI蓝牙设计交流 > CC2640中的 notification问题

CC2640中的 notification问题

时间:10-02 整理:3721RD 点击:

uint8_t charValue4=OneShotADC(0x80)/16;

在1秒的定时器回调中添加--------------

static attHandleValueNoti_t pReport ;//声明attHandleValueNoti_t这个结构体

uint16 noti_cHandle; //存放handle

pReport.handle = simpleProfileAttrTbl[11].handle;//读取notification对应的

handle GAPRole_GetParameter( 0x30E, &noti_cHandle);//获取Connection Handle

pReport.len = 1;//数据长度

pReport.pValue[0] = charValue4;//赋值

GATT_Notification(noti_cHandle,&pReport,FALSE);

结果一开始定时器就死机

发送notification的例子可以在Sensortag例程里面找到

notification有个开关,你这个代码似乎是没有判断开关如何就强行发送了

第二个没有必要在1秒1次的回调函数里频繁的操作获取handle的命令,可以参考例程使用task范围的局部变量保存

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top