diff --git a/ground/src/experimental/USB_UPLOAD_TOOL/main.cpp b/ground/src/experimental/USB_UPLOAD_TOOL/main.cpp index 7cee37dc3..13661116a 100644 --- a/ground/src/experimental/USB_UPLOAD_TOOL/main.cpp +++ b/ground/src/experimental/USB_UPLOAD_TOOL/main.cpp @@ -13,6 +13,7 @@ int main(int argc, char *argv[]) filename = QString(argv[1]); OP_DFU dfu; + dfu.enterDFU(0); // dfu.enterDFU(1); // dfu.StartUpload(4,OP_DFU::Descript); // QByteArray array; @@ -25,10 +26,15 @@ int main(int argc, char *argv[]) // array[6]=7; // array[7]=8; // dfu.UploadData(8,array); - //dfu.UploadDescription(1,"jose manuel"); - //QString str=dfu.DownloadDescription(1,12); +// dfu.UploadDescription(1,"jose manuel"); + // QString str=dfu.DownloadDescription(1,12); // dfu.JumpToApp(); - dfu.UploadFirmware(filename.toAscii()); - //qDebug()<<"Description="<>(x*2) & 1); + dev.Writable=(bool)(RWFlags>>(x*2+1) & 1); + devices.append(dev); + buf[0] =0x02;//reportID + buf[1] = OP_DFU::Req_Capabilities;//DFU Command + buf[2] = 0; + buf[3] = 0; + buf[4] = 0; + buf[5] = 0; + buf[6] = x+1; + buf[7] = 0; + buf[8] = 0; + buf[9] = 0; + int result = hidHandle.send(0,buf, BUF_LEN, 5000); + result = hidHandle.receive(0,buf,BUF_LEN,5000); + devices[x].ID=buf[9]; + devices[x].SizeOfHash=buf[7]; + qDebug()<<"---------------"<<(int)buf[8]; + devices[x].SizeOfDesc=buf[8]; + quint32 aux; + aux=(quint8)buf[2]; + aux=aux<<8 |(quint8)buf[3]; + aux=aux<<8 |(quint8)buf[4]; + aux=aux<<8 |(quint8)buf[5]; + devices[x].SizeOfCode=aux; + } + qDebug()<<"Found "<