From efabee7d6c1a2d07cdc8f408fef9c603b8af0861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Fillod=2C=20F8CFE?= Date: Mon, 22 Dec 2003 07:39:46 +0000 Subject: [PATCH] echo fix git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@1632 7ae35d74-ebe9-4afe-98af-79ac388436b8 --- alinco/alinco.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/alinco/alinco.c b/alinco/alinco.c index bc7e98ca2..dc7ff6c49 100644 --- a/alinco/alinco.c +++ b/alinco/alinco.c @@ -2,7 +2,7 @@ * Hamlib Alinco backend - main file * Copyright (c) 2001-2003 by Stephane Fillod * - * $Id: alinco.c,v 1.19 2003-11-16 17:14:42 fillods Exp $ + * $Id: alinco.c,v 1.20 2003-12-22 07:39:46 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 @@ -100,6 +100,7 @@ int alinco_transaction(RIG *rig, const char *cmd, int cmd_len, char *data, int * { int retval; struct rig_state *rs; + char echobuf[BUFSZ+1]; rs = &rig->state; @@ -109,6 +110,14 @@ int alinco_transaction(RIG *rig, const char *cmd, int cmd_len, char *data, int * if (retval != RIG_OK) return retval; + /* + * Transceiver sends an echo of cmd + * TODO: check whether cmd and echobuf match (optional) + */ + retval = read_string(&rs->rigport, echobuf, BUFSZ, EOM, strlen(EOM)); + if (retval != RIG_OK) + return retval; + /* no data expected, TODO: flush input? */ if (!data || !data_len) return 0;