hello frenz, i am having a small problem i am not able to figure out how to remove first 12 Chars from a QByteArray and append the next 40 chars into another byte array or string.
something like i have to remove the first 6 bytes 03b702200001 and then append the next 20 bytes 00de00de00de00de00de00de00de00de00de00de00de00de00 de00de00de00de00de00de00de00de and so on to the next line of data also i tried using .remove(); but i cud't get it right.
03b702200001 00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de
03b702200002 00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de
03b702200003 00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de
03b702200004 00 de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de
03b702200001 00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de
03b702200002 00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de
03b702200003 00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de
03b702200004 00 de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de00de
To copy to clipboard, switch view to plain text mode
i am getting continuous data from rs232 terminal which i am pushing to a QByteArray this is what i did to remove the first 12 characters and append the next 40 characters .
for(int i=12; i< datstr.size(); i++)
{
newdat.append(datstr.at(i));
bytecount++
if(bytecount==40)
{
newdat.remove(0,12);
bytecount=0;
}
}
textBrowser->append(newdat);
datstr.clear();
for(int i=12; i< datstr.size(); i++)
{
newdat.append(datstr.at(i));
bytecount++
if(bytecount==40)
{
newdat.remove(0,12);
bytecount=0;
}
}
textBrowser->append(newdat);
datstr.clear();
To copy to clipboard, switch view to plain text mode
i am not able to think about a exact logic to do this.
Bookmarks