protocol fix: PCR always send a short ack, whatever the response can be. So eat it.

git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@1027 7ae35d74-ebe9-4afe-98af-79ac388436b8
Hamlib-1.1.3
Stéphane Fillod, F8CFE 2002-03-13 23:56:41 +00:00
rodzic 9ed48795a2
commit e6f23d2a11
1 zmienionych plików z 9 dodań i 1 usunięć

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib PCR backend - main file
* Copyright (c) 2001-2002 by Stephane Fillod
*
* $Id: pcr.c,v 1.13 2002-03-13 23:37:12 fillods Exp $
* $Id: pcr.c,v 1.14 2002-03-13 23:56:41 fillods Exp $
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
@ -104,6 +104,14 @@ int pcr_transaction(RIG *rig, const char *cmd, int cmd_len, char *data, int *dat
if (retval != RIG_OK)
return retval;
/* eat the first ack */
retval = read_string(&rs->rigport, data, 1, "\x0a", 1);
if (retval < 0)
return retval;
if (retval != 1)
return -RIG_EPROTO;
/* here is the real response */
*data_len = read_string(&rs->rigport, data, *data_len, "\x0a", 1);
return RIG_OK;