Hello frenz i had a doubt in searching a string in QByteArray, i wanted to actually find the start of the frame "1A2C110000" and then append data from there all the data before the start of the frame to be discarded.. i think the only the index position of the first search string is taken so i am not getting the right out put.
edtdata.indexOf(serstr);
for(int i=0; i <edtdata.size(); i++)
{
newdat.append(edtdata.at(k));
}
textBrowser->append(newdat);
QByteArray data = (QByteArray::fromRawData(buff,numBytes)).toHex();
QByteArray edtdata(data);
QByteArray serstr("1A2C11000000");
edtdata.indexOf(serstr);
for(int i=0; i <edtdata.size(); i++)
{
newdat.append(edtdata.at(k));
}
textBrowser->append(newdat);
To copy to clipboard, switch view to plain text mode
this is a part of the data i am getting through rs232 terminal. .. i need to search for the start of the frame 1A2C11000000 and append the from there all the data before should be discarded. . i don't know exactly go about it. ..?
1A2C1100000d110a110a110a110a110a110a110a110a110a110a110a110a11
1A2C1100000e110a110a110a110a110a110a110a110a110a110a110a110a110a110a11
1A2C1100000f110a110a110a110a110a110a110a110a110a110a110a110a110a110a11
1A2C11000000 110a110a110a110a110a110a110a110a110a110a110a110a110a110a11
1A2C11000001110a110a110a110a110a110a110a110a110a110a110a110a110a110a11
1A2C11000002110a110a110a110a110a110a110a110a110a110a110a110a110a110a11
1A2C11000003110a110a110a110a110a110a110a110a110a110a110a110a110a110
1A2C1100000d110a110a110a110a110a110a110a110a110a110a110a110a11
1A2C1100000e110a110a110a110a110a110a110a110a110a110a110a110a110a110a11
1A2C1100000f110a110a110a110a110a110a110a110a110a110a110a110a110a110a11
1A2C11000000 110a110a110a110a110a110a110a110a110a110a110a110a110a110a11
1A2C11000001110a110a110a110a110a110a110a110a110a110a110a110a110a110a11
1A2C11000002110a110a110a110a110a110a110a110a110a110a110a110a110a110a11
1A2C11000003110a110a110a110a110a110a110a110a110a110a110a110a110a110
To copy to clipboard, switch view to plain text mode
does anyone have a idea of it. ?
thank you
Bookmarks