summaryrefslogtreecommitdiff
path: root/ztcfg.c
diff options
context:
space:
mode:
Diffstat (limited to 'ztcfg.c')
-rwxr-xr-xztcfg.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/ztcfg.c b/ztcfg.c
index f780a4a..52a09a1 100755
--- a/ztcfg.c
+++ b/ztcfg.c
@@ -806,7 +806,7 @@ int cor_thresh(char *keyword, char *args)
if (res != 1) {
error("Invalid value '%s', should be a number > 0.\n", realargs[0]);
}
- corthresh = x;
+ corthresh = x + 1;
return 0;
}
@@ -881,11 +881,13 @@ static int rad_chanconfig(char *keyword, char *args)
return -1;
for (x=1;x<ZT_MAX_CHANNELS;x++) {
if (chans[x]) {
-
p.radpar = ZT_RADPAR_NUMTONES;
if (ind_ioctl(x,fd,ZT_RADIO_GETPARAM,&p) == -1)
error("Cannot get number of tones chanel %d\n",x);
n = p.data;
+ p.radpar = ZT_RADPAR_INITTONE;
+ if (ind_ioctl(x,fd,ZT_RADIO_SETPARAM,&p) == -1)
+ error("Cannot init tones chanel %d\n",x);
if (!rxtones[0]) for(i = 1; i <= n; i++)
{
if (rxtones[i])
@@ -912,12 +914,15 @@ static int rad_chanconfig(char *keyword, char *args)
if (ind_ioctl(x,fd,ZT_RADIO_SETPARAM,&p) == -1)
error("Cannot set txtone on channel %d\n",x);
}
- } else { /* if we have DCS receive */
- p.radpar = ZT_RADPAR_RXTONE;
- p.index = 0;
- p.data = rxtones[0];
- if (ind_ioctl(x,fd,ZT_RADIO_SETPARAM,&p) == -1)
- error("Cannot set DCS rxtone on channel %d\n",x);
+ } else { /* if we may have DCS receive */
+ if (rxtones[0])
+ {
+ p.radpar = ZT_RADPAR_RXTONE;
+ p.index = 0;
+ p.data = rxtones[0];
+ if (ind_ioctl(x,fd,ZT_RADIO_SETPARAM,&p) == -1)
+ error("Cannot set DCS rxtone on channel %d\n",x);
+ }
}
if (txtones[0])
{
@@ -955,10 +960,13 @@ static int rad_chanconfig(char *keyword, char *args)
if (ind_ioctl(x,fd,ZT_RADIO_SETPARAM,&p) == -1)
error("Cannot set exttone on channel %d\n",x);
}
- p.radpar = ZT_RADPAR_CORTHRESH;
- p.data = corthresh;
- if (ind_ioctl(x,fd,ZT_RADIO_SETPARAM,&p) == -1)
- error("Cannot set corthresh on channel %d\n",x);
+ if (corthresh)
+ {
+ p.radpar = ZT_RADPAR_CORTHRESH;
+ p.data = corthresh - 1;
+ if (ind_ioctl(x,fd,ZT_RADIO_SETPARAM,&p) == -1)
+ error("Cannot set corthresh on channel %d\n",x);
+ }
}
}
clear_fields();