Trimble Outdoors AcutimeTM2000 Synchronization Kit TV Antenna User Manual


 
Acutime 2000 Synchronization Kit User Guide A-135
A Trimble Standard Interface Protocol
All TSIP packet formats take the form <DLE><ID><Data String
Bytes><DLE><ETX>, where <DLE> and <ETX> are reserved
frame characters with values 0x10 and 0x03, respectively, and <ID>
is the packet identifier. The following routines perform DLE stuffing
on a command packet and send it to the ACE UTC GPS.
#define DLE 0x10
#define ETX 0x03
#define PORT 1
/* Send a byte to Port 1 */
short sendb(unsigned char db)
{
/* put_char outputs a character to the serial port; it
* returns 0 for success and 1 for failure.
*/
return(put_char(PORT, db));
}
/* Format a command for sending to a TSIP receiver */
void send_cmd(TSIPPKT *cmd)
{
short i;
sendb(DLE);
sendb(cmd->code);
for (i = 0; i < cmd->cnt; i++) {
if (cmd->buf[i] == DLE)
sendb(DLE);
sendb(cmd->buf[i]);
}
sendb(DLE);
sendb(ETX);
}