为什么主机enable从机的某个特征的notify时,会触发调用ReadAttrCB函数
时间:10-02
整理:3721RD
点击:
比如在simpleGATTProfile中的char4,只有GATT_PROP_NOTIFY没有READ,却在ReadAttrCB函数中还响应char4的读取。大家知道为什么吗?能解释一下notify到底怎么工作的?谢谢!
自己顶一下。
很奇怪的现象:如果把char4改为可读可通知,在读char4的时候就出错。似乎特征不能同时为可读可通知。
另外,在simpleGATTprofile的ReadAttrCB函数中,有这样一段话:
// 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;
TI员工能解释一下,是怎么回事吗?
改是可以改,比较麻烦,建议直接添加一个新特征值实现功能