ERROR:ASSERT: "uint(i) < uint(size())"
Solved
General and Desktop
-
after call this function program send this error ASSERT: "uint(i) < uint(size())" in file /root/raspi/qt5pi/include/QtCore/qbytearray.h, line 470 and Aborted
why this happend?QByteArray GetResponse::getEPC(QByteArray ResponseData){ QByteArray EPC; if(ResponseData.at(3)==0x01){ if (ResponseData.size()!=0){ unsigned char a=ResponseData.at(5); int maxCard=a; int i=7; int max=19; int j=0; for (int card = 0; card < maxCard; card++) { QByteArray temp; j=0; if(i+12<ResponseData.size()){ for (i;i < max; i++) { temp.append(ResponseData.at(i)); j+=1; } } if(temp.size()>0) EPC.append(temp); i+=2; max+=14; }//end of for cards } } return EPC; }
-
-
Ok but for your first test ?
if(ResponseData.at(3)==0x01){
I think that you have to do something like this:
if(ResponseData.size > 3 )// it is really important to check that your DataResponse size is upper than 3 { if(ResponseData.at(3) == 0x01){ .. .. .. } }