kopia lustrzana https://github.com/Hamlib/Hamlib
Merge branch 'master' of https://github.com/mdblack98/Hamlib
commit
39d9854d57
|
@ -41,7 +41,7 @@ sockets. This allows multiple user programs to share one radio (this needs
|
|||
more development). Multiple radios can be controlled on different TCP ports
|
||||
by use of multiple
|
||||
.B rigctld
|
||||
processes. The syntax of the commands are the same as
|
||||
processes. Note that multiple processes/ports are also necessary if some clients use extended responses and/or vfo mode. So up to 4 processes/ports may be needed for each combination of extended response/vfo mode. The syntax of the commands are the same as
|
||||
.BR rigctl (1).
|
||||
It is hoped that
|
||||
.B rigctld
|
||||
|
|
|
@ -2,7 +2,7 @@ LOCAL_PATH:= $(call my-dir)
|
|||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := dummy.c rot_dummy.c netrigctl.c netrotctl.c flrig.c
|
||||
LOCAL_SRC_FILES := dummy.c rot_dummy.c netrigctl.c netrotctl.c flrig.c trxmanager.c
|
||||
LOCAL_MODULE := dummy
|
||||
|
||||
LOCAL_CFLAGS := -DHAVE_CONFIG_H
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
DUMMYSRC = dummy.c dummy.h rot_dummy.c rot_dummy.h netrigctl.c netrotctl.c flrig.c flrig.h
|
||||
DUMMYSRC = dummy.c dummy.h rot_dummy.c rot_dummy.h netrigctl.c netrotctl.c flrig.c flrig.h trxmanager.c trxmanager.h
|
||||
|
||||
noinst_LTLIBRARIES = libhamlib-dummy.la
|
||||
libhamlib_dummy_la_SOURCES = $(DUMMYSRC)
|
||||
|
|
|
@ -1629,6 +1629,7 @@ DECLARE_INITRIG_BACKEND(dummy)
|
|||
rig_register(&dummy_caps);
|
||||
rig_register(&netrigctl_caps);
|
||||
rig_register(&flrig_caps);
|
||||
rig_register(&trxmanager_caps);
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
|
|
@ -40,5 +40,6 @@
|
|||
extern const struct rig_caps dummy_caps;
|
||||
extern const struct rig_caps netrigctl_caps;
|
||||
extern const struct rig_caps flrig_caps;
|
||||
extern const struct rig_caps trxmanager_caps;
|
||||
|
||||
#endif /* _DUMMY_H */
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
As of version 0.1 this works well with rigs have a full ack/nak protocol as coded in FLRig. So Kenwood, Icom and such.
|
||||
But Yaesu rigs for example are not stable with applications like WSJT-X since the FLRig driver does not wait or obtain status after frequency change commands for example (fire and forget). Hamlib's Yaesu drivers always send and ID request after such commands and wait for an appropriate response but FLRig does not so can miss commands as a result. Slow operation (manual command from rigctl) works fine.
|
||||
Rig drivers in FLRig will have to be changed to allow stable operation with fast comm programs like WJST-X.
|
||||
|
||||
As of version 1.0 20180508 this works very well with flrig-1.3.40.50 and WSJT-X split mode.
|
||||
Log4OM can be run conconcurrently connecting to "rigctld -M 4".
|
||||
Note that for that Log4OM instance only clients that use extended protocol can connect to the client (since Log4OM uses extended protocol). If you want to use a client that does not have extended protocol you must run another rigctld on a separate TCP port.
|
||||
The same thing holds for any vfo mode clients.
|
||||
So you could end up with 4 rigctld's. One for each combination of extended/vfo mode.
|
||||
Flrig can now handle numerous clients connecting at once thanks to a lot of work done by Dave W1HKJ
|
||||
de Mike W9MDB
|
||||
|
|
1369
dummy/flrig.c
1369
dummy/flrig.c
Plik diff jest za duży
Load Diff
|
@ -28,12 +28,11 @@
|
|||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND_VER "0.1"
|
||||
#define BACKEND_VER "1.0"
|
||||
|
||||
#define EOM "\r"
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
#define BUF_MAX 32768
|
||||
|
||||
extern const struct rig_caps flrig_caps;
|
||||
|
||||
|
|
|
@ -52,9 +52,11 @@ static int netrigctl_transaction(RIG *rig, char *cmd, int len, char *buf)
|
|||
{
|
||||
int ret;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE,"%s: called len=%d\n",__FUNCTION__,len);
|
||||
|
||||
/* flush anything in the read buffer before command is sent */
|
||||
if (rig->state.rigport.type.rig == RIG_PORT_NETWORK || rig->state.rigport.type.rig == RIG_PORT_UDP_NETWORK) {
|
||||
network_flush(&rig->state.rigport);
|
||||
network_flush(&rig->state.rigport);
|
||||
} else {
|
||||
serial_flush(&rig->state.rigport);
|
||||
}
|
||||
|
@ -63,14 +65,14 @@ static int netrigctl_transaction(RIG *rig, char *cmd, int len, char *buf)
|
|||
if (ret != RIG_OK)
|
||||
return ret;
|
||||
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", sizeof("\n"));
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (!memcmp(buf, NETRIGCTL_RET, strlen(NETRIGCTL_RET)))
|
||||
if (memcmp(buf, NETRIGCTL_RET, strlen(NETRIGCTL_RET))==0)
|
||||
return atoi(buf+strlen(NETRIGCTL_RET));
|
||||
|
||||
return ret;
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
||||
|
@ -96,18 +98,18 @@ static int netrigctl_open(RIG *rig)
|
|||
if (prot_ver < RIGCTLD_PROT_VER)
|
||||
return -RIG_EPROTO;
|
||||
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", sizeof("\n"));
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
if (ret <= 0)
|
||||
return (ret < 0) ? ret : -RIG_EPROTO;
|
||||
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", sizeof("\n"));
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
if (ret <= 0)
|
||||
return (ret < 0) ? ret : -RIG_EPROTO;
|
||||
|
||||
rs->itu_region = atoi(buf);
|
||||
|
||||
for (i=0; i<FRQRANGESIZ; i++) {
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", sizeof("\n"));
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
if (ret <= 0)
|
||||
return (ret < 0) ? ret : -RIG_EPROTO;
|
||||
|
||||
|
@ -126,7 +128,7 @@ static int netrigctl_open(RIG *rig)
|
|||
break;
|
||||
}
|
||||
for (i=0; i<FRQRANGESIZ; i++) {
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", sizeof("\n"));
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
if (ret <= 0)
|
||||
return (ret < 0) ? ret : -RIG_EPROTO;
|
||||
|
||||
|
@ -145,7 +147,7 @@ static int netrigctl_open(RIG *rig)
|
|||
break;
|
||||
}
|
||||
for (i=0; i<TSLSTSIZ; i++) {
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", sizeof("\n"));
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
if (ret <= 0)
|
||||
return (ret < 0) ? ret : -RIG_EPROTO;
|
||||
|
||||
|
@ -159,7 +161,7 @@ static int netrigctl_open(RIG *rig)
|
|||
}
|
||||
|
||||
for (i=0; i<FLTLSTSIZ; i++) {
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", sizeof("\n"));
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
if (ret <= 0)
|
||||
return (ret < 0) ? ret : -RIG_EPROTO;
|
||||
|
||||
|
@ -177,31 +179,31 @@ static int netrigctl_open(RIG *rig)
|
|||
chan_t chan_list[CHANLSTSIZ]; /*!< Channel list, zero ended */
|
||||
#endif
|
||||
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", sizeof("\n"));
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
if (ret <= 0)
|
||||
return (ret < 0) ? ret : -RIG_EPROTO;
|
||||
|
||||
rs->max_rit = atol(buf);
|
||||
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", sizeof("\n"));
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
if (ret <= 0)
|
||||
return (ret < 0) ? ret : -RIG_EPROTO;
|
||||
|
||||
rs->max_xit = atol(buf);
|
||||
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", sizeof("\n"));
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
if (ret <= 0)
|
||||
return (ret < 0) ? ret : -RIG_EPROTO;
|
||||
|
||||
rs->max_ifshift = atol(buf);
|
||||
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", sizeof("\n"));
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
if (ret <= 0)
|
||||
return (ret < 0) ? ret : -RIG_EPROTO;
|
||||
|
||||
rs->announces = atoi(buf);
|
||||
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", sizeof("\n"));
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
if (ret <= 0)
|
||||
return (ret < 0) ? ret : -RIG_EPROTO;
|
||||
|
||||
|
@ -214,7 +216,7 @@ chan_t chan_list[CHANLSTSIZ]; /*!< Channel list, zero ended */
|
|||
ret = 0;
|
||||
rs->preamp[ret] = RIG_DBLST_END;
|
||||
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", sizeof("\n"));
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
if (ret <= 0)
|
||||
return (ret < 0) ? ret : -RIG_EPROTO;
|
||||
|
||||
|
@ -227,19 +229,19 @@ chan_t chan_list[CHANLSTSIZ]; /*!< Channel list, zero ended */
|
|||
ret = 0;
|
||||
rs->attenuator[ret] = RIG_DBLST_END;
|
||||
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", sizeof("\n"));
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
if (ret <= 0)
|
||||
return (ret < 0) ? ret : -RIG_EPROTO;
|
||||
|
||||
rs->has_get_func = strtol(buf, NULL, 0);
|
||||
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", sizeof("\n"));
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
if (ret <= 0)
|
||||
return (ret < 0) ? ret : -RIG_EPROTO;
|
||||
|
||||
rs->has_set_func = strtol(buf, NULL, 0);
|
||||
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", sizeof("\n"));
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
if (ret <= 0)
|
||||
return (ret < 0) ? ret : -RIG_EPROTO;
|
||||
|
||||
|
@ -252,19 +254,19 @@ chan_t chan_list[CHANLSTSIZ]; /*!< Channel list, zero ended */
|
|||
rs->has_get_level |= RIG_LEVEL_STRENGTH;
|
||||
}
|
||||
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", sizeof("\n"));
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
if (ret <= 0)
|
||||
return (ret < 0) ? ret : -RIG_EPROTO;
|
||||
|
||||
rs->has_set_level = strtol(buf, NULL, 0);
|
||||
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", sizeof("\n"));
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
if (ret <= 0)
|
||||
return (ret < 0) ? ret : -RIG_EPROTO;
|
||||
|
||||
rs->has_get_parm = strtol(buf, NULL, 0);
|
||||
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", sizeof("\n"));
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
if (ret <= 0)
|
||||
return (ret < 0) ? ret : -RIG_EPROTO;
|
||||
|
||||
|
@ -370,7 +372,7 @@ static int netrigctl_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *wid
|
|||
if (ret > 0 && buf[ret-1]=='\n') buf[ret-1] = '\0'; /* chomp */
|
||||
*mode = rig_parse_mode(buf);
|
||||
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", sizeof("\n"));
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
if (ret <= 0)
|
||||
return (ret < 0) ? ret : -RIG_EPROTO;
|
||||
|
||||
|
@ -778,7 +780,7 @@ static int netrigctl_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, pbwid
|
|||
if (ret > 0 && buf[ret-1]=='\n') buf[ret-1] = '\0'; /* chomp */
|
||||
*tx_mode = rig_parse_mode(buf);
|
||||
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", sizeof("\n"));
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
if (ret <= 0)
|
||||
return (ret < 0) ? ret : -RIG_EPROTO;
|
||||
|
||||
|
@ -821,7 +823,7 @@ static int netrigctl_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *t
|
|||
|
||||
*split = atoi(buf);
|
||||
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", sizeof("\n"));
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
if (ret <= 0)
|
||||
return (ret < 0) ? ret : -RIG_EPROTO;
|
||||
|
||||
|
@ -1343,9 +1345,9 @@ const struct rig_caps netrigctl_caps = {
|
|||
.rig_model = RIG_MODEL_NETRIGCTL,
|
||||
.model_name = "NET rigctl",
|
||||
.mfg_name = "Hamlib",
|
||||
.version = "0.3",
|
||||
.version = "1.0",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_BETA,
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_OTHER,
|
||||
.targetable_vfo = 0,
|
||||
.ptt_type = RIG_PTT_RIG_MICDATA,
|
||||
|
|
Plik diff jest za duży
Load Diff
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* Hamlib TRXManager backend - main header
|
||||
* Copyright (c) 2017 by Michael Black W9MDB
|
||||
* Copyright (c) 2018 by Michael Black W9MDB
|
||||
* Derived from flrig.h
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _TRXMANAGER_H
|
||||
#define _TRXMANAGER_H 1
|
||||
|
||||
#include "hamlib/rig.h"
|
||||
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND_VER "1.2"
|
||||
|
||||
#define EOM "\r"
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
|
||||
extern struct rig_caps trxmanager_caps;
|
||||
|
||||
#endif /* _TRXMANAGER_H */
|
|
@ -61,6 +61,7 @@
|
|||
#define RIG_MODEL_NETRIGCTL RIG_MAKE_MODEL(RIG_DUMMY, 2)
|
||||
#define RIG_MODEL_ARMSTRONG RIG_MAKE_MODEL(RIG_DUMMY, 3)
|
||||
#define RIG_MODEL_FLRIG RIG_MAKE_MODEL(RIG_DUMMY, 4)
|
||||
#define RIG_MODEL_TRXMANAGER_RIG RIG_MAKE_MODEL(RIG_DUMMY, 5)
|
||||
|
||||
|
||||
/*
|
||||
|
|
1135
kenwood/thd72.c
1135
kenwood/thd72.c
Plik diff jest za duży
Load Diff
|
@ -593,7 +593,11 @@ extern int vfo_mode;
|
|||
extern char send_cmd_term;
|
||||
int ext_resp = 0;
|
||||
unsigned char resp_sep = '\n'; /* Default response separator */
|
||||
|
||||
/* Note that vfo_mode and ext_resp are not thread safe
|
||||
* So to run either a vfo_mode or ext_resp mode rigctld it needs to be
|
||||
* on a separate rigctld instance on a different port. One port per vfo_mode/ext_resp combination for a maximum of 4 instances/ports to cover all 4 combos
|
||||
* Significant rewrite to fix this for 1 instance
|
||||
*/
|
||||
|
||||
int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc, sync_cb_t sync_cb)
|
||||
{
|
||||
|
@ -1564,6 +1568,7 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc, syn
|
|||
|
||||
if (sync_cb) sync_cb (0); /* unlock if necessary */
|
||||
|
||||
if (retcode == RIG_EIO) return retcode;
|
||||
if (retcode != RIG_OK)
|
||||
{
|
||||
/* only for rigctld */
|
||||
|
|
|
@ -1427,6 +1427,7 @@ int rotctl_parse(ROT *my_rot, FILE *fin, FILE *fout, char *argv[], int argc)
|
|||
pthread_mutex_unlock(&rot_mutex);
|
||||
#endif
|
||||
|
||||
if (retcode == RIG_EIO) return retcode;
|
||||
if (retcode != RIG_OK)
|
||||
{
|
||||
/* only for rotctld */
|
||||
|
|
Ładowanie…
Reference in New Issue