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

GATT_WriteNoRspd的参数问题

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

To enable notifications, you must write a value of 0x0001 to the client characteristic configuration descriptor (CCCD). If you know the handle of the client characteristic descriptor, you can enable notifications by using the following code:

  attWriteReq_t writeReq;
  uint16 connHandle = connectionHandle;  // this will always be 0 if device only ever has one connection at a time

  writeReq.handle = handleOfCCCD; // if you know the value, you can put it in as a fixed value;
                                  // otherwise you will need to first discover the value
  writeReq.len = 2;
  writeReq.value[0] = LO_UINT16(GATT_CLIENT_CFG_NOTIFY);
  writeReq.value[1] = HI_UINT16(GATT_CLIENT_CFG_NOTIFY);
  writeReq.sig = 0;
  writeReq.cmd = 1;
 
  GATT_WriteNoRsp( connHandle, &writeReq, taskId );

Before doing this, you may also need to discover the handle of the CCCD. Some example of this process can be found in the TimeApp project which is included in the SDK. Specifically, look in the file "timeapp_discovery.c

这个回答之中的GATT_WriteNoRsp有三个参数,实际上这个函数在定义中只有两个参数,请问是否是上面这个函数有错误?

extern bStatus_t GATT_WriteNoRsp( uint16 connHandle, attWriteReq_t *pReq );

dali,

只有两个参数,我不知道为什么上面有三个参数,你可以忽略:)

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

网站地图

Top