在打开设备后的具体调用代码如下
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() << "发送数据\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;
当执行到 CH347StreamI2C 函数后会导致程序异常崩溃,请问会是什么原因引起的?
热门产品 :
CH32L103: 32位PDUSB低功耗单片机