Add:
Serial.print("inData: [");
Serial.print(inData);
Serial.println("]");
after:
if(started && ended)
{
and show a screen shot of your serial monitor.
Add:
Serial.print("inData: [");
Serial.print(inData);
Serial.println("]");
after:
if(started && ended)
{
and show a screen shot of your serial monitor.