請(qǐng)問(wèn)CH579做藍(lán)牙主機(jī)時(shí),怎么讀取從機(jī)發(fā)送的notify呢?
主機(jī)無(wú)法開(kāi)啟從機(jī)notify,會(huì)提示"Write Error: 1",請(qǐng)問(wèn)應(yīng)該如何解決呢?
attWriteReq_t?req; ????????? req.cmd?=?0; req.sig?=?0; req.handle?=?GATT_CLIENT_CHAR_CFG_UUID; req.len?=?2; ? req.pValue?=?GATT_bm_alloc(centralConnHandle,ATT_WRITE_REQ,req.len,NULL,0); if?(?req.pValue?!=?NULL?) { ??req.pValue[0]?=?1; ??req.pValue[1]?=?0;?? ????? ??if(?GATT_WriteCharValue(centralConnHandle,&req,centralTaskId)?==?SUCCESS?) ??{????? ????????printf("\r\nenable?notify\r\n"); ??} ??else ??{ ????GATT_bm_free((gattMsg_t?*)&req,?ATT_WRITE_REQ); }
熱門(mén)產(chǎn)品 :
CH32V317: 互聯(lián)型青稞RISC-V MCU