Remote Operation
Sample Programs
5
5-19
/*--------------------------------------------------------------------*/
/* serial_write : write a single character to serial port */
/*--------------------------------------------------------------------*/
void serial_write (char ch)
{
while (!transmit_enabled)
;
while ((inportb (po 5) & 0x20) == 0)
;
outportb (portbase, ch);
}
/*--------------------------------------------------------------------*/
/* write_7000_serial : write a string to the correct RUSKA 7252
*/
/*--------------------------------------------------------------------*/
void write_7000_serial (char *s)
{
if (address == -1)
serial_write (CLEAR); /* Disable Addressing */
else
{ serial_write (DLE); /* Enable Addressing */
serial_write (a 0x20); /* Address */
}
while (*s) /* Write string */
serial_write (*s++);
}
/*--------------------------------------------------------------------*/
/* request_7000_serial : write a commmand and read the response */
/*--------------------------------------------------------------------*/
int request_7000_serial (char *s)
{
int i;
char ch;
clock_t start, current;
write_7000_serial (s); /* Write Command */
i = 0;
while (i < QUEUE_SIZE - 1)
{ start = clock ( );
while (inq_in == inq_out) /* Wait for a character */
{ current = clock ( );
if (current < start)
c= CLK_TCK * 86400;
if (current - start > TIMEOUT) /* Check for timeout */
{ buffer[i] = 0;
return FALSE;
}
}
ch = inqueue[+]; /* Put character in buffer */
if (inq_out == QUEUE_SIZE)
inq_out = 0;
if (ch == 0x0A) /* Line Feed? - End of response */
{ buffer[i] = 0;
return TRUE;
}
else
buffer[i++] = ch;
}
buffer[QUEUE_SIZE - 1] = 0; /* Buffer full */
return FALSE;
}
/*--------------------------------------------------------------------*/
Содержание RUSKA 7252
Страница 3: ...7252 Change Language Hold key for 5 seconds enter mode ...
Страница 4: ......
Страница 10: ...RUSKA 7252 Users Manual vi ...
Страница 12: ...RUSKA 7252 Users Manual viii ...
Страница 20: ...RUSKA 7252 Users Manual 1 6 ...
Страница 40: ...RUSKA 7252 Users Manual 3 6 ...
Страница 72: ...RUSKA 7252 Users Manual 4 32 ...
Страница 114: ...RUSKA 7252 Users Manual 6 22 ...
Страница 118: ...RUSKA 7252 Users Manual 7 4 ...