Quantcast
Channel: 蓝牙论坛 - 最近的话题
Viewing all articles
Browse latest Browse all 7485

关于使能Notify的问题

$
0
0

您好:

         我现在用cc2640做主机,程序是在TI的SDK里的主机例程里修改的

         我的使能Notify的代码如下:

          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 );

 请问必须用GATT_WriteNoRsp()函数吗?

GATT_WriteNoRsp()能否用GATT_WriteCharValue()函数代替???


Viewing all articles
Browse latest Browse all 7485

Trending Articles