沁恒主機(jī)打開CC2541從機(jī)char4通知使能失敗

5.jpg

如上圖:
代碼:

else?if?(?centralDiscState?==?BLE_DISC_STATE_CHAR?)
??{
????//?Characteristic?found,?store?handle
????if?(?pMsg->method?==?ATT_READ_BY_TYPE_RSP?&&?
?????????pMsg->msg.readByTypeRsp.numPairs?>?0?)
????{
??????centralCharHdl?=?BUILD_UINT16(?pMsg->msg.readByTypeRsp.pDataList[0],
???????????????????????????????????????pMsg->msg.readByTypeRsp.pDataList[1]?);
??????centralProcedureInProgress?=?FALSE;
??????
??????//?Start?do?read?or?write
??????tmos_start_task(?centralTaskId,?START_READ_OR_WRITE_EVT,?DEFAULT_READ_OR_WRITE_DELAY);
??????
??????//?Display?Characteristic?1?handle
??????PRINT("Found?Characteristic?4?handle?:?%x?\n",centralCharHdl);????
			//?Do?a?write
????????attWriteReq_t?req;
????????
????????req.cmd?=?FALSE;
????????req.sig?=?FALSE;
????????req.handle?=?centralCharHdl+1;
????????req.len?=?2;
				//centralConnHandle=0;
				PRINT(?"222!\n");
????????req.pValue?=?GATT_bm_alloc(centralConnHandle,ATT_WRITE_REQ,req.len,NULL,0);
????????if?(?req.pValue?!=?NULL?)
????????{
??????????req.pValue[0]?=?0x01;
					req.pValue[1]?=?0x00;
??????????PRINT(?"333!\n");
??????????if(?GATT_WriteCharValue(centralConnHandle,&req,centralTaskId)?==?SUCCESS?)
??????????{??????
????????????centralProcedureInProgress?=?TRUE;
						PRINT(?"Open?Notify?ok!\n");
????????????//centralDoWrite?=?!centralDoWrite;
????????????tmos_start_task(?centralTaskId,?START_READ_OR_WRITE_EVT,?DEFAULT_READ_OR_WRITE_DELAY);
??????????}
??????????else
??????????{
????????????GATT_bm_free((gattMsg_t?*)&req,?ATT_WRITE_REQ);
						PRINT(?"Open?Notify?Fail!\n");
??????????}
????????}??
????}
????centralDiscState?=?BLE_DISC_STATE_IDLE;
??}

我用CC2541主機(jī)打開CC2541從機(jī)的char4通知使能是可以的。
用沁恒就失敗。
請(qǐng)問高手,哪里有錯(cuò)?謝謝

麻煩留個(gè)郵箱 我給你發(fā)一下CH579做主機(jī)使能從機(jī)通知的例程,你參考看一下。


個(gè)人信息保護(hù),已隱藏

謝謝!


已發(fā)送 請(qǐng)查收


謝謝!


能否給我也發(fā)一份代碼?謝謝 個(gè)人信息保護(hù),已隱藏


已發(fā)送?


只有登錄才能回復(fù),可以選擇微信賬號(hào)登錄

国产91精品新入口,国产成人综合网在线播放,九热这里只有精品,本道在线观看,美女视频a美女视频,韩国美女激情视频,日本美女pvp视频