From 89886b5aae56751144d09a25368da21b57d90979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Fillod=2C=20F8CFE?= Date: Wed, 11 Sep 2002 21:30:22 +0000 Subject: [PATCH] fix stupid bug in icom_set_func that was inverting status + wrong frame len checking, thank goes to Luc LX2GT git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@1169 7ae35d74-ebe9-4afe-98af-79ac388436b8 --- icom/icom.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/icom/icom.c b/icom/icom.c index 0d1232ef0..33bd1d132 100644 --- a/icom/icom.c +++ b/icom/icom.c @@ -2,7 +2,7 @@ * Hamlib CI-V backend - main file * Copyright (c) 2000-2002 by Stephane Fillod * - * $Id: icom.c,v 1.64 2002-08-19 22:17:11 fillods Exp $ + * $Id: icom.c,v 1.65 2002-09-11 21:30:22 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 @@ -1531,7 +1531,7 @@ int icom_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) /* * except for IC-R8500 */ - fctbuf[0] = status? 0x00:0x01; + fctbuf[0] = status? 0x01:0x00; fct_len = rig->caps->rig_model == RIG_MODEL_ICR8500 ? 0 : 1; /* Optimize: @@ -1540,7 +1540,12 @@ int icom_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) switch (func) { case RIG_FUNC_FAGC: fct_cn = C_CTL_FUNC; - fct_sc = S_FUNC_AGC; /* default to 0x01 super-fast */ + fct_sc = S_FUNC_AGC; + /* note: should it be a LEVEL only, and no func? --SF */ + if (status != 0) + fctbuf[0] = 0x01; /* default to 0x01 super-fast */ + else + fctbuf[0] = 0x02; break; case RIG_FUNC_NB: fct_cn = C_CTL_FUNC; @@ -1618,9 +1623,9 @@ int icom_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) if (retval != RIG_OK) return retval; - if (fct_len != 2) { + if (acklen != 1) { rig_debug(RIG_DEBUG_ERR,"icom_set_func: wrong frame len=%d\n", - fct_len); + acklen); return -RIG_EPROTO; }