TV Antenna User Manual

Acutime 2000 Synchronization Kit User Guide A-137
A Trimble Standard Interface Protocol
case ETX: /* End of message. */
rpt->status = COMPLETE;
return(TRUE);
default: /* If previous message has ended, this is new ID
code. */
reset_rptbuf(rpt); /* if not, this is an error. */
rpt->code = this_byte;
return(FALSE);
}
}
else if (this_byte == DLE) {
/* DLE byte without previous DLE stuffingmust be stuffing.
*/
rpt->status = HAVE_DLE;
continue;
}
/* normal byte; add to report */
rpt->status = INCOMPLETE;
rpt->buf[rpt->cnt] = this_byte;
rpt->cnt++;
if (rpt->cnt > MAX_RPTBUF) {
reset_rptbuf (rpt);
return(FALSE);
}
}
}
/* Prepare for receipt of new report */
void reset_rptbuf (TSIPPKT *rpt)
{
rpt->cnt = 0;
rpt->code = ETX;
rpt->status = INCOMPLETE;
}