我在ARM端用: for (;;) { buffTest[0]='a'; buffTest[0]='b'; buffTest[0]='c'; WritePort1(3, buffTest, 200); } 在PC端: void CUSB_I2CDlg::OnTest() { int pipenum,i,ret; unsigned char Recbuff[3]; unsigned char RecbuffTest[8]; RecbuffTest[0]='F'; RecbuffTest[1]='F'; CString CSRecbuff; CString CSRecbuffTest; CSRecbuff.Empty(); CSRecbuff.Format("%s",Recbuff); CSRecbuffTest.Format("%s",RecbuffTest);
pipenum=3; for(i=0;i<1;i++) { ret = ReadData214x(pipenum-3, Recbuff, 3, 1000); if (ret != 2) { MessageBox("通信错误!"); } else { CSRecbuff.Format("%s",Recbuff); CSRecbuffTest+=CSRecbuff; }
} } 为什么不能接收到数据,每次都是通信错误 |