CH347StreamI2C 函數(shù)調(diào)用崩潰問題

在打開設(shè)備后的具體調(diào)用代碼如下


????UCHAR?*?data?=?new?UCHAR[128];
????UCHAR?*?recv?=?new?UCHAR[128];

????ULONG?i?=?0,?send_len?=?3,?recv_len?=?6;


????data[0]?=?0x55;
????data[1]?=?0x07;
????data[2]?=?0xC2;

????qDebug()?<<?"發(fā)送數(shù)據(jù)\n";

????this->CH347I2C_Set_IM(this->DevIndex[this->ui->CBX_DeviceList->currentIndex()],?0x01);

????//if?(this->CH347StreamI2C_IM(this->DevIndex[this->ui->CBX_DeviceList->currentIndex()],?3,?data,?64,?recv))?{
????if?(this->CH347StreamI2C_IM(i,?send_len,?(PVOID)data,?recv_len,?(PVOID)recv))?{
????????qDebug()?<<?"recv:?"?<<?recv?<<?"\n";
????}?else?{
????????qDebug()?<<?"讀取失敗\n";
????}

????delete[]?data;
????delete[]?recv;


當(dāng)執(zhí)行到 CH347StreamI2C 函數(shù)后會導(dǎo)致程序異常崩潰,請問會是什么原因引起的?

您好,可將

if?(this->CH347StreamI2C_IM(i,?send_len,?(PVOID)data,?recv_len,?(PVOID)recv))

修改為試一下

if?(this->CH347StreamI2C_IM(i,?send_len,?data,?recv_len,?recv))



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

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