kopia lustrzana https://github.com/Hamlib/Hamlib
add tx_freq to set/get channel capabilities
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@1620 7ae35d74-ebe9-4afe-98af-79ac388436b8Hamlib-1.2.0
rodzic
3b09a33660
commit
4c441258d8
|
@ -2,7 +2,7 @@
|
||||||
* Hamlib Kenwood backend - TH-G71 description
|
* Hamlib Kenwood backend - TH-G71 description
|
||||||
* Copyright (c) 2003 by Stephane Fillod
|
* Copyright (c) 2003 by Stephane Fillod
|
||||||
*
|
*
|
||||||
* $Id: thg71.c,v 1.6 2003-12-02 23:26:01 f4dwv Exp $
|
* $Id: thg71.c,v 1.7 2003-12-04 20:45:30 f4dwv Exp $
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or modify
|
* This library is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Library General Public License as
|
* it under the terms of the GNU Library General Public License as
|
||||||
|
@ -56,6 +56,7 @@
|
||||||
|
|
||||||
#define THG71_CHANNEL_CAPS \
|
#define THG71_CHANNEL_CAPS \
|
||||||
.freq=1,\
|
.freq=1,\
|
||||||
|
.tx_freq=1,\
|
||||||
.mode=1,\
|
.mode=1,\
|
||||||
.width=1,\
|
.width=1,\
|
||||||
.tuning_step=1,\
|
.tuning_step=1,\
|
||||||
|
@ -421,9 +422,9 @@ int thg71_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
||||||
int thg71_get_channel(RIG *rig, channel_t *chan)
|
int thg71_get_channel(RIG *rig, channel_t *chan)
|
||||||
{
|
{
|
||||||
char membuf[64],ackbuf[ACKBUF_LEN];
|
char membuf[64],ackbuf[ACKBUF_LEN];
|
||||||
int retval,ack_len=ACKBUF_LEN;
|
int retval,ack_len;
|
||||||
long long freq,offset;
|
long long freq,offset;
|
||||||
char req[64];
|
char req[16],scf[128];
|
||||||
int chn, step, shift, rev, tone, ctcss, tonefq, ctcssfq;
|
int chn, step, shift, rev, tone, ctcss, tonefq, ctcssfq;
|
||||||
|
|
||||||
if(chan->channel_num<200)
|
if(chan->channel_num<200)
|
||||||
|
@ -453,12 +454,14 @@ int thg71_get_channel(RIG *rig, channel_t *chan)
|
||||||
return -RIG_EINVAL;
|
return -RIG_EINVAL;
|
||||||
|
|
||||||
sprintf(membuf,"%s"EOM,req);
|
sprintf(membuf,"%s"EOM,req);
|
||||||
|
ack_len=ACKBUF_LEN;
|
||||||
retval = kenwood_transaction(rig, membuf, strlen(membuf), ackbuf, &ack_len);
|
retval = kenwood_transaction(rig, membuf, strlen(membuf), ackbuf, &ack_len);
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
strcat(req,",%lld,%d,%d,%d,%d,%d,,%d,,%d,%lld");
|
strcpy(scf,req);
|
||||||
retval = sscanf(ackbuf, req,
|
strcat(scf,",%lld,%d,%d,%d,%d,%d,,%d,,%d,%lld");
|
||||||
|
retval = sscanf(ackbuf, scf,
|
||||||
&freq, &step, &shift, &rev, &tone,
|
&freq, &step, &shift, &rev, &tone,
|
||||||
&ctcss, &tonefq, &ctcssfq, &offset);
|
&ctcss, &tonefq, &ctcssfq, &offset);
|
||||||
|
|
||||||
|
@ -494,8 +497,22 @@ int thg71_get_channel(RIG *rig, channel_t *chan)
|
||||||
else
|
else
|
||||||
chan->ctcss_sql=0;
|
chan->ctcss_sql=0;
|
||||||
|
|
||||||
|
chan->tx_freq=RIG_FREQ_NONE;
|
||||||
|
if(chan->channel_num<223 && offset==0) {
|
||||||
|
req[5]='1';
|
||||||
|
sprintf(membuf,"%s"EOM,req);
|
||||||
|
ack_len=ACKBUF_LEN;
|
||||||
|
retval = kenwood_transaction(rig, membuf, strlen(membuf), ackbuf, &ack_len);
|
||||||
|
if (retval == RIG_OK) {
|
||||||
|
strcat(req,",%lld,%d");
|
||||||
|
retval = sscanf(ackbuf, req, &freq, &step);
|
||||||
|
chan->tx_freq=freq;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(chan->channel_num<200) {
|
if(chan->channel_num<200) {
|
||||||
sprintf(membuf,"MNA 0,%03d"EOM,chan->channel_num);
|
sprintf(membuf,"MNA 0,%03d"EOM,chan->channel_num);
|
||||||
|
ack_len=ACKBUF_LEN;
|
||||||
retval = kenwood_transaction(rig, membuf, strlen(membuf), ackbuf, &ack_len);
|
retval = kenwood_transaction(rig, membuf, strlen(membuf), ackbuf, &ack_len);
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
@ -509,10 +526,10 @@ int thg71_get_channel(RIG *rig, channel_t *chan)
|
||||||
int thg71_set_channel(RIG *rig, const channel_t *chan)
|
int thg71_set_channel(RIG *rig, const channel_t *chan)
|
||||||
{
|
{
|
||||||
char membuf[ACKBUF_LEN],ackbuf[ACKBUF_LEN];
|
char membuf[ACKBUF_LEN],ackbuf[ACKBUF_LEN];
|
||||||
int retval,ack_len=ACKBUF_LEN;
|
int retval,ack_len;
|
||||||
char req[64];
|
char req[64];
|
||||||
long long freq,offset;
|
long long freq,offset;
|
||||||
int chn, step, shift, rev, tone, ctcss, tonefq, ctcssfq;
|
int chn, step, shift, tone, ctcss, tonefq, ctcssfq;
|
||||||
|
|
||||||
chn=chan->channel_num;
|
chn=chan->channel_num;
|
||||||
freq=(long long)chan->freq;
|
freq=(long long)chan->freq;
|
||||||
|
@ -586,10 +603,20 @@ int thg71_set_channel(RIG *rig, const channel_t *chan)
|
||||||
req, freq, step, shift, tone,
|
req, freq, step, shift, tone,
|
||||||
ctcss, tonefq, ctcssfq, offset);
|
ctcss, tonefq, ctcssfq, offset);
|
||||||
|
|
||||||
|
ack_len=ACKBUF_LEN;
|
||||||
retval = kenwood_transaction(rig, membuf, strlen(membuf), ackbuf, &ack_len);
|
retval = kenwood_transaction(rig, membuf, strlen(membuf), ackbuf, &ack_len);
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
|
if(chan->channel_num<223 && chan->tx_freq!=RIG_FREQ_NONE) {
|
||||||
|
req[5]='1';
|
||||||
|
sprintf(membuf, "%s,%011lld,%01d"EOM, req,chan->tx_freq, step);
|
||||||
|
ack_len=ACKBUF_LEN;
|
||||||
|
retval = kenwood_transaction(rig, membuf, strlen(membuf), ackbuf, &ack_len);
|
||||||
|
if (retval != RIG_OK)
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
if(chan->channel_num<200) {
|
if(chan->channel_num<200) {
|
||||||
ack_len=ACKBUF_LEN;
|
ack_len=ACKBUF_LEN;
|
||||||
sprintf(membuf,"MNA 0,%03d,%s"EOM,chan->channel_num,chan->channel_desc);
|
sprintf(membuf,"MNA 0,%03d,%s"EOM,chan->channel_num,chan->channel_desc);
|
||||||
|
|
Ładowanie…
Reference in New Issue