mirror of
https://github.com/Hamlib/Hamlib.git
synced 2024-09-21 18:37:18 +00:00
use RIG_ENAVAIL as return code for empty channels in get_channel
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@1893 7ae35d74-ebe9-4afe-98af-79ac388436b8
This commit is contained in:
parent
d76339dce8
commit
a5849641bb
@ -2,7 +2,7 @@
|
||||
* Hamlib Kenwood backend - main file
|
||||
* Copyright (c) 2000-2004 by Stephane Fillod and others
|
||||
*
|
||||
* $Id: kenwood.c,v 1.80 2004-12-20 22:58:19 jrinas Exp $
|
||||
* $Id: kenwood.c,v 1.81 2004-12-27 12:53:01 f4dwv 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
|
||||
@ -188,8 +188,8 @@ transaction_read:
|
||||
|
||||
/* Command recognised by rig but invalid data entered. */
|
||||
if (strlen(data) == 2 && data[0] == 'N') {
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: NegAck for '%s'\n", __FUNCTION__, cmdstr);
|
||||
retval = -RIG_ERJCTED;
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: NegAck for '%s'\n", __FUNCTION__, cmdstr);
|
||||
retval = -RIG_ENAVAIL;
|
||||
goto transaction_quit;
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
* This program exercises the backup and restore of a radio
|
||||
* using Hamlib. CSV primitives
|
||||
*
|
||||
* $Id: memcsv.c,v 1.4 2004-05-17 21:09:45 fillods Exp $
|
||||
* $Id: memcsv.c,v 1.5 2004-12-27 12:53:02 f4dwv Exp $
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@ -81,6 +81,11 @@ int csv_save (RIG *rig, const char *outfilename)
|
||||
chan.channel_num = j;
|
||||
status=rig_get_channel(rig, &chan);
|
||||
|
||||
if (status == -RIG_ENAVAIL ) {
|
||||
/* empty channel */
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
if (status != RIG_OK ) {
|
||||
printf("rig_get_channel: error = %s \n", rigerror(status));
|
||||
return status;
|
||||
@ -313,7 +318,7 @@ void dump_csv_chan(const channel_cap_t *mem_caps, const channel_t *chan, FILE *f
|
||||
fprintf(f, "%s;", rig_strptrshift(chan->rptr_shift));
|
||||
}
|
||||
if (mem_caps->rptr_offs) {
|
||||
fprintf(f,"%d",(int)chan->rptr_offs);
|
||||
fprintf(f,"%d;",(int)chan->rptr_offs);
|
||||
}
|
||||
if (mem_caps->tuning_step) {
|
||||
fprintf(f,"%d;",(int)chan->tuning_step);
|
||||
|
@ -2,7 +2,7 @@
|
||||
* memsave.c - Copyright (C) 2003-2004 Thierry Leconte
|
||||
*
|
||||
*
|
||||
* $Id: memsave.c,v 1.6 2004-12-22 16:03:19 f4dwv Exp $
|
||||
* $Id: memsave.c,v 1.7 2004-12-27 12:53:02 f4dwv Exp $
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@ -93,6 +93,11 @@ int dump_xml_chan(RIG *rig, xmlNodePtr root, int i, int chan_num)
|
||||
chan.channel_num = chan_num;
|
||||
status=rig_get_channel(rig, &chan);
|
||||
|
||||
if (status == -RIG_ENAVAIL ) {
|
||||
/* empty channel */
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
if (status != RIG_OK ) {
|
||||
printf("rig_get_channel: error = %s \n", rigerror(status));
|
||||
return status;
|
||||
|
Loading…
Reference in New Issue
Block a user