From e6f23d2a11e75aa6090d3e9ca0bc801f57898406 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Fillod=2C=20F8CFE?= Date: Wed, 13 Mar 2002 23:56:41 +0000 Subject: [PATCH] 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 --- pcr/pcr.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pcr/pcr.c b/pcr/pcr.c index c85542789..136925391 100644 --- a/pcr/pcr.c +++ b/pcr/pcr.c @@ -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;