kopia lustrzana https://github.com/Hamlib/Hamlib
* added rig_reset() support
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@444 7ae35d74-ebe9-4afe-98af-79ac388436b8Hamlib-1.1.1
rodzic
cd87af8d22
commit
7933f49405
|
@ -5,7 +5,7 @@
|
|||
* will be used for obtaining rig capabilities.
|
||||
*
|
||||
*
|
||||
* $Id: rig.h,v 1.23 2001-03-04 13:04:46 f4cfe Exp $
|
||||
* $Id: rig.h,v 1.24 2001-03-04 23:06:30 f4cfe Exp $
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
|
@ -243,6 +243,13 @@ enum powerstat_e {
|
|||
};
|
||||
typedef enum powerstat_e powerstat_t;
|
||||
|
||||
enum reset_e {
|
||||
RIG_RESET_NONE = 0,
|
||||
RIG_RESET_SOFT,
|
||||
RIG_RESET_MCALL /* memory clear */
|
||||
};
|
||||
typedef enum reset_e reset_t;
|
||||
|
||||
|
||||
enum mem_vfo_op_e {
|
||||
RIG_MVOP_VFO_MODE = 0,
|
||||
|
@ -375,6 +382,9 @@ typedef unsigned long setting_t; /* 32 bits might not be enough.. */
|
|||
#define RIG_FUNC_MN (1<<13) /* Manual Notch (Icom) */
|
||||
#define RIG_FUNC_RNF (1<<14) /* RTTY Filter Notch (Icom) */
|
||||
#define RIG_FUNC_ARO (1<<15) /* Auto Repeater Offset */
|
||||
#define RIG_FUNC_LOCK (1<<16) /* Lock */
|
||||
#define RIG_FUNC_MUTE (1<<17) /* Mute, could be emulated by LELVE_AF*/
|
||||
#define RIG_FUNC_VSC (1<<18) /* Voice Scan Control */
|
||||
|
||||
|
||||
/*
|
||||
|
@ -682,6 +692,7 @@ struct rig_caps {
|
|||
|
||||
int (*set_powerstat)(RIG *rig, powerstat_t status);
|
||||
int (*get_powerstat)(RIG *rig, powerstat_t *status);
|
||||
int (*reset)(RIG *rig, reset_t reset);
|
||||
|
||||
int (*set_ant)(RIG *rig, vfo_t vfo, ant_t ant); /* antenna */
|
||||
int (*get_ant)(RIG *rig, vfo_t vfo, ant_t *ant);
|
||||
|
@ -897,6 +908,8 @@ extern int rig_get_parm(RIG *rig, setting_t parm, value_t *val);
|
|||
extern int rig_set_powerstat(RIG *rig, powerstat_t status);
|
||||
extern int rig_get_powerstat(RIG *rig, powerstat_t *status);
|
||||
|
||||
extern int rig_reset(RIG *rig, reset_t reset); /* dangerous! */
|
||||
|
||||
/* more to come -- FS */
|
||||
|
||||
extern int rig_close(RIG *rig);
|
||||
|
|
27
src/rig.c
27
src/rig.c
|
@ -2,7 +2,7 @@
|
|||
Copyright (C) 2000 Stephane Fillod and Frank Singleton
|
||||
This file is part of the hamlib package.
|
||||
|
||||
$Id: rig.c,v 1.23 2001-03-04 13:06:36 f4cfe Exp $
|
||||
$Id: rig.c,v 1.24 2001-03-04 23:06:30 f4cfe Exp $
|
||||
|
||||
Hamlib is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
|
@ -2268,6 +2268,31 @@ int rig_get_powerstat(RIG *rig, powerstat_t *status)
|
|||
return rig->caps->get_powerstat(rig, status);
|
||||
}
|
||||
|
||||
/**
|
||||
* rig_reset - reset the radio
|
||||
* @rig: The rig handle
|
||||
* @reset: The reset operation to perform
|
||||
*
|
||||
* The rig_reset() function reset the radio.
|
||||
* See %RIG_RESET_NONE, %RIG_RESET_SOFT and %RIG_RESET_MCALL defines
|
||||
* for the @reset.
|
||||
*
|
||||
* RETURN VALUE: The rig_reset() function returns %RIG_OK
|
||||
* if the operation has been sucessful, or a negative value
|
||||
* if an error occured (in which case, cause is set appropriately).
|
||||
*
|
||||
*/
|
||||
|
||||
int rig_reset(RIG *rig, reset_t reset)
|
||||
{
|
||||
if (!rig || !rig->caps)
|
||||
return -RIG_EINVAL;
|
||||
|
||||
if (rig->caps->reset == NULL)
|
||||
return -RIG_ENAVAIL;
|
||||
|
||||
return rig->caps->reset(rig, reset);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue