changed cmd_get_rx_status, must do tx also

git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@23 7ae35d74-ebe9-4afe-98af-79ac388436b8
Hamlib-1.0.0
Frank Singleton, VK3FCS 2000-07-26 00:34:25 +00:00
rodzic 6287f120b4
commit a4e9cf29b9
1 zmienionych plików z 6 dodań i 4 usunięć

Wyświetl plik

@ -6,7 +6,7 @@
* via serial interface to an FT-847 using the "CAT" interface. * via serial interface to an FT-847 using the "CAT" interface.
* *
* *
* $Id: ft847.c,v 1.2 2000-07-26 00:00:40 javabear Exp $ * $Id: ft847.c,v 1.3 2000-07-26 00:34:25 javabear Exp $
* *
*/ */
@ -254,14 +254,16 @@ unsigned char cmd_get_rx_status(int fd) {
write_block(fd,data); write_block(fd,data);
/* /*
* Sleep regularly until the buffer contains all 1 bytes * Sleep regularly until the buffer contains 1 byte
* This should handle most cases. * This should handle most cases.
*/ */
bytes = 0; bytes = 0;
while(bytes < 1) { while(1) {
ioctl(fd, FIONREAD, &bytes); /* get bytes in buffer */ ioctl(fd, FIONREAD, &bytes); /* get bytes in buffer */
printf("bytes = %i\n", bytes); printf("bytes = %i\n", bytes);
if (bytes == 1)
break;
sleep(1); sleep(1);
} }
@ -270,7 +272,7 @@ unsigned char cmd_get_rx_status(int fd) {
n = read(fd,datain,1); /* grab 1 byte from rig */ n = read(fd,datain,1); /* grab 1 byte from rig */
printf("i = %i ,datain[i] = %x \n", i, datain[i]); printf("Byte read = %x \n", datain[0]);
return datain[0]; return datain[0];