implemented more calls

git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@1137 7ae35d74-ebe9-4afe-98af-79ac388436b8
Hamlib-1.1.4
Stéphane Fillod, F8CFE 2002-08-23 20:01:09 +00:00
rodzic 9614a6c7e9
commit 30505a7b7e
7 zmienionych plików z 1519 dodań i 280 usunięć

Wyświetl plik

@ -15,9 +15,9 @@ extern "C" {
/*
* Hamlib Interface - RPC definitions
* Copyright (c) 2000,2001 by Stephane Fillod and Frank Singleton
* Copyright (c) 2000-2002 by Stephane Fillod and Frank Singleton
*
* $Id: rpcrig.h,v 1.3 2001-12-27 21:59:10 fillods Exp $
* $Id: rpcrig.h,v 1.4 2002-08-23 20:01:09 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
@ -63,6 +63,16 @@ typedef long ant_x;
typedef long ann_x;
typedef int rptr_shift_x;
typedef int tone_x;
typedef long scan_x;
typedef long reset_x;
typedef long powerstat_x;
struct mode_s {
rmode_x mode;
pbwidth_x width;
@ -111,6 +121,14 @@ struct vfo_res {
};
typedef struct vfo_res vfo_res;
struct powerstat_res {
int rigstatus;
union {
powerstat_x powerstat;
} powerstat_res_u;
};
typedef struct powerstat_res powerstat_res;
struct split_arg {
vfo_x vfo;
split_x split;
@ -164,10 +182,101 @@ typedef struct val_res val_res;
struct vfo_op_arg {
vfo_x vfo;
vfo_op_x op;
vfo_op_x vfo_op;
};
typedef struct vfo_op_arg vfo_op_arg;
struct rptrshift_res {
int rigstatus;
union {
rptr_shift_x rptrshift;
} rptrshift_res_u;
};
typedef struct rptrshift_res rptrshift_res;
struct rptrshift_arg {
vfo_x vfo;
rptr_shift_x rptrshift;
};
typedef struct rptrshift_arg rptrshift_arg;
struct shortfreq_res {
int rigstatus;
union {
shortfreq_x shortfreq;
} shortfreq_res_u;
};
typedef struct shortfreq_res shortfreq_res;
struct shortfreq_arg {
vfo_x vfo;
shortfreq_x shortfreq;
};
typedef struct shortfreq_arg shortfreq_arg;
struct tone_res {
int rigstatus;
union {
tone_x tone;
} tone_res_u;
};
typedef struct tone_res tone_res;
struct tone_arg {
vfo_x vfo;
tone_x tone;
};
typedef struct tone_arg tone_arg;
struct ant_res {
int rigstatus;
union {
ant_x ant;
} ant_res_u;
};
typedef struct ant_res ant_res;
struct ant_arg {
vfo_x vfo;
ant_x ant;
};
typedef struct ant_arg ant_arg;
struct ch_res {
int rigstatus;
union {
int ch;
} ch_res_u;
};
typedef struct ch_res ch_res;
struct ch_arg {
vfo_x vfo;
int ch;
};
typedef struct ch_arg ch_arg;
struct scan_s {
scan_x scan;
int ch;
};
typedef struct scan_s scan_s;
struct scan_res {
int rigstatus;
union {
scan_s scan;
} scan_res_u;
};
typedef struct scan_res scan_res;
struct scan_arg {
vfo_x vfo;
scan_x scan;
int ch;
};
typedef struct scan_arg scan_arg;
struct freq_range_s {
freq_x start;
freq_x end;
@ -321,6 +430,87 @@ extern val_res * getparm_1_svc(setting_arg *, struct svc_req *);
#define VFOOP 31
extern int * vfoop_1(vfo_op_arg *, CLIENT *);
extern int * vfoop_1_svc(vfo_op_arg *, struct svc_req *);
#define SETRPTRSHIFT 32
extern int * setrptrshift_1(rptrshift_arg *, CLIENT *);
extern int * setrptrshift_1_svc(rptrshift_arg *, struct svc_req *);
#define GETRPTRSHIFT 33
extern rptrshift_res * getrptrshift_1(vfo_x *, CLIENT *);
extern rptrshift_res * getrptrshift_1_svc(vfo_x *, struct svc_req *);
#define SETRPTROFFS 34
extern int * setrptroffs_1(shortfreq_arg *, CLIENT *);
extern int * setrptroffs_1_svc(shortfreq_arg *, struct svc_req *);
#define GETRPTROFFS 35
extern shortfreq_res * getrptroffs_1(vfo_x *, CLIENT *);
extern shortfreq_res * getrptroffs_1_svc(vfo_x *, struct svc_req *);
#define SETCTCSSTONE 36
extern int * setctcsstone_1(tone_arg *, CLIENT *);
extern int * setctcsstone_1_svc(tone_arg *, struct svc_req *);
#define GETCTCSSTONE 37
extern tone_res * getctcsstone_1(vfo_x *, CLIENT *);
extern tone_res * getctcsstone_1_svc(vfo_x *, struct svc_req *);
#define SETCTCSSSQL 38
extern int * setctcsssql_1(tone_arg *, CLIENT *);
extern int * setctcsssql_1_svc(tone_arg *, struct svc_req *);
#define GETCTCSSSQL 39
extern tone_res * getctcsssql_1(vfo_x *, CLIENT *);
extern tone_res * getctcsssql_1_svc(vfo_x *, struct svc_req *);
#define SETDCSCODE 40
extern int * setdcscode_1(tone_arg *, CLIENT *);
extern int * setdcscode_1_svc(tone_arg *, struct svc_req *);
#define GETDCSCODE 41
extern tone_res * getdcscode_1(vfo_x *, CLIENT *);
extern tone_res * getdcscode_1_svc(vfo_x *, struct svc_req *);
#define SETDCSSQL 42
extern int * setdcssql_1(tone_arg *, CLIENT *);
extern int * setdcssql_1_svc(tone_arg *, struct svc_req *);
#define GETDCSSQL 43
extern tone_res * getdcssql_1(vfo_x *, CLIENT *);
extern tone_res * getdcssql_1_svc(vfo_x *, struct svc_req *);
#define SETRIT 44
extern int * setrit_1(shortfreq_arg *, CLIENT *);
extern int * setrit_1_svc(shortfreq_arg *, struct svc_req *);
#define GETRIT 45
extern shortfreq_res * getrit_1(vfo_x *, CLIENT *);
extern shortfreq_res * getrit_1_svc(vfo_x *, struct svc_req *);
#define SETXIT 46
extern int * setxit_1(shortfreq_arg *, CLIENT *);
extern int * setxit_1_svc(shortfreq_arg *, struct svc_req *);
#define GETXIT 47
extern shortfreq_res * getxit_1(vfo_x *, CLIENT *);
extern shortfreq_res * getxit_1_svc(vfo_x *, struct svc_req *);
#define SETTS 48
extern int * setts_1(shortfreq_arg *, CLIENT *);
extern int * setts_1_svc(shortfreq_arg *, struct svc_req *);
#define GETTS 49
extern shortfreq_res * getts_1(vfo_x *, CLIENT *);
extern shortfreq_res * getts_1_svc(vfo_x *, struct svc_req *);
#define SCAN 50
extern int * scan_1(scan_arg *, CLIENT *);
extern int * scan_1_svc(scan_arg *, struct svc_req *);
#define RESET 51
extern int * reset_1(reset_x *, CLIENT *);
extern int * reset_1_svc(reset_x *, struct svc_req *);
#define SETMEM 52
extern int * setmem_1(ch_arg *, CLIENT *);
extern int * setmem_1_svc(ch_arg *, struct svc_req *);
#define GETMEM 53
extern ch_res * getmem_1(vfo_x *, CLIENT *);
extern ch_res * getmem_1_svc(vfo_x *, struct svc_req *);
#define SETANT 54
extern int * setant_1(ant_arg *, CLIENT *);
extern int * setant_1_svc(ant_arg *, struct svc_req *);
#define GETANT 55
extern ant_res * getant_1(vfo_x *, CLIENT *);
extern ant_res * getant_1_svc(vfo_x *, struct svc_req *);
#define SETBANK 56
extern int * setbank_1(ch_arg *, CLIENT *);
extern int * setbank_1_svc(ch_arg *, struct svc_req *);
#define SETPOWERSTAT 58
extern int * setpowerstat_1(powerstat_x *, CLIENT *);
extern int * setpowerstat_1_svc(powerstat_x *, struct svc_req *);
#define GETPOWERSTAT 59
extern powerstat_res * getpowerstat_1(void *, CLIENT *);
extern powerstat_res * getpowerstat_1_svc(void *, struct svc_req *);
extern int rigprog_1_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
#else /* K&R C */
@ -396,6 +586,87 @@ extern val_res * getparm_1_svc();
#define VFOOP 31
extern int * vfoop_1();
extern int * vfoop_1_svc();
#define SETRPTRSHIFT 32
extern int * setrptrshift_1();
extern int * setrptrshift_1_svc();
#define GETRPTRSHIFT 33
extern rptrshift_res * getrptrshift_1();
extern rptrshift_res * getrptrshift_1_svc();
#define SETRPTROFFS 34
extern int * setrptroffs_1();
extern int * setrptroffs_1_svc();
#define GETRPTROFFS 35
extern shortfreq_res * getrptroffs_1();
extern shortfreq_res * getrptroffs_1_svc();
#define SETCTCSSTONE 36
extern int * setctcsstone_1();
extern int * setctcsstone_1_svc();
#define GETCTCSSTONE 37
extern tone_res * getctcsstone_1();
extern tone_res * getctcsstone_1_svc();
#define SETCTCSSSQL 38
extern int * setctcsssql_1();
extern int * setctcsssql_1_svc();
#define GETCTCSSSQL 39
extern tone_res * getctcsssql_1();
extern tone_res * getctcsssql_1_svc();
#define SETDCSCODE 40
extern int * setdcscode_1();
extern int * setdcscode_1_svc();
#define GETDCSCODE 41
extern tone_res * getdcscode_1();
extern tone_res * getdcscode_1_svc();
#define SETDCSSQL 42
extern int * setdcssql_1();
extern int * setdcssql_1_svc();
#define GETDCSSQL 43
extern tone_res * getdcssql_1();
extern tone_res * getdcssql_1_svc();
#define SETRIT 44
extern int * setrit_1();
extern int * setrit_1_svc();
#define GETRIT 45
extern shortfreq_res * getrit_1();
extern shortfreq_res * getrit_1_svc();
#define SETXIT 46
extern int * setxit_1();
extern int * setxit_1_svc();
#define GETXIT 47
extern shortfreq_res * getxit_1();
extern shortfreq_res * getxit_1_svc();
#define SETTS 48
extern int * setts_1();
extern int * setts_1_svc();
#define GETTS 49
extern shortfreq_res * getts_1();
extern shortfreq_res * getts_1_svc();
#define SCAN 50
extern int * scan_1();
extern int * scan_1_svc();
#define RESET 51
extern int * reset_1();
extern int * reset_1_svc();
#define SETMEM 52
extern int * setmem_1();
extern int * setmem_1_svc();
#define GETMEM 53
extern ch_res * getmem_1();
extern ch_res * getmem_1_svc();
#define SETANT 54
extern int * setant_1();
extern int * setant_1_svc();
#define GETANT 55
extern ant_res * getant_1();
extern ant_res * getant_1_svc();
#define SETBANK 56
extern int * setbank_1();
extern int * setbank_1_svc();
#define SETPOWERSTAT 58
extern int * setpowerstat_1();
extern int * setpowerstat_1_svc();
#define GETPOWERSTAT 59
extern powerstat_res * getpowerstat_1();
extern powerstat_res * getpowerstat_1_svc();
extern int rigprog_1_freeresult ();
#endif /* K&R C */
@ -415,6 +686,11 @@ extern bool_t xdr_shortfreq_x (XDR *, shortfreq_x*);
extern bool_t xdr_setting_x (XDR *, setting_x*);
extern bool_t xdr_ant_x (XDR *, ant_x*);
extern bool_t xdr_ann_x (XDR *, ann_x*);
extern bool_t xdr_rptr_shift_x (XDR *, rptr_shift_x*);
extern bool_t xdr_tone_x (XDR *, tone_x*);
extern bool_t xdr_scan_x (XDR *, scan_x*);
extern bool_t xdr_reset_x (XDR *, reset_x*);
extern bool_t xdr_powerstat_x (XDR *, powerstat_x*);
extern bool_t xdr_mode_s (XDR *, mode_s*);
extern bool_t xdr_value_s (XDR *, value_s*);
extern bool_t xdr_freq_arg (XDR *, freq_arg*);
@ -422,6 +698,7 @@ extern bool_t xdr_freq_res (XDR *, freq_res*);
extern bool_t xdr_mode_arg (XDR *, mode_arg*);
extern bool_t xdr_mode_res (XDR *, mode_res*);
extern bool_t xdr_vfo_res (XDR *, vfo_res*);
extern bool_t xdr_powerstat_res (XDR *, powerstat_res*);
extern bool_t xdr_split_arg (XDR *, split_arg*);
extern bool_t xdr_split_res (XDR *, split_res*);
extern bool_t xdr_ptt_arg (XDR *, ptt_arg*);
@ -430,6 +707,19 @@ extern bool_t xdr_dcd_res (XDR *, dcd_res*);
extern bool_t xdr_setting_arg (XDR *, setting_arg*);
extern bool_t xdr_val_res (XDR *, val_res*);
extern bool_t xdr_vfo_op_arg (XDR *, vfo_op_arg*);
extern bool_t xdr_rptrshift_res (XDR *, rptrshift_res*);
extern bool_t xdr_rptrshift_arg (XDR *, rptrshift_arg*);
extern bool_t xdr_shortfreq_res (XDR *, shortfreq_res*);
extern bool_t xdr_shortfreq_arg (XDR *, shortfreq_arg*);
extern bool_t xdr_tone_res (XDR *, tone_res*);
extern bool_t xdr_tone_arg (XDR *, tone_arg*);
extern bool_t xdr_ant_res (XDR *, ant_res*);
extern bool_t xdr_ant_arg (XDR *, ant_arg*);
extern bool_t xdr_ch_res (XDR *, ch_res*);
extern bool_t xdr_ch_arg (XDR *, ch_arg*);
extern bool_t xdr_scan_s (XDR *, scan_s*);
extern bool_t xdr_scan_res (XDR *, scan_res*);
extern bool_t xdr_scan_arg (XDR *, scan_arg*);
extern bool_t xdr_freq_range_s (XDR *, freq_range_s*);
extern bool_t xdr_tuning_step_s (XDR *, tuning_step_s*);
extern bool_t xdr_filter_s (XDR *, filter_s*);
@ -451,6 +741,11 @@ extern bool_t xdr_shortfreq_x ();
extern bool_t xdr_setting_x ();
extern bool_t xdr_ant_x ();
extern bool_t xdr_ann_x ();
extern bool_t xdr_rptr_shift_x ();
extern bool_t xdr_tone_x ();
extern bool_t xdr_scan_x ();
extern bool_t xdr_reset_x ();
extern bool_t xdr_powerstat_x ();
extern bool_t xdr_mode_s ();
extern bool_t xdr_value_s ();
extern bool_t xdr_freq_arg ();
@ -458,6 +753,7 @@ extern bool_t xdr_freq_res ();
extern bool_t xdr_mode_arg ();
extern bool_t xdr_mode_res ();
extern bool_t xdr_vfo_res ();
extern bool_t xdr_powerstat_res ();
extern bool_t xdr_split_arg ();
extern bool_t xdr_split_res ();
extern bool_t xdr_ptt_arg ();
@ -466,6 +762,19 @@ extern bool_t xdr_dcd_res ();
extern bool_t xdr_setting_arg ();
extern bool_t xdr_val_res ();
extern bool_t xdr_vfo_op_arg ();
extern bool_t xdr_rptrshift_res ();
extern bool_t xdr_rptrshift_arg ();
extern bool_t xdr_shortfreq_res ();
extern bool_t xdr_shortfreq_arg ();
extern bool_t xdr_tone_res ();
extern bool_t xdr_tone_arg ();
extern bool_t xdr_ant_res ();
extern bool_t xdr_ant_arg ();
extern bool_t xdr_ch_res ();
extern bool_t xdr_ch_arg ();
extern bool_t xdr_scan_s ();
extern bool_t xdr_scan_res ();
extern bool_t xdr_scan_arg ();
extern bool_t xdr_freq_range_s ();
extern bool_t xdr_tuning_step_s ();
extern bool_t xdr_filter_s ();

Wyświetl plik

@ -1,8 +1,8 @@
%/*
% * Hamlib Interface - RPC definitions
% * Copyright (c) 2000,2001 by Stephane Fillod and Frank Singleton
% * Copyright (c) 2000-2002 by Stephane Fillod and Frank Singleton
% *
% * $Id: rpcrig.x,v 1.3 2001-12-27 21:52:07 fillods Exp $
% * $Id: rpcrig.x,v 1.4 2002-08-23 20:01:09 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
@ -39,6 +39,11 @@ typedef long shortfreq_x;
typedef unsigned hyper setting_x;
typedef long ant_x;
typedef long ann_x;
typedef int rptr_shift_x;
typedef int tone_x;
typedef long scan_x;
typedef long reset_x;
typedef long powerstat_x;
struct mode_s {
rmode_x mode;
@ -82,6 +87,13 @@ default:
void;
};
union powerstat_res switch (int rigstatus) {
case 0:
powerstat_x powerstat;
default:
void;
};
struct split_arg {
vfo_x vfo;
split_x split;
@ -125,9 +137,89 @@ default:
struct vfo_op_arg {
vfo_x vfo;
vfo_op_x op;
vfo_op_x vfo_op;
};
union rptrshift_res switch (int rigstatus) {
case 0:
rptr_shift_x rptrshift;
default:
void;
};
struct rptrshift_arg {
vfo_x vfo;
rptr_shift_x rptrshift;
};
union shortfreq_res switch (int rigstatus) {
case 0:
shortfreq_x shortfreq;
default:
void;
};
struct shortfreq_arg {
vfo_x vfo;
shortfreq_x shortfreq;
};
union tone_res switch (int rigstatus) {
case 0:
tone_x tone;
default:
void;
};
struct tone_arg {
vfo_x vfo;
tone_x tone;
};
union ant_res switch (int rigstatus) {
case 0:
ant_x ant;
default:
void;
};
struct ant_arg {
vfo_x vfo;
ant_x ant;
};
union ch_res switch (int rigstatus) {
case 0:
int ch;
default:
void;
};
struct ch_arg {
vfo_x vfo;
int ch;
};
struct scan_s {
scan_x scan;
int ch;
};
union scan_res switch (int rigstatus) {
case 0:
scan_s scan;
default:
void;
};
struct scan_arg {
vfo_x vfo;
scan_x scan;
int ch;
};
struct freq_range_s {
freq_x start;
freq_x end;
@ -216,6 +308,33 @@ program RIGPROG {
int SETPARM(setting_arg) = 29;
val_res GETPARM(setting_arg) = 30;
int VFOOP(vfo_op_arg) = 31;
int SETRPTRSHIFT(rptrshift_arg) = 32;
rptrshift_res GETRPTRSHIFT(vfo_x) = 33;
int SETRPTROFFS(shortfreq_arg) = 34;
shortfreq_res GETRPTROFFS(vfo_x) = 35;
int SETCTCSSTONE(tone_arg) = 36;
tone_res GETCTCSSTONE(vfo_x) = 37;
int SETCTCSSSQL(tone_arg) = 38;
tone_res GETCTCSSSQL(vfo_x) = 39;
int SETDCSCODE(tone_arg) = 40;
tone_res GETDCSCODE(vfo_x) = 41;
int SETDCSSQL(tone_arg) = 42;
tone_res GETDCSSQL(vfo_x) = 43;
int SETRIT(shortfreq_arg) = 44;
shortfreq_res GETRIT(vfo_x) = 45;
int SETXIT(shortfreq_arg) = 46;
shortfreq_res GETXIT(vfo_x) = 47;
int SETTS(shortfreq_arg) = 48;
shortfreq_res GETTS(vfo_x) = 49;
int SCAN(scan_arg) = 50;
int RESET(reset_x) = 51;
int SETMEM(ch_arg) = 52;
ch_res GETMEM(vfo_x) = 53;
int SETANT(ant_arg) = 54;
ant_res GETANT(vfo_x) = 55;
int SETBANK(ch_arg) = 56;
int SETPOWERSTAT(powerstat_x) = 58;
powerstat_res GETPOWERSTAT(void) = 59;
} = 1;
} = 0x20000099;

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib RPC backend - main file
* Copyright (c) 2001,2002 by Stephane Fillod
*
* $Id: rpcrig_backend.c,v 1.8 2002-08-16 17:43:02 fillods Exp $
* $Id: rpcrig_backend.c,v 1.9 2002-08-23 20:01:09 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
@ -48,6 +48,76 @@ struct rpcrig_priv_data {
CLIENT *cl;
};
#define SETBODY1(f, rpc_type, rig_arg) \
struct rpcrig_priv_data *priv; \
int *result; \
rpc_type##_x arg; \
\
priv = (struct rpcrig_priv_data*)rig->state.priv; \
\
arg = rig_arg; \
result = f##_1(&arg, priv->cl); \
if (result == NULL) { \
clnt_perror(priv->cl, "##f##_1"); \
return -RIG_EPROTO; \
} \
\
return *result;
#define GETBODY1(f, rpc_type, rig_arg) \
struct rpcrig_priv_data *priv; \
rpc_type##_x arg; \
rpc_type##_res *res; \
\
priv = (struct rpcrig_priv_data*)rig->state.priv; \
\
arg = *rig_arg; \
res = f##_1(&arg, priv->cl); \
if (res == NULL) { \
clnt_perror(priv->cl, "##f##_1"); \
return -RIG_EPROTO; \
} \
if (res->rigstatus == RIG_OK) \
*rig_arg = res->rpc_type##_res_u.rpc_type; \
\
return res->rigstatus;
#define SETBODYVFO1(f, rpc_type, rig_arg) \
struct rpcrig_priv_data *priv; \
int *result; \
rpc_type##_arg arg; \
\
priv = (struct rpcrig_priv_data*)rig->state.priv; \
\
arg.vfo = vfo; \
arg.rpc_type = rig_arg; \
result = f##_1(&arg, priv->cl); \
if (result == NULL) { \
clnt_perror(priv->cl, "##f##_1"); \
return -RIG_EPROTO; \
} \
\
return *result;
#define GETBODYVFO1(f, rpc_type, rig_arg) \
struct rpcrig_priv_data *priv; \
rpc_type##_res *res; \
vfo_x v; \
\
priv = (struct rpcrig_priv_data*)rig->state.priv; \
\
v = vfo; \
res = f##_1(&v, priv->cl); \
if (res == NULL) { \
clnt_perror(priv->cl, "##f##_1"); \
return -RIG_EPROTO; \
} \
if (res->rigstatus == RIG_OK) \
*rig_arg = res->rpc_type##_res_u.rpc_type; \
\
return res->rigstatus;
static int rpcrig_init(RIG *rig)
{
if (!rig || !rig->caps)
@ -186,41 +256,13 @@ static int rpcrig_close(RIG *rig)
static int rpcrig_set_vfo(RIG *rig, vfo_t vfo)
{
struct rpcrig_priv_data *priv;
int *result;
vfo_x varg;
priv = (struct rpcrig_priv_data*)rig->state.priv;
varg = vfo;
result = setvfo_1(&varg, priv->cl);
if (result == NULL) {
clnt_perror(priv->cl, "setvfo_1");
return -RIG_EPROTO;
}
return *result;
SETBODY1(setvfo, vfo, vfo);
}
static int rpcrig_get_vfo(RIG *rig, vfo_t *vfo)
{
struct rpcrig_priv_data *priv;
vfo_x v;
vfo_res *vres;
priv = (struct rpcrig_priv_data*)rig->state.priv;
v = *vfo;
vres = getvfo_1(&v, priv->cl);
if (vres == NULL) {
clnt_perror(priv->cl, "getvfo_1");
return -RIG_EPROTO;
}
if (vres->rigstatus == RIG_OK)
*vfo = vres->vfo_res_u.vfo;
return vres->rigstatus;
GETBODY1(getvfo, vfo, vfo);
}
@ -393,248 +435,139 @@ static int rpcrig_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, pbwidth_
static int rpcrig_set_split(RIG *rig, vfo_t vfo, split_t split)
{
struct rpcrig_priv_data *priv;
int *result;
split_arg sarg;
priv = (struct rpcrig_priv_data*)rig->state.priv;
sarg.vfo = vfo;
sarg.split = split;
result = setsplit_1(&sarg, priv->cl);
if (result == NULL) {
clnt_perror(priv->cl, "setsplit_1");
return -RIG_EPROTO;
}
return *result;
SETBODYVFO1(setsplit, split, split);
}
static int rpcrig_get_split(RIG *rig, vfo_t vfo, split_t *split)
{
struct rpcrig_priv_data *priv;
split_res *sres;
vfo_x v;
priv = (struct rpcrig_priv_data*)rig->state.priv;
v = vfo;
sres = getsplit_1(&v, priv->cl);
if (sres == NULL) {
clnt_perror(priv->cl, "getsplit_1");
return -RIG_EPROTO;
}
if (sres->rigstatus == RIG_OK)
*split = sres->split_res_u.split;
return sres->rigstatus;
GETBODYVFO1(getsplit, split, split);
}
static int rpcrig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
{
struct rpcrig_priv_data *priv;
int *result;
ptt_arg arg;
priv = (struct rpcrig_priv_data*)rig->state.priv;
arg.vfo = vfo;
arg.ptt = ptt;
result = setptt_1(&arg, priv->cl);
if (result == NULL) {
clnt_perror(priv->cl, "setptt_1");
return -RIG_EPROTO;
}
return *result;
SETBODYVFO1(setptt, ptt, ptt);
}
static int rpcrig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
{
struct rpcrig_priv_data *priv;
ptt_res *res;
vfo_x v;
priv = (struct rpcrig_priv_data*)rig->state.priv;
v = vfo;
res = getptt_1(&v, priv->cl);
if (res == NULL) {
clnt_perror(priv->cl, "getptt_1");
return -RIG_EPROTO;
}
if (res->rigstatus == RIG_OK)
*ptt = res->ptt_res_u.ptt;
return res->rigstatus;
GETBODYVFO1(getptt, ptt, ptt);
}
static int rpcrig_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
{
struct rpcrig_priv_data *priv;
dcd_res *res;
vfo_x v;
priv = (struct rpcrig_priv_data*)rig->state.priv;
v = vfo;
res = getdcd_1(&v, priv->cl);
if (res == NULL) {
clnt_perror(priv->cl, "getdcd_1");
return -RIG_EPROTO;
}
if (res->rigstatus == RIG_OK)
*dcd = res->dcd_res_u.dcd;
return res->rigstatus;
GETBODYVFO1(getdcd, dcd, dcd);
}
static int rpcrig_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift)
{
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
return -RIG_ENIMPL;
SETBODYVFO1(setrptrshift, rptrshift, rptr_shift);
}
static int rpcrig_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift)
{
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
return -RIG_ENIMPL;
GETBODYVFO1(getrptrshift, rptrshift, rptr_shift);
}
static int rpcrig_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs)
{
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
return -RIG_ENIMPL;
SETBODYVFO1(setrptroffs, shortfreq, rptr_offs);
}
static int rpcrig_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs)
{
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
return -RIG_ENIMPL;
GETBODYVFO1(getrptroffs, shortfreq, rptr_offs);
}
static int rpcrig_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
{
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
return -RIG_ENIMPL;
SETBODYVFO1(setctcsstone, tone, tone);
}
static int rpcrig_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone)
{
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
return -RIG_ENIMPL;
GETBODYVFO1(getctcsstone, tone, tone);
}
static int rpcrig_set_dcs_code(RIG *rig, vfo_t vfo, tone_t code)
{
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
return -RIG_ENIMPL;
SETBODYVFO1(setdcscode, tone, code);
}
static int rpcrig_get_dcs_code(RIG *rig, vfo_t vfo, tone_t *code)
{
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
return -RIG_ENIMPL;
GETBODYVFO1(getdcscode, tone, code);
}
static int rpcrig_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone)
{
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
return -RIG_ENIMPL;
SETBODYVFO1(setctcsssql, tone, tone);
}
static int rpcrig_get_ctcss_sql(RIG *rig, vfo_t vfo, tone_t *tone)
{
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
return -RIG_ENIMPL;
GETBODYVFO1(getctcsssql, tone, tone);
}
static int rpcrig_set_dcs_sql(RIG *rig, vfo_t vfo, unsigned int code)
{
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
return -RIG_ENIMPL;
SETBODYVFO1(setdcssql, tone, code);
}
static int rpcrig_get_dcs_sql(RIG *rig, vfo_t vfo, unsigned int *code)
{
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
return -RIG_ENIMPL;
GETBODYVFO1(getdcssql, tone, code);
}
static int rpcrig_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit)
{
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
return -RIG_ENIMPL;
SETBODYVFO1(setrit, shortfreq, rit);
}
static int rpcrig_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit)
{
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
return -RIG_ENIMPL;
GETBODYVFO1(getrit, shortfreq, rit);
}
static int rpcrig_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit)
{
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
return -RIG_ENIMPL;
SETBODYVFO1(setxit, shortfreq, xit);
}
static int rpcrig_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit)
{
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
return -RIG_ENIMPL;
GETBODYVFO1(getxit, shortfreq, xit);
}
static int rpcrig_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts)
{
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
return -RIG_ENIMPL;
SETBODYVFO1(setts, shortfreq, ts);
}
static int rpcrig_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts)
{
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
return -RIG_ENIMPL;
GETBODYVFO1(getts, shortfreq, ts);
}
@ -787,78 +720,58 @@ static int rpcrig_get_parm(RIG *rig, setting_t parm, value_t *val)
return res->rigstatus;
}
static int rpcrig_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
static int rpcrig_scan(RIG *rig, vfo_t vfo, scan_t rscan, int ch)
{
struct rpcrig_priv_data *priv;
int *result;
vfo_op_arg arg;
scan_arg arg;
priv = (struct rpcrig_priv_data*)rig->state.priv;
arg.vfo = vfo;
arg.op = op;
result = vfoop_1(&arg, priv->cl);
arg.scan = rscan;
arg.ch = ch;
result = scan_1(&arg, priv->cl);
if (result == NULL) {
clnt_perror(priv->cl, "vfoop_1");
clnt_perror(priv->cl, "scan_1");
return -RIG_EPROTO;
}
return *result;
}
static int rpcrig_set_powerstat(RIG *rig, powerstat_t status)
static int rpcrig_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
{
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
return -RIG_ENIMPL;
SETBODYVFO1(vfoop, vfo_op, op);
}
static int rpcrig_get_powerstat(RIG *rig, powerstat_t *status)
{
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
return -RIG_ENIMPL;
}
static int rpcrig_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
{
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
return -RIG_ENIMPL;
SETBODYVFO1(setant, ant, ant);
}
static int rpcrig_get_ant(RIG *rig, vfo_t vfo, ant_t *ant)
{
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
return -RIG_ENIMPL;
GETBODYVFO1(getant, ant, ant);
}
static int rpcrig_set_bank(RIG *rig, vfo_t vfo, int bank)
{
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
return -RIG_ENIMPL;
SETBODYVFO1(setbank, ch, bank);
}
static int rpcrig_set_mem(RIG *rig, vfo_t vfo, int ch)
{
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
return -RIG_ENIMPL;
SETBODYVFO1(setmem, ch, ch);
}
static int rpcrig_get_mem(RIG *rig, vfo_t vfo, int *ch)
{
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
return -RIG_ENIMPL;
GETBODYVFO1(getmem, ch, ch);
}
@ -878,6 +791,23 @@ static int rpcrig_get_channel(RIG *rig, channel_t *chan)
}
static int rpcrig_reset(RIG *rig, reset_t reset)
{
SETBODY1(reset, reset, reset);
}
static int rpcrig_set_powerstat(RIG *rig, powerstat_t status)
{
SETBODY1(setpowerstat, powerstat, status);
}
static int rpcrig_get_powerstat(RIG *rig, powerstat_t *status)
{
GETBODY1(getpowerstat, powerstat, status);
}
static int rpcrig_set_trn(RIG *rig, int trn)
{
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
@ -932,9 +862,9 @@ struct rig_caps rpcrig_caps = {
.rig_model = RIG_MODEL_RPC,
.model_name = "RPC rig",
.mfg_name = "Hamlib",
.version = "0.1",
.version = "0.2",
.copyright = "LGPL",
.status = RIG_STATUS_NEW,
.status = RIG_STATUS_ALPHA,
.rig_type = RIG_TYPE_OTHER,
.targetable_vfo = 0,
.ptt_type = RIG_PTT_NONE,
@ -1020,6 +950,8 @@ struct rig_caps rpcrig_caps = {
.get_channel = rpcrig_get_channel,
.set_trn = rpcrig_set_trn,
.get_trn = rpcrig_get_trn,
.scan = rpcrig_scan,
.reset = rpcrig_reset,
};
int initrigs_rpcrig(void *be_handle)

Wyświetl plik

@ -7,9 +7,9 @@
#include "rpcrig.h"
/*
* Hamlib Interface - RPC definitions
* Copyright (c) 2000,2001 by Stephane Fillod and Frank Singleton
* Copyright (c) 2000-2002 by Stephane Fillod and Frank Singleton
*
* $Id: rpcrig_clnt.c,v 1.3 2001-12-27 21:58:47 fillods Exp $
* $Id: rpcrig_clnt.c,v 1.4 2002-08-23 20:01:09 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
@ -389,3 +389,408 @@ vfoop_1(vfo_op_arg *argp, CLIENT *clnt)
}
return (&clnt_res);
}
int *
setrptrshift_1(rptrshift_arg *argp, CLIENT *clnt)
{
static int clnt_res;
memset((char *)&clnt_res, 0, sizeof(clnt_res));
if (clnt_call (clnt, SETRPTRSHIFT,
(xdrproc_t) xdr_rptrshift_arg, (caddr_t) argp,
(xdrproc_t) xdr_int, (caddr_t) &clnt_res,
TIMEOUT) != RPC_SUCCESS) {
return (NULL);
}
return (&clnt_res);
}
rptrshift_res *
getrptrshift_1(vfo_x *argp, CLIENT *clnt)
{
static rptrshift_res clnt_res;
memset((char *)&clnt_res, 0, sizeof(clnt_res));
if (clnt_call (clnt, GETRPTRSHIFT,
(xdrproc_t) xdr_vfo_x, (caddr_t) argp,
(xdrproc_t) xdr_rptrshift_res, (caddr_t) &clnt_res,
TIMEOUT) != RPC_SUCCESS) {
return (NULL);
}
return (&clnt_res);
}
int *
setrptroffs_1(shortfreq_arg *argp, CLIENT *clnt)
{
static int clnt_res;
memset((char *)&clnt_res, 0, sizeof(clnt_res));
if (clnt_call (clnt, SETRPTROFFS,
(xdrproc_t) xdr_shortfreq_arg, (caddr_t) argp,
(xdrproc_t) xdr_int, (caddr_t) &clnt_res,
TIMEOUT) != RPC_SUCCESS) {
return (NULL);
}
return (&clnt_res);
}
shortfreq_res *
getrptroffs_1(vfo_x *argp, CLIENT *clnt)
{
static shortfreq_res clnt_res;
memset((char *)&clnt_res, 0, sizeof(clnt_res));
if (clnt_call (clnt, GETRPTROFFS,
(xdrproc_t) xdr_vfo_x, (caddr_t) argp,
(xdrproc_t) xdr_shortfreq_res, (caddr_t) &clnt_res,
TIMEOUT) != RPC_SUCCESS) {
return (NULL);
}
return (&clnt_res);
}
int *
setctcsstone_1(tone_arg *argp, CLIENT *clnt)
{
static int clnt_res;
memset((char *)&clnt_res, 0, sizeof(clnt_res));
if (clnt_call (clnt, SETCTCSSTONE,
(xdrproc_t) xdr_tone_arg, (caddr_t) argp,
(xdrproc_t) xdr_int, (caddr_t) &clnt_res,
TIMEOUT) != RPC_SUCCESS) {
return (NULL);
}
return (&clnt_res);
}
tone_res *
getctcsstone_1(vfo_x *argp, CLIENT *clnt)
{
static tone_res clnt_res;
memset((char *)&clnt_res, 0, sizeof(clnt_res));
if (clnt_call (clnt, GETCTCSSTONE,
(xdrproc_t) xdr_vfo_x, (caddr_t) argp,
(xdrproc_t) xdr_tone_res, (caddr_t) &clnt_res,
TIMEOUT) != RPC_SUCCESS) {
return (NULL);
}
return (&clnt_res);
}
int *
setctcsssql_1(tone_arg *argp, CLIENT *clnt)
{
static int clnt_res;
memset((char *)&clnt_res, 0, sizeof(clnt_res));
if (clnt_call (clnt, SETCTCSSSQL,
(xdrproc_t) xdr_tone_arg, (caddr_t) argp,
(xdrproc_t) xdr_int, (caddr_t) &clnt_res,
TIMEOUT) != RPC_SUCCESS) {
return (NULL);
}
return (&clnt_res);
}
tone_res *
getctcsssql_1(vfo_x *argp, CLIENT *clnt)
{
static tone_res clnt_res;
memset((char *)&clnt_res, 0, sizeof(clnt_res));
if (clnt_call (clnt, GETCTCSSSQL,
(xdrproc_t) xdr_vfo_x, (caddr_t) argp,
(xdrproc_t) xdr_tone_res, (caddr_t) &clnt_res,
TIMEOUT) != RPC_SUCCESS) {
return (NULL);
}
return (&clnt_res);
}
int *
setdcscode_1(tone_arg *argp, CLIENT *clnt)
{
static int clnt_res;
memset((char *)&clnt_res, 0, sizeof(clnt_res));
if (clnt_call (clnt, SETDCSCODE,
(xdrproc_t) xdr_tone_arg, (caddr_t) argp,
(xdrproc_t) xdr_int, (caddr_t) &clnt_res,
TIMEOUT) != RPC_SUCCESS) {
return (NULL);
}
return (&clnt_res);
}
tone_res *
getdcscode_1(vfo_x *argp, CLIENT *clnt)
{
static tone_res clnt_res;
memset((char *)&clnt_res, 0, sizeof(clnt_res));
if (clnt_call (clnt, GETDCSCODE,
(xdrproc_t) xdr_vfo_x, (caddr_t) argp,
(xdrproc_t) xdr_tone_res, (caddr_t) &clnt_res,
TIMEOUT) != RPC_SUCCESS) {
return (NULL);
}
return (&clnt_res);
}
int *
setdcssql_1(tone_arg *argp, CLIENT *clnt)
{
static int clnt_res;
memset((char *)&clnt_res, 0, sizeof(clnt_res));
if (clnt_call (clnt, SETDCSSQL,
(xdrproc_t) xdr_tone_arg, (caddr_t) argp,
(xdrproc_t) xdr_int, (caddr_t) &clnt_res,
TIMEOUT) != RPC_SUCCESS) {
return (NULL);
}
return (&clnt_res);
}
tone_res *
getdcssql_1(vfo_x *argp, CLIENT *clnt)
{
static tone_res clnt_res;
memset((char *)&clnt_res, 0, sizeof(clnt_res));
if (clnt_call (clnt, GETDCSSQL,
(xdrproc_t) xdr_vfo_x, (caddr_t) argp,
(xdrproc_t) xdr_tone_res, (caddr_t) &clnt_res,
TIMEOUT) != RPC_SUCCESS) {
return (NULL);
}
return (&clnt_res);
}
int *
setrit_1(shortfreq_arg *argp, CLIENT *clnt)
{
static int clnt_res;
memset((char *)&clnt_res, 0, sizeof(clnt_res));
if (clnt_call (clnt, SETRIT,
(xdrproc_t) xdr_shortfreq_arg, (caddr_t) argp,
(xdrproc_t) xdr_int, (caddr_t) &clnt_res,
TIMEOUT) != RPC_SUCCESS) {
return (NULL);
}
return (&clnt_res);
}
shortfreq_res *
getrit_1(vfo_x *argp, CLIENT *clnt)
{
static shortfreq_res clnt_res;
memset((char *)&clnt_res, 0, sizeof(clnt_res));
if (clnt_call (clnt, GETRIT,
(xdrproc_t) xdr_vfo_x, (caddr_t) argp,
(xdrproc_t) xdr_shortfreq_res, (caddr_t) &clnt_res,
TIMEOUT) != RPC_SUCCESS) {
return (NULL);
}
return (&clnt_res);
}
int *
setxit_1(shortfreq_arg *argp, CLIENT *clnt)
{
static int clnt_res;
memset((char *)&clnt_res, 0, sizeof(clnt_res));
if (clnt_call (clnt, SETXIT,
(xdrproc_t) xdr_shortfreq_arg, (caddr_t) argp,
(xdrproc_t) xdr_int, (caddr_t) &clnt_res,
TIMEOUT) != RPC_SUCCESS) {
return (NULL);
}
return (&clnt_res);
}
shortfreq_res *
getxit_1(vfo_x *argp, CLIENT *clnt)
{
static shortfreq_res clnt_res;
memset((char *)&clnt_res, 0, sizeof(clnt_res));
if (clnt_call (clnt, GETXIT,
(xdrproc_t) xdr_vfo_x, (caddr_t) argp,
(xdrproc_t) xdr_shortfreq_res, (caddr_t) &clnt_res,
TIMEOUT) != RPC_SUCCESS) {
return (NULL);
}
return (&clnt_res);
}
int *
setts_1(shortfreq_arg *argp, CLIENT *clnt)
{
static int clnt_res;
memset((char *)&clnt_res, 0, sizeof(clnt_res));
if (clnt_call (clnt, SETTS,
(xdrproc_t) xdr_shortfreq_arg, (caddr_t) argp,
(xdrproc_t) xdr_int, (caddr_t) &clnt_res,
TIMEOUT) != RPC_SUCCESS) {
return (NULL);
}
return (&clnt_res);
}
shortfreq_res *
getts_1(vfo_x *argp, CLIENT *clnt)
{
static shortfreq_res clnt_res;
memset((char *)&clnt_res, 0, sizeof(clnt_res));
if (clnt_call (clnt, GETTS,
(xdrproc_t) xdr_vfo_x, (caddr_t) argp,
(xdrproc_t) xdr_shortfreq_res, (caddr_t) &clnt_res,
TIMEOUT) != RPC_SUCCESS) {
return (NULL);
}
return (&clnt_res);
}
int *
scan_1(scan_arg *argp, CLIENT *clnt)
{
static int clnt_res;
memset((char *)&clnt_res, 0, sizeof(clnt_res));
if (clnt_call (clnt, SCAN,
(xdrproc_t) xdr_scan_arg, (caddr_t) argp,
(xdrproc_t) xdr_int, (caddr_t) &clnt_res,
TIMEOUT) != RPC_SUCCESS) {
return (NULL);
}
return (&clnt_res);
}
int *
reset_1(reset_x *argp, CLIENT *clnt)
{
static int clnt_res;
memset((char *)&clnt_res, 0, sizeof(clnt_res));
if (clnt_call (clnt, RESET,
(xdrproc_t) xdr_reset_x, (caddr_t) argp,
(xdrproc_t) xdr_int, (caddr_t) &clnt_res,
TIMEOUT) != RPC_SUCCESS) {
return (NULL);
}
return (&clnt_res);
}
int *
setmem_1(ch_arg *argp, CLIENT *clnt)
{
static int clnt_res;
memset((char *)&clnt_res, 0, sizeof(clnt_res));
if (clnt_call (clnt, SETMEM,
(xdrproc_t) xdr_ch_arg, (caddr_t) argp,
(xdrproc_t) xdr_int, (caddr_t) &clnt_res,
TIMEOUT) != RPC_SUCCESS) {
return (NULL);
}
return (&clnt_res);
}
ch_res *
getmem_1(vfo_x *argp, CLIENT *clnt)
{
static ch_res clnt_res;
memset((char *)&clnt_res, 0, sizeof(clnt_res));
if (clnt_call (clnt, GETMEM,
(xdrproc_t) xdr_vfo_x, (caddr_t) argp,
(xdrproc_t) xdr_ch_res, (caddr_t) &clnt_res,
TIMEOUT) != RPC_SUCCESS) {
return (NULL);
}
return (&clnt_res);
}
int *
setant_1(ant_arg *argp, CLIENT *clnt)
{
static int clnt_res;
memset((char *)&clnt_res, 0, sizeof(clnt_res));
if (clnt_call (clnt, SETANT,
(xdrproc_t) xdr_ant_arg, (caddr_t) argp,
(xdrproc_t) xdr_int, (caddr_t) &clnt_res,
TIMEOUT) != RPC_SUCCESS) {
return (NULL);
}
return (&clnt_res);
}
ant_res *
getant_1(vfo_x *argp, CLIENT *clnt)
{
static ant_res clnt_res;
memset((char *)&clnt_res, 0, sizeof(clnt_res));
if (clnt_call (clnt, GETANT,
(xdrproc_t) xdr_vfo_x, (caddr_t) argp,
(xdrproc_t) xdr_ant_res, (caddr_t) &clnt_res,
TIMEOUT) != RPC_SUCCESS) {
return (NULL);
}
return (&clnt_res);
}
int *
setbank_1(ch_arg *argp, CLIENT *clnt)
{
static int clnt_res;
memset((char *)&clnt_res, 0, sizeof(clnt_res));
if (clnt_call (clnt, SETBANK,
(xdrproc_t) xdr_ch_arg, (caddr_t) argp,
(xdrproc_t) xdr_int, (caddr_t) &clnt_res,
TIMEOUT) != RPC_SUCCESS) {
return (NULL);
}
return (&clnt_res);
}
int *
setpowerstat_1(powerstat_x *argp, CLIENT *clnt)
{
static int clnt_res;
memset((char *)&clnt_res, 0, sizeof(clnt_res));
if (clnt_call (clnt, SETPOWERSTAT,
(xdrproc_t) xdr_powerstat_x, (caddr_t) argp,
(xdrproc_t) xdr_int, (caddr_t) &clnt_res,
TIMEOUT) != RPC_SUCCESS) {
return (NULL);
}
return (&clnt_res);
}
powerstat_res *
getpowerstat_1(void *argp, CLIENT *clnt)
{
static powerstat_res clnt_res;
memset((char *)&clnt_res, 0, sizeof(clnt_res));
if (clnt_call (clnt, GETPOWERSTAT,
(xdrproc_t) xdr_void, (caddr_t) argp,
(xdrproc_t) xdr_powerstat_res, (caddr_t) &clnt_res,
TIMEOUT) != RPC_SUCCESS) {
return (NULL);
}
return (&clnt_res);
}

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib RPC server - procedures
* Copyright (c) 2001-2002 by Stephane Fillod
*
* $Id: rpcrig_proc.c,v 1.5 2002-07-08 22:53:26 fillods Exp $
* $Id: rpcrig_proc.c,v 1.6 2002-08-23 20:01:09 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
@ -38,6 +38,53 @@
extern RIG *the_rpc_rig;
/* without VFO arg */
#define DECLARESET1(f, rig_f, rpc_type) \
int * f##_1_svc(rpc_type *arg, struct svc_req *svc) \
{ \
static int res; \
\
res = rig_f(the_rpc_rig, *arg); \
\
return &res; \
}
#define DECLAREGET1(f, rig_f, rpc_type, rig_type) \
rpc_type##_res *f##_1_svc(void *rpc_arg, struct svc_req *svc) \
{ \
static rpc_type##_res res; \
rig_type arg; \
\
res.rigstatus = rig_f(the_rpc_rig, &arg); \
res.rpc_type##_res_u.rpc_type = arg; \
\
return &res; \
}
/* with VFO arg */
#define DECLARESETV1(f, rig_f, rpc_type) \
int *f##_1_svc(rpc_type##_arg *arg, struct svc_req *svc) \
{ \
static int res; \
\
res = rig_f(the_rpc_rig, arg->vfo, arg->rpc_type); \
\
return &res; \
}
#define DECLAREGETV1(f, rig_f, rpc_type, rig_type) \
rpc_type##_res *f##_1_svc(vfo_x *vfo, struct svc_req *svc) \
{ \
static rpc_type##_res res; \
rig_type arg; \
\
res.rigstatus = rig_f(the_rpc_rig, *vfo, &arg); \
res.rpc_type##_res_u.rpc_type = arg; \
\
return &res; \
}
model_x *getmodel_1_svc(void *arg, struct svc_req *svc)
{
static model_x res;
@ -144,21 +191,14 @@ mode_res *getmode_1_svc(vfo_x *vfo, struct svc_req *svc)
return &res;
}
int *setvfo_1_svc(vfo_x *varg, struct svc_req *svc)
{
static int res;
res = rig_set_vfo(the_rpc_rig, *varg);
return &res;
}
DECLARESET1(setvfo, rig_set_vfo, vfo_x)
vfo_res *getvfo_1_svc(vfo_x *vfo, struct svc_req *svc)
{
static vfo_res res;
vfo_t v;
v = *vfo;
v = *vfo; /* NB: arg vfo is also input argument to get_vfo */
res.rigstatus = rig_get_vfo(the_rpc_rig, &v);
res.vfo_res_u.vfo = v;
@ -209,56 +249,12 @@ mode_res *getsplitmode_1_svc(vfo_x *vfo, struct svc_req *svc)
return &res;
}
int *setsplit_1_svc(split_arg *sarg, struct svc_req *svc)
{
static int res;
DECLARESETV1(setsplit, rig_set_split, split)
DECLAREGETV1(getsplit, rig_get_split, split, split_t)
res = rig_set_split(the_rpc_rig, sarg->vfo, sarg->split);
return &res;
}
split_res *getsplit_1_svc(vfo_x *vfo, struct svc_req *svc)
{
static split_res res;
split_t s;
res.rigstatus = rig_get_split(the_rpc_rig, *vfo, &s);
res.split_res_u.split = s;
return &res;
}
int *setptt_1_svc(ptt_arg *arg, struct svc_req *svc)
{
static int res;
res = rig_set_ptt(the_rpc_rig, arg->vfo, arg->ptt);
return &res;
}
ptt_res *getptt_1_svc(vfo_x *vfo, struct svc_req *svc)
{
static ptt_res res;
ptt_t p;
res.rigstatus = rig_get_ptt(the_rpc_rig, *vfo, &p);
res.ptt_res_u.ptt = p;
return &res;
}
dcd_res *getdcd_1_svc(vfo_x *vfo, struct svc_req *svc)
{
static dcd_res res;
dcd_t d;
res.rigstatus = rig_get_dcd(the_rpc_rig, *vfo, &d);
res.dcd_res_u.dcd = d;
return &res;
}
DECLARESETV1(setptt, rig_set_ptt, ptt)
DECLAREGETV1(getptt, rig_get_ptt, ptt, ptt_t)
DECLAREGETV1(getdcd, rig_get_dcd, dcd, dcd_t)
int *setlevel_1_svc(setting_arg *arg, struct svc_req *svc)
{
@ -305,7 +301,7 @@ int *setparm_1_svc(setting_arg *arg, struct svc_req *svc)
value_t val;
setting = setting_x2t(&arg->setting);
if (RIG_LEVEL_IS_FLOAT(setting))
if (RIG_PARM_IS_FLOAT(setting))
val.f = arg->val.f;
else
val.i = arg->val.i;
@ -322,13 +318,13 @@ val_res *getparm_1_svc(setting_arg *arg, struct svc_req *svc)
value_t val;
setting = setting_x2t(&arg->setting);
if (RIG_LEVEL_IS_FLOAT(setting))
if (RIG_PARM_IS_FLOAT(setting))
val.f = arg->val.f;
else
val.i = arg->val.i;
res.rigstatus = rig_get_parm(the_rpc_rig, setting, &val);
if (RIG_LEVEL_IS_FLOAT(setting))
if (RIG_PARM_IS_FLOAT(setting))
res.val_res_u.val.f = val.f;
else
res.val_res_u.val.i = val.i;
@ -355,24 +351,52 @@ val_res *getfunc_1_svc(setting_arg *arg, struct svc_req *svc)
value_t val;
setting = setting_x2t(&arg->setting);
if (RIG_LEVEL_IS_FLOAT(setting))
val.f = arg->val.f;
else
val.i = arg->val.i;
val.i = arg->val.i;
res.rigstatus = rig_get_func(the_rpc_rig, arg->vfo, setting,
&res.val_res_u.val.i);
return &res;
}
int *vfoop_1_svc(vfo_op_arg *arg, struct svc_req *svc)
int *scan_1_svc(scan_arg *arg, struct svc_req *svc)
{
static int res;
res = rig_vfo_op(the_rpc_rig, arg->vfo, arg->op);
res = rig_scan(the_rpc_rig, arg->vfo, arg->scan, arg->ch);
return &res;
}
DECLARESETV1(vfoop, rig_vfo_op, vfo_op)
DECLARESETV1(setrptrshift, rig_set_rptr_shift, rptrshift)
DECLAREGETV1(getrptrshift, rig_get_rptr_shift, rptrshift, rptr_shift_t)
DECLARESETV1(setrptroffs, rig_set_rptr_offs, shortfreq)
DECLAREGETV1(getrptroffs, rig_get_rptr_offs, shortfreq, shortfreq_t)
DECLARESETV1(setctcsstone, rig_set_ctcss_tone, tone)
DECLAREGETV1(getctcsstone, rig_get_ctcss_tone, tone, tone_t)
DECLARESETV1(setctcsssql, rig_set_ctcss_sql, tone)
DECLAREGETV1(getctcsssql, rig_get_ctcss_sql, tone, tone_t)
DECLARESETV1(setdcscode, rig_set_dcs_code, tone)
DECLAREGETV1(getdcscode, rig_get_dcs_code, tone, tone_t)
DECLARESETV1(setdcssql, rig_set_dcs_sql, tone)
DECLAREGETV1(getdcssql, rig_get_dcs_sql, tone, tone_t)
DECLARESETV1(setrit, rig_set_rit, shortfreq)
DECLAREGETV1(getrit, rig_get_rit, shortfreq, shortfreq_t)
DECLARESETV1(setxit, rig_set_xit, shortfreq)
DECLAREGETV1(getxit, rig_get_xit, shortfreq, shortfreq_t)
DECLARESETV1(setts, rig_set_ts, shortfreq)
DECLAREGETV1(getts, rig_get_ts, shortfreq, shortfreq_t)
DECLARESETV1(setant, rig_set_ant, ant)
DECLAREGETV1(getant, rig_get_ant, ant, ant_t)
DECLARESETV1(setmem, rig_set_mem, ch)
DECLAREGETV1(getmem, rig_get_mem, ch, int)
DECLARESETV1(setbank, rig_set_bank, ch)
DECLARESET1(reset, rig_reset, reset_x)
DECLARESET1(setpowerstat, rig_set_powerstat, powerstat_x)
DECLAREGET1(getpowerstat, rig_get_powerstat, powerstat, powerstat_t)

Wyświetl plik

@ -17,9 +17,9 @@
#endif
/*
* Hamlib Interface - RPC definitions
* Copyright (c) 2000,2001 by Stephane Fillod and Frank Singleton
* Copyright (c) 2000-2002 by Stephane Fillod and Frank Singleton
*
* $Id: rpcrig_svc.c,v 1.3 2001-12-27 21:58:47 fillods Exp $
* $Id: rpcrig_svc.c,v 1.4 2002-08-23 20:01:09 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
@ -63,6 +63,32 @@ rigprog_1(struct svc_req *rqstp, register SVCXPRT *transp)
setting_arg setparm_1_arg;
setting_arg getparm_1_arg;
vfo_op_arg vfoop_1_arg;
rptrshift_arg setrptrshift_1_arg;
vfo_x getrptrshift_1_arg;
shortfreq_arg setrptroffs_1_arg;
vfo_x getrptroffs_1_arg;
tone_arg setctcsstone_1_arg;
vfo_x getctcsstone_1_arg;
tone_arg setctcsssql_1_arg;
vfo_x getctcsssql_1_arg;
tone_arg setdcscode_1_arg;
vfo_x getdcscode_1_arg;
tone_arg setdcssql_1_arg;
vfo_x getdcssql_1_arg;
shortfreq_arg setrit_1_arg;
vfo_x getrit_1_arg;
shortfreq_arg setxit_1_arg;
vfo_x getxit_1_arg;
shortfreq_arg setts_1_arg;
vfo_x getts_1_arg;
scan_arg scan_1_arg;
reset_x reset_1_arg;
ch_arg setmem_1_arg;
vfo_x getmem_1_arg;
ant_arg setant_1_arg;
vfo_x getant_1_arg;
ch_arg setbank_1_arg;
powerstat_x setpowerstat_1_arg;
} argument;
char *result;
xdrproc_t _xdr_argument, _xdr_result;
@ -217,6 +243,168 @@ rigprog_1(struct svc_req *rqstp, register SVCXPRT *transp)
local = (char *(*)(char *, struct svc_req *)) vfoop_1_svc;
break;
case SETRPTRSHIFT:
_xdr_argument = (xdrproc_t) xdr_rptrshift_arg;
_xdr_result = (xdrproc_t) xdr_int;
local = (char *(*)(char *, struct svc_req *)) setrptrshift_1_svc;
break;
case GETRPTRSHIFT:
_xdr_argument = (xdrproc_t) xdr_vfo_x;
_xdr_result = (xdrproc_t) xdr_rptrshift_res;
local = (char *(*)(char *, struct svc_req *)) getrptrshift_1_svc;
break;
case SETRPTROFFS:
_xdr_argument = (xdrproc_t) xdr_shortfreq_arg;
_xdr_result = (xdrproc_t) xdr_int;
local = (char *(*)(char *, struct svc_req *)) setrptroffs_1_svc;
break;
case GETRPTROFFS:
_xdr_argument = (xdrproc_t) xdr_vfo_x;
_xdr_result = (xdrproc_t) xdr_shortfreq_res;
local = (char *(*)(char *, struct svc_req *)) getrptroffs_1_svc;
break;
case SETCTCSSTONE:
_xdr_argument = (xdrproc_t) xdr_tone_arg;
_xdr_result = (xdrproc_t) xdr_int;
local = (char *(*)(char *, struct svc_req *)) setctcsstone_1_svc;
break;
case GETCTCSSTONE:
_xdr_argument = (xdrproc_t) xdr_vfo_x;
_xdr_result = (xdrproc_t) xdr_tone_res;
local = (char *(*)(char *, struct svc_req *)) getctcsstone_1_svc;
break;
case SETCTCSSSQL:
_xdr_argument = (xdrproc_t) xdr_tone_arg;
_xdr_result = (xdrproc_t) xdr_int;
local = (char *(*)(char *, struct svc_req *)) setctcsssql_1_svc;
break;
case GETCTCSSSQL:
_xdr_argument = (xdrproc_t) xdr_vfo_x;
_xdr_result = (xdrproc_t) xdr_tone_res;
local = (char *(*)(char *, struct svc_req *)) getctcsssql_1_svc;
break;
case SETDCSCODE:
_xdr_argument = (xdrproc_t) xdr_tone_arg;
_xdr_result = (xdrproc_t) xdr_int;
local = (char *(*)(char *, struct svc_req *)) setdcscode_1_svc;
break;
case GETDCSCODE:
_xdr_argument = (xdrproc_t) xdr_vfo_x;
_xdr_result = (xdrproc_t) xdr_tone_res;
local = (char *(*)(char *, struct svc_req *)) getdcscode_1_svc;
break;
case SETDCSSQL:
_xdr_argument = (xdrproc_t) xdr_tone_arg;
_xdr_result = (xdrproc_t) xdr_int;
local = (char *(*)(char *, struct svc_req *)) setdcssql_1_svc;
break;
case GETDCSSQL:
_xdr_argument = (xdrproc_t) xdr_vfo_x;
_xdr_result = (xdrproc_t) xdr_tone_res;
local = (char *(*)(char *, struct svc_req *)) getdcssql_1_svc;
break;
case SETRIT:
_xdr_argument = (xdrproc_t) xdr_shortfreq_arg;
_xdr_result = (xdrproc_t) xdr_int;
local = (char *(*)(char *, struct svc_req *)) setrit_1_svc;
break;
case GETRIT:
_xdr_argument = (xdrproc_t) xdr_vfo_x;
_xdr_result = (xdrproc_t) xdr_shortfreq_res;
local = (char *(*)(char *, struct svc_req *)) getrit_1_svc;
break;
case SETXIT:
_xdr_argument = (xdrproc_t) xdr_shortfreq_arg;
_xdr_result = (xdrproc_t) xdr_int;
local = (char *(*)(char *, struct svc_req *)) setxit_1_svc;
break;
case GETXIT:
_xdr_argument = (xdrproc_t) xdr_vfo_x;
_xdr_result = (xdrproc_t) xdr_shortfreq_res;
local = (char *(*)(char *, struct svc_req *)) getxit_1_svc;
break;
case SETTS:
_xdr_argument = (xdrproc_t) xdr_shortfreq_arg;
_xdr_result = (xdrproc_t) xdr_int;
local = (char *(*)(char *, struct svc_req *)) setts_1_svc;
break;
case GETTS:
_xdr_argument = (xdrproc_t) xdr_vfo_x;
_xdr_result = (xdrproc_t) xdr_shortfreq_res;
local = (char *(*)(char *, struct svc_req *)) getts_1_svc;
break;
case SCAN:
_xdr_argument = (xdrproc_t) xdr_scan_arg;
_xdr_result = (xdrproc_t) xdr_int;
local = (char *(*)(char *, struct svc_req *)) scan_1_svc;
break;
case RESET:
_xdr_argument = (xdrproc_t) xdr_reset_x;
_xdr_result = (xdrproc_t) xdr_int;
local = (char *(*)(char *, struct svc_req *)) reset_1_svc;
break;
case SETMEM:
_xdr_argument = (xdrproc_t) xdr_ch_arg;
_xdr_result = (xdrproc_t) xdr_int;
local = (char *(*)(char *, struct svc_req *)) setmem_1_svc;
break;
case GETMEM:
_xdr_argument = (xdrproc_t) xdr_vfo_x;
_xdr_result = (xdrproc_t) xdr_ch_res;
local = (char *(*)(char *, struct svc_req *)) getmem_1_svc;
break;
case SETANT:
_xdr_argument = (xdrproc_t) xdr_ant_arg;
_xdr_result = (xdrproc_t) xdr_int;
local = (char *(*)(char *, struct svc_req *)) setant_1_svc;
break;
case GETANT:
_xdr_argument = (xdrproc_t) xdr_vfo_x;
_xdr_result = (xdrproc_t) xdr_ant_res;
local = (char *(*)(char *, struct svc_req *)) getant_1_svc;
break;
case SETBANK:
_xdr_argument = (xdrproc_t) xdr_ch_arg;
_xdr_result = (xdrproc_t) xdr_int;
local = (char *(*)(char *, struct svc_req *)) setbank_1_svc;
break;
case SETPOWERSTAT:
_xdr_argument = (xdrproc_t) xdr_powerstat_x;
_xdr_result = (xdrproc_t) xdr_int;
local = (char *(*)(char *, struct svc_req *)) setpowerstat_1_svc;
break;
case GETPOWERSTAT:
_xdr_argument = (xdrproc_t) xdr_void;
_xdr_result = (xdrproc_t) xdr_powerstat_res;
local = (char *(*)(char *, struct svc_req *)) getpowerstat_1_svc;
break;
default:
svcerr_noproc (transp);
return;

Wyświetl plik

@ -6,9 +6,9 @@
#include "rpcrig.h"
/*
* Hamlib Interface - RPC definitions
* Copyright (c) 2000,2001 by Stephane Fillod and Frank Singleton
* Copyright (c) 2000-2002 by Stephane Fillod and Frank Singleton
*
* $Id: rpcrig_xdr.c,v 1.3 2001-12-27 21:58:47 fillods Exp $
* $Id: rpcrig_xdr.c,v 1.4 2002-08-23 20:01:09 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
@ -156,6 +156,56 @@ xdr_ann_x (XDR *xdrs, ann_x *objp)
return TRUE;
}
bool_t
xdr_rptr_shift_x (XDR *xdrs, rptr_shift_x *objp)
{
register int32_t *buf;
if (!xdr_int (xdrs, objp))
return FALSE;
return TRUE;
}
bool_t
xdr_tone_x (XDR *xdrs, tone_x *objp)
{
register int32_t *buf;
if (!xdr_int (xdrs, objp))
return FALSE;
return TRUE;
}
bool_t
xdr_scan_x (XDR *xdrs, scan_x *objp)
{
register int32_t *buf;
if (!xdr_long (xdrs, objp))
return FALSE;
return TRUE;
}
bool_t
xdr_reset_x (XDR *xdrs, reset_x *objp)
{
register int32_t *buf;
if (!xdr_long (xdrs, objp))
return FALSE;
return TRUE;
}
bool_t
xdr_powerstat_x (XDR *xdrs, powerstat_x *objp)
{
register int32_t *buf;
if (!xdr_long (xdrs, objp))
return FALSE;
return TRUE;
}
bool_t
xdr_mode_s (XDR *xdrs, mode_s *objp)
{
@ -258,6 +308,24 @@ xdr_vfo_res (XDR *xdrs, vfo_res *objp)
return TRUE;
}
bool_t
xdr_powerstat_res (XDR *xdrs, powerstat_res *objp)
{
register int32_t *buf;
if (!xdr_int (xdrs, &objp->rigstatus))
return FALSE;
switch (objp->rigstatus) {
case 0:
if (!xdr_powerstat_x (xdrs, &objp->powerstat_res_u.powerstat))
return FALSE;
break;
default:
break;
}
return TRUE;
}
bool_t
xdr_split_arg (XDR *xdrs, split_arg *objp)
{
@ -375,7 +443,201 @@ xdr_vfo_op_arg (XDR *xdrs, vfo_op_arg *objp)
if (!xdr_vfo_x (xdrs, &objp->vfo))
return FALSE;
if (!xdr_vfo_op_x (xdrs, &objp->op))
if (!xdr_vfo_op_x (xdrs, &objp->vfo_op))
return FALSE;
return TRUE;
}
bool_t
xdr_rptrshift_res (XDR *xdrs, rptrshift_res *objp)
{
register int32_t *buf;
if (!xdr_int (xdrs, &objp->rigstatus))
return FALSE;
switch (objp->rigstatus) {
case 0:
if (!xdr_rptr_shift_x (xdrs, &objp->rptrshift_res_u.rptrshift))
return FALSE;
break;
default:
break;
}
return TRUE;
}
bool_t
xdr_rptrshift_arg (XDR *xdrs, rptrshift_arg *objp)
{
register int32_t *buf;
if (!xdr_vfo_x (xdrs, &objp->vfo))
return FALSE;
if (!xdr_rptr_shift_x (xdrs, &objp->rptrshift))
return FALSE;
return TRUE;
}
bool_t
xdr_shortfreq_res (XDR *xdrs, shortfreq_res *objp)
{
register int32_t *buf;
if (!xdr_int (xdrs, &objp->rigstatus))
return FALSE;
switch (objp->rigstatus) {
case 0:
if (!xdr_shortfreq_x (xdrs, &objp->shortfreq_res_u.shortfreq))
return FALSE;
break;
default:
break;
}
return TRUE;
}
bool_t
xdr_shortfreq_arg (XDR *xdrs, shortfreq_arg *objp)
{
register int32_t *buf;
if (!xdr_vfo_x (xdrs, &objp->vfo))
return FALSE;
if (!xdr_shortfreq_x (xdrs, &objp->shortfreq))
return FALSE;
return TRUE;
}
bool_t
xdr_tone_res (XDR *xdrs, tone_res *objp)
{
register int32_t *buf;
if (!xdr_int (xdrs, &objp->rigstatus))
return FALSE;
switch (objp->rigstatus) {
case 0:
if (!xdr_tone_x (xdrs, &objp->tone_res_u.tone))
return FALSE;
break;
default:
break;
}
return TRUE;
}
bool_t
xdr_tone_arg (XDR *xdrs, tone_arg *objp)
{
register int32_t *buf;
if (!xdr_vfo_x (xdrs, &objp->vfo))
return FALSE;
if (!xdr_tone_x (xdrs, &objp->tone))
return FALSE;
return TRUE;
}
bool_t
xdr_ant_res (XDR *xdrs, ant_res *objp)
{
register int32_t *buf;
if (!xdr_int (xdrs, &objp->rigstatus))
return FALSE;
switch (objp->rigstatus) {
case 0:
if (!xdr_ant_x (xdrs, &objp->ant_res_u.ant))
return FALSE;
break;
default:
break;
}
return TRUE;
}
bool_t
xdr_ant_arg (XDR *xdrs, ant_arg *objp)
{
register int32_t *buf;
if (!xdr_vfo_x (xdrs, &objp->vfo))
return FALSE;
if (!xdr_ant_x (xdrs, &objp->ant))
return FALSE;
return TRUE;
}
bool_t
xdr_ch_res (XDR *xdrs, ch_res *objp)
{
register int32_t *buf;
if (!xdr_int (xdrs, &objp->rigstatus))
return FALSE;
switch (objp->rigstatus) {
case 0:
if (!xdr_int (xdrs, &objp->ch_res_u.ch))
return FALSE;
break;
default:
break;
}
return TRUE;
}
bool_t
xdr_ch_arg (XDR *xdrs, ch_arg *objp)
{
register int32_t *buf;
if (!xdr_vfo_x (xdrs, &objp->vfo))
return FALSE;
if (!xdr_int (xdrs, &objp->ch))
return FALSE;
return TRUE;
}
bool_t
xdr_scan_s (XDR *xdrs, scan_s *objp)
{
register int32_t *buf;
if (!xdr_scan_x (xdrs, &objp->scan))
return FALSE;
if (!xdr_int (xdrs, &objp->ch))
return FALSE;
return TRUE;
}
bool_t
xdr_scan_res (XDR *xdrs, scan_res *objp)
{
register int32_t *buf;
if (!xdr_int (xdrs, &objp->rigstatus))
return FALSE;
switch (objp->rigstatus) {
case 0:
if (!xdr_scan_s (xdrs, &objp->scan_res_u.scan))
return FALSE;
break;
default:
break;
}
return TRUE;
}
bool_t
xdr_scan_arg (XDR *xdrs, scan_arg *objp)
{
register int32_t *buf;
if (!xdr_vfo_x (xdrs, &objp->vfo))
return FALSE;
if (!xdr_scan_x (xdrs, &objp->scan))
return FALSE;
if (!xdr_int (xdrs, &objp->ch))
return FALSE;
return TRUE;
}