kopia lustrzana https://github.com/Hamlib/Hamlib
Porównaj commity
16 Commity
37c0f07ecb
...
c019467987
Autor | SHA1 | Data |
---|---|---|
Mike Black W9MDB | c019467987 | |
Mike Black W9MDB | 19c4b01e5a | |
Mike Black W9MDB | 5492572176 | |
Michael Black | 0c1f66710a | |
zcsahok | 5d0cbba91e | |
Mike Black W9MDB | a4fa021848 | |
Mike Black W9MDB | bc2f2ce5c7 | |
Mike Black W9MDB | da478d6e74 | |
Mike Black W9MDB | 02a6c80800 | |
Mike Black W9MDB | 08ba518b71 | |
Mike Black W9MDB | 32f37d390f | |
Mike Black W9MDB | 3ba1bc2c19 | |
Mike Black W9MDB | b2850ff7a8 | |
Mike Black W9MDB | 675ed1c85a | |
Mike Black W9MDB | a1b56bc315 | |
Mike Black W9MDB | 8c8c20c256 |
|
@ -1168,7 +1168,7 @@ VFO reset, \(oq4\(cq = Memory Clear reset, \(oq8\(cq = Master reset.
|
|||
.IP
|
||||
Since these values are defined as a bitmask in
|
||||
.IR include/hamlib/rig.h ,
|
||||
it should be possible to AND these values together to do multiple resets at
|
||||
it should be possible to OR these values together to do multiple resets at
|
||||
once, if the backend supports it or supports a reset action via rig control at
|
||||
all.
|
||||
.
|
||||
|
|
|
@ -1052,7 +1052,7 @@ VFO reset, \(oq4\(cq = Memory Clear reset, \(oq8\(cq = Master reset.
|
|||
.IP
|
||||
Since these values are defined as a bitmask in
|
||||
.IR include/hamlib/rig.h ,
|
||||
it should be possible to AND these values together to do multiple resets at
|
||||
it should be possible to OR these values together to do multiple resets at
|
||||
once, if the backend supports it or supports a reset action via rig control at
|
||||
all.
|
||||
.
|
||||
|
|
|
@ -86,11 +86,11 @@ struct rig_caps ic703_caps =
|
|||
RIG_MODEL(RIG_MODEL_IC703),
|
||||
.model_name = "IC-703",
|
||||
.mfg_name = "Icom",
|
||||
.version = BACKEND_VER ".1",
|
||||
.version = BACKEND_VER ".2",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_MOBILE,
|
||||
.ptt_type = RIG_PTT_NONE,
|
||||
.ptt_type = RIG_PTT_RIG,
|
||||
.dcd_type = RIG_DCD_RIG,
|
||||
.port_type = RIG_PORT_SERIAL,
|
||||
.serial_rate_min = 300,
|
||||
|
|
|
@ -135,6 +135,7 @@ int flexradio_open(RIG *rig)
|
|||
break;
|
||||
|
||||
case RIG_MODEL_POWERSDR:
|
||||
case RIG_MODEL_THETIS:
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -710,7 +710,7 @@ int kenwood_safe_transaction(RIG *rig, const char *cmd, char *buf,
|
|||
{
|
||||
size_t length;
|
||||
// some PowerSDR commands have variable len
|
||||
int checklen = !RIG_IS_POWERSDR;
|
||||
int checklen = !RIG_IS_POWERSDR && !RIG_IS_THETIS;
|
||||
err = kenwood_transaction(rig, cmd, buf, buf_size);
|
||||
|
||||
if (err != RIG_OK) /* return immediately on error as any
|
||||
|
@ -5018,6 +5018,7 @@ int kenwood_set_trn(RIG *rig, int trn)
|
|||
char buf[5];
|
||||
|
||||
case RIG_MODEL_POWERSDR: // powersdr doesn't have AI command
|
||||
case RIG_MODEL_THETIS: // powersdr doesn't have AI command
|
||||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
|
||||
case RIG_MODEL_TS990S:
|
||||
|
@ -5052,7 +5053,7 @@ int kenwood_get_trn(RIG *rig, int *trn)
|
|||
|
||||
/* these rigs only have AI[0|1] set commands and no AI query */
|
||||
if (RIG_IS_TS450S || RIG_IS_TS690S || RIG_IS_TS790 || RIG_IS_TS850
|
||||
|| RIG_IS_TS950S || RIG_IS_TS950SDX || RIG_IS_POWERSDR)
|
||||
|| RIG_IS_TS950S || RIG_IS_TS950SDX || RIG_IS_POWERSDR || RIG_IS_THETIS)
|
||||
{
|
||||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "token.h"
|
||||
#include "idx_builtin.h"
|
||||
|
||||
#define BACKEND_VER "20231112"
|
||||
#define BACKEND_VER "20231226"
|
||||
|
||||
#define EOM_KEN ';'
|
||||
#define EOM_TH '\r'
|
||||
|
@ -109,6 +109,7 @@ extern struct confparams kenwood_cfg_params[];
|
|||
#define RIG_IS_XG3 (rig->caps->rig_model == RIG_MODEL_XG3)
|
||||
#define RIG_IS_PT8000A (rig->caps->rig_model == RIG_MODEL_PT8000A)
|
||||
#define RIG_IS_POWERSDR (rig->caps->rig_model == RIG_MODEL_POWERSDR)
|
||||
#define RIG_IS_THETIS (rig->caps->rig_model == RIG_MODEL_THETIS)
|
||||
#define RIG_IS_MALACHITE (rig->caps->rig_model == RIG_MODEL_MALACHITE)
|
||||
#define RIG_IS_QRPLABS (rig->caps->rig_model == RIG_MODEL_QRPLABS)
|
||||
|
||||
|
|
|
@ -852,7 +852,7 @@ int newcat_60m_exception(RIG *rig, freq_t freq, mode_t mode)
|
|||
}
|
||||
|
||||
// some rigs need to skip freq/mode settings as 60M only operates in memory mode
|
||||
if (is_ft991 || is_ft897 || is_ft897d || is_ftdx5000) { return 1; }
|
||||
if (is_ft991 || is_ft897 || is_ft897d || is_ftdx5000 || is_ftdx10) { return 1; }
|
||||
|
||||
if (!is_ftdx10 && !is_ft710 && !is_ftdx101d && !is_ftdx101mp) { return 0; }
|
||||
|
||||
|
@ -2730,6 +2730,11 @@ int newcat_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
|
|||
{
|
||||
RETURNFUNC(err);
|
||||
}
|
||||
if (newcat_60m_exception(rig, rig->state.cache.freqMainA, rig->state.cache.modeMainA))
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: ignoring set_split since we're on 60M exception\n", __func__);
|
||||
return RIG_OK; // fake the return code to make things happy
|
||||
}
|
||||
|
||||
if (is_ft991)
|
||||
{
|
||||
|
|
114
src/network.c
114
src/network.c
|
@ -1056,6 +1056,8 @@ static int is_networked(char *address, int address_length)
|
|||
struct sockaddr_in *sa_in = (struct sockaddr_in *)pUnicast->Address.lpSockaddr;
|
||||
addr = &(sa_in->sin_addr);
|
||||
}
|
||||
|
||||
#if 0 // going to skip IPV6 for now -- should never need it on a local network
|
||||
else if (pUnicast->Address.lpSockaddr->sa_family == AF_INET6) // IPv6 address
|
||||
{
|
||||
struct sockaddr_in6 *sa_in6 = (struct sockaddr_in6 *)
|
||||
|
@ -1063,22 +1065,29 @@ static int is_networked(char *address, int address_length)
|
|||
addr = &(sa_in6->sin6_addr);
|
||||
}
|
||||
|
||||
// Convert IP address to string
|
||||
#endif
|
||||
|
||||
// Convert IP address to string and ignore bad ones
|
||||
if (addr)
|
||||
{
|
||||
count++;
|
||||
|
||||
if (count > 1)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_WARN,
|
||||
"%s: more than 1 address found...multicast may not work\n", __func__);
|
||||
}
|
||||
|
||||
if (inet_ntop(pUnicast->Address.lpSockaddr->sa_family, addr, ipString,
|
||||
sizeof(ipString)) != NULL)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: Address: %s\n", ipString, ipString);
|
||||
strncpy(address, ipString, address_length);
|
||||
// Use IP address if not 169.x.x.x
|
||||
if (strncmp(ipString, "169", 3) != 0)
|
||||
{
|
||||
count++;
|
||||
|
||||
if (count > 1)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_WARN,
|
||||
"%s: more than 1 address found...multicast may not work\n", __func__);
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: Address: %s\n", ipString, ipString);
|
||||
strncpy(address, ipString, address_length);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1144,13 +1153,53 @@ int is_wireless()
|
|||
return 0;
|
||||
}
|
||||
#else
|
||||
#ifndef __APPLE__
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/socket.h>
|
||||
#include <unistd.h>
|
||||
#include <linux/wireless.h>
|
||||
#include <ifaddrs.h>
|
||||
|
||||
int is_networked(char *ipv4, int ipv4_length)
|
||||
{
|
||||
struct ifaddrs *interfaces, *iface;
|
||||
char addr_str[INET_ADDRSTRLEN];
|
||||
|
||||
// Get a list of all network interfaces
|
||||
if (getifaddrs(&interfaces) == -1)
|
||||
{
|
||||
perror("getifaddrs");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// Iterate through the list of interfaces
|
||||
for (iface = interfaces; iface != NULL; iface = iface->ifa_next)
|
||||
{
|
||||
if (iface->ifa_addr
|
||||
&& iface->ifa_addr->sa_family == AF_INET) // Check it is IP4
|
||||
{
|
||||
// Convert the linked list of interfaces to a human readable string
|
||||
struct sockaddr_in *sa = (struct sockaddr_in *) iface->ifa_addr;
|
||||
inet_ntop(AF_INET, &(sa->sin_addr), addr_str, INET_ADDRSTRLEN);
|
||||
|
||||
if (strncmp(addr_str, "127", 3) == 0 && ipv4[0] == 0)
|
||||
{
|
||||
strncpy(ipv4, addr_str, ipv4_length);
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: Can use %s\n", __func__, ipv4);
|
||||
}
|
||||
else if (strncmp(addr_str, "127", 3) != 0)
|
||||
{
|
||||
strncpy(ipv4, addr_str, ipv4_length);
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: Will use %s\n", __func__, ipv4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
freeifaddrs(interfaces); // Free the linked list
|
||||
return strlen(ipv4) > 0 ;
|
||||
}
|
||||
|
||||
|
||||
#ifdef __linux__
|
||||
#include <linux/wireless.h>
|
||||
int is_wireless_linux(const char *ifname)
|
||||
{
|
||||
int sock = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
|
@ -1200,9 +1249,7 @@ int is_wireless()
|
|||
void *multicast_receiver(void *arg)
|
||||
{
|
||||
char data[4096];
|
||||
#ifdef __MINGW32__
|
||||
char ip4[INET6_ADDRSTRLEN];
|
||||
#endif
|
||||
|
||||
struct multicast_receiver_args_s *args = (struct multicast_receiver_args_s *)
|
||||
arg;
|
||||
|
@ -1214,17 +1261,18 @@ void *multicast_receiver(void *arg)
|
|||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s(%d): Starting multicast receiver\n", __FILE__,
|
||||
__LINE__);
|
||||
int optval = 1;
|
||||
|
||||
#ifdef __MINGW32__
|
||||
|
||||
if (!is_networked(ip4, sizeof(ip4)))
|
||||
{
|
||||
rig_debug(RIG_DEBUG_WARN, "%s: No network found...multicast disabled\n",
|
||||
__func__);
|
||||
rig_debug(RIG_DEBUG_WARN,
|
||||
"%s: no network detected...disabling multicast receive\n", __func__);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int optval = 1;
|
||||
|
||||
#ifdef __MINGW32__
|
||||
|
||||
if (setsockopt(socket_fd, SOL_SOCKET, SO_REUSEADDR, (PCHAR)&optval,
|
||||
sizeof(optval)) < 0)
|
||||
#else
|
||||
|
@ -1248,6 +1296,7 @@ void *multicast_receiver(void *arg)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
memset(&dest_addr, 0, sizeof(dest_addr));
|
||||
|
@ -1259,7 +1308,7 @@ void *multicast_receiver(void *arg)
|
|||
if (is_wireless())
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE,
|
||||
"%s: wireless detected so INADDR_ANY is being used\n", __func__);
|
||||
"%s: wireless detected\n", __func__);
|
||||
|
||||
// dest_addr.sin_addr.s_addr = inet_addr("127.0.0.1");
|
||||
}
|
||||
|
@ -1270,6 +1319,7 @@ void *multicast_receiver(void *arg)
|
|||
}
|
||||
|
||||
#else
|
||||
// dest_addr.sin_addr.s_addr = inet_addr(args->multicast_addr);
|
||||
dest_addr.sin_addr.s_addr = inet_addr(args->multicast_addr);
|
||||
#endif
|
||||
dest_addr.sin_port = htons(args->multicast_port);
|
||||
|
@ -1288,9 +1338,23 @@ void *multicast_receiver(void *arg)
|
|||
|
||||
mreq.imr_multiaddr.s_addr = inet_addr(args->multicast_addr);
|
||||
|
||||
mreq.imr_interface.s_addr = htonl(INADDR_ANY);
|
||||
#ifdef __MINGW32__
|
||||
|
||||
// we're not worrying about IPV6 right now as that will likely never occur on home network
|
||||
if (strlen(ip4) > 0)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: multicast binding to %s\n", __func__, ip4);
|
||||
mreq.imr_interface.s_addr = inet_addr(ip4);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: multicast binding to INADDR_ANY\n", __func__);
|
||||
mreq.imr_interface.s_addr = htonl(INADDR_ANY);
|
||||
}
|
||||
|
||||
#ifdef __MINGW32__
|
||||
|
||||
if (setsockopt(socket_fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, (PCHAR)&mreq,
|
||||
sizeof(mreq)) < 0)
|
||||
#else
|
||||
|
@ -1301,7 +1365,13 @@ void *multicast_receiver(void *arg)
|
|||
rig_debug(RIG_DEBUG_ERR, "%s: error joining multicast group %s:%d: %s\n",
|
||||
__func__,
|
||||
args->multicast_addr, args->multicast_port, strerror(errno));
|
||||
return NULL;
|
||||
|
||||
if (errno != 0)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: errno==0 so trying to continue\n", __func__);
|
||||
}
|
||||
|
||||
rs->multicast_receiver_run = 1;
|
||||
|
|
Ładowanie…
Reference in New Issue