test if the last 4 characters are 'D', 'O', 'N', and 'E'. If so, set ended to true.
After the "DONE" there is still a \r\n and an OK followed by another \r\n is present.
So should I still look out for "DONE" ?
If yes, I'm using
f(index < 199)
{
inData1[index] = inChar;
for(int i=index ;i>=(index-3);i--)
{
if(inData1[i]=='E')
{
if(inData1[i-1]=='N')
{
if(inData1[i-2]=='O')
{
if(inData1[i-3]=='D')
{
Serial.println("DETECTED");
break;
}
}
}
}
to detect DONE. Is this feasible?