I just modified it to this, and now it saves the trips and will even resume reading the data once the car is turned on.
Code:
int iso_read_byte()
{
int b;
byte t=0;
while(t!=250 && (b=serialRead())==-1) {
delay(1);
t++;
}
if (t>=250) {
b = 0;
}
return b;
}
*Bug* This works great. The only problem is that once the car is turned off, throttle position is going to be reported as 0. this means that engine breaking will no long be accounted for. That should be taken into consideration else where in the code if you use this (i.e. reset the throttle position minimum value when ever the car is started up again.)