mirror of
https://github.com/Hamlib/Hamlib.git
synced 2024-09-21 10:27:18 +00:00
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
This commit is contained in:
parent
6287f120b4
commit
a4e9cf29b9
@ -6,7 +6,7 @@
|
||||
* 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);
|
||||
|
||||
/*
|
||||
* Sleep regularly until the buffer contains all 1 bytes
|
||||
* Sleep regularly until the buffer contains 1 byte
|
||||
* This should handle most cases.
|
||||
*/
|
||||
|
||||
bytes = 0;
|
||||
while(bytes < 1) {
|
||||
while(1) {
|
||||
ioctl(fd, FIONREAD, &bytes); /* get bytes in buffer */
|
||||
printf("bytes = %i\n", bytes);
|
||||
if (bytes == 1)
|
||||
break;
|
||||
sleep(1);
|
||||
|
||||
}
|
||||
@ -270,7 +272,7 @@ unsigned char cmd_get_rx_status(int fd) {
|
||||
|
||||
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];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user