kopia lustrzana https://github.com/Hamlib/Hamlib
Merge GitHub PR #1802
commit
3f7c18eb52
|
@ -22,6 +22,8 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "kpa.h"
|
||||
#include "hamlib/port.h"
|
||||
#include "hamlib/amp_state.h"
|
||||
|
||||
struct fault_list
|
||||
{
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "expert.h"
|
||||
#include "hamlib/port.h"
|
||||
#include "hamlib/amp_state.h"
|
||||
#include "register.h"
|
||||
#include "misc.h"
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
|
||||
#include "gemini.h"
|
||||
|
||||
|
||||
struct gemini_priv_data *gemini_priv;
|
||||
/*
|
||||
* API local implementation
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
#include <string.h>
|
||||
#include "misc.h"
|
||||
#include "gemini.h"
|
||||
#include "hamlib/port.h"
|
||||
#include "hamlib/amp_state.h"
|
||||
|
||||
#if 0
|
||||
struct fault_list
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -3,4 +3,5 @@ noinst_HEADERS = bandplan.h num_stdio.h
|
|||
nobase_include_HEADERS = hamlib/rig.h hamlib/riglist.h hamlib/rig_dll.h \
|
||||
hamlib/rotator.h hamlib/rotlist.h hamlib/rigclass.h \
|
||||
hamlib/rotclass.h hamlib/amplifier.h hamlib/amplist.h \
|
||||
hamlib/ampclass.h hamlib/multicast.h
|
||||
hamlib/ampclass.h hamlib/multicast.h hamlib/port.h \
|
||||
hamlib/amp_state.h hamlib/rig_state.h hamlib/rot_state.h
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
* Hamlib Interface - Amplifier state structure
|
||||
* Copyright (c) 2000-2025 The Hamlib Group
|
||||
* Copyright (c) 2025 George Baltz
|
||||
*
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#ifndef _AMP_STATE_H
|
||||
#define _AMP_STATE_H 1
|
||||
|
||||
__BEGIN_DECLS
|
||||
/**
|
||||
* \brief Amplifier state structure.
|
||||
*
|
||||
* \struct amp_state
|
||||
*
|
||||
* This structure contains live data, as well as a copy of capability fields
|
||||
* that may be updated, i.e. customized while the #AMP handle is instantiated.
|
||||
*
|
||||
* It is fine to move fields around, as this kind of struct should not be
|
||||
* initialized like amp_caps are.
|
||||
*/
|
||||
struct amp_state
|
||||
{
|
||||
/*
|
||||
* overridable fields
|
||||
*/
|
||||
|
||||
/*
|
||||
* non overridable fields, internal use
|
||||
*/
|
||||
//---Start cut here---
|
||||
hamlib_port_t_deprecated ampport_deprecated; /*!< Amplifier port (internal use). Deprecated */
|
||||
//---End cut here---
|
||||
|
||||
int comm_state; /*!< Comm port state, opened/closed. */
|
||||
rig_ptr_t priv; /*!< Pointer to private amplifier state data. */
|
||||
rig_ptr_t obj; /*!< Internal use by hamlib++ for event handling. */
|
||||
|
||||
setting_t has_get_level; /*!< List of get levels. */
|
||||
setting_t has_set_level; /*!< List of set levels. */
|
||||
|
||||
gran_t level_gran[RIG_SETTING_MAX]; /*!< Level granularity. */
|
||||
gran_t parm_gran[RIG_SETTING_MAX]; /*!< Parameter granularity. */
|
||||
hamlib_port_t ampport; /*!< Amplifier port (internal use). */
|
||||
};
|
||||
|
||||
#if defined(IN_HAMLIB)
|
||||
#define AMPSTATE(a) (&(a)->state)
|
||||
#endif
|
||||
#define HAMLIB_AMPSTATE(a) ((struct amp_state *)amp_data_pointer(a, RIG_PTRX_AMPSTATE))
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _AMP_STATE_H */
|
|
@ -264,42 +264,20 @@ struct amp_caps
|
|||
const char *macro_name; /*!< Amplifier model macro name. */
|
||||
};
|
||||
|
||||
//---Start cut here---
|
||||
// Amp state structure definition moved to include/hamlib/amp_state.h
|
||||
// Temporary include until 5.0
|
||||
#ifndef NO_OLD_INCLUDES
|
||||
|
||||
/**
|
||||
* \brief Amplifier state structure.
|
||||
*
|
||||
* \struct amp_state
|
||||
*
|
||||
* This structure contains live data, as well as a copy of capability fields
|
||||
* that may be updated, i.e. customized while the #AMP handle is instantiated.
|
||||
*
|
||||
* It is fine to move fields around, as this kind of struct should not be
|
||||
* initialized like amp_caps are.
|
||||
*/
|
||||
struct amp_state
|
||||
{
|
||||
/*
|
||||
* overridable fields
|
||||
*/
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
* non overridable fields, internal use
|
||||
*/
|
||||
hamlib_port_t_deprecated ampport_deprecated; /*!< Amplifier port (internal use). Deprecated */
|
||||
#include <hamlib/amp_state.h>
|
||||
|
||||
int comm_state; /*!< Comm port state, opened/closed. */
|
||||
rig_ptr_t priv; /*!< Pointer to private amplifier state data. */
|
||||
rig_ptr_t obj; /*!< Internal use by hamlib++ for event handling. */
|
||||
|
||||
setting_t has_get_level; /*!< List of get levels. */
|
||||
setting_t has_set_level; /*!< List of set levels. */
|
||||
|
||||
gran_t level_gran[RIG_SETTING_MAX]; /*!< Level granularity. */
|
||||
gran_t parm_gran[RIG_SETTING_MAX]; /*!< Parameter granularity. */
|
||||
hamlib_port_t ampport; /*!< Amplifier port (internal use). */
|
||||
};
|
||||
__BEGIN_DECLS
|
||||
|
||||
#endif
|
||||
|
||||
//---End cut here---
|
||||
/**
|
||||
* \brief Master amplifier structure.
|
||||
*
|
||||
|
|
|
@ -0,0 +1,191 @@
|
|||
/*
|
||||
* Hamlib Interface - Port structure
|
||||
* Copyright (c) 2000-2025 The Hamlib Group
|
||||
* Copyright (c) 2025 George Baltz
|
||||
*
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#ifndef _HL_PORT_H
|
||||
#define _HL_PORT_H 1
|
||||
|
||||
__BEGIN_DECLS
|
||||
/**
|
||||
* \brief Port definition
|
||||
*
|
||||
* Of course, looks like OO painstakingly programmed in C, sigh.
|
||||
*/
|
||||
//! @cond Doxygen_Suppress
|
||||
// DO NOT CHANGE THIS STRUCTURE ALL UNTIL 5.0
|
||||
// Right now it is static inside rig structure
|
||||
// 5.0 will change it to a pointer which can then be added to
|
||||
// At that point only add to the end of the structure
|
||||
typedef struct hamlib_port {
|
||||
union {
|
||||
rig_port_t rig; /*!< Communication port type */
|
||||
ptt_type_t ptt; /*!< PTT port type */
|
||||
dcd_type_t dcd; /*!< DCD port type */
|
||||
} type;
|
||||
|
||||
int fd; /*!< File descriptor */
|
||||
void *handle; /*!< handle for USB */
|
||||
|
||||
int write_delay; /*!< Delay between each byte sent out, in mS */
|
||||
int post_write_delay; /*!< Delay between each commands send out, in mS */
|
||||
|
||||
struct {
|
||||
int tv_sec, tv_usec;
|
||||
} post_write_date; /*!< hamlib internal use */
|
||||
|
||||
int timeout; /*!< Timeout, in mS */
|
||||
short retry; /*!< Maximum number of retries, 0 to disable */
|
||||
short flushx; /*!< If true flush is done with read instead of TCFLUSH - MicroHam */
|
||||
|
||||
char pathname[HAMLIB_FILPATHLEN]; /*!< Port pathname */
|
||||
|
||||
union {
|
||||
struct {
|
||||
int rate; /*!< Serial baud rate */
|
||||
int data_bits; /*!< Number of data bits */
|
||||
int stop_bits; /*!< Number of stop bits */
|
||||
enum serial_parity_e parity; /*!< Serial parity */
|
||||
enum serial_handshake_e handshake; /*!< Serial handshake */
|
||||
enum serial_control_state_e rts_state; /*!< RTS set state */
|
||||
enum serial_control_state_e dtr_state; /*!< DTR set state */
|
||||
} serial; /*!< serial attributes */
|
||||
|
||||
struct {
|
||||
int pin; /*!< Parallel port pin number */
|
||||
} parallel; /*!< parallel attributes */
|
||||
|
||||
struct {
|
||||
int ptt_bitnum; /*!< Bit number for CM108 GPIO PTT */
|
||||
} cm108; /*!< CM108 attributes */
|
||||
|
||||
struct {
|
||||
int vid; /*!< Vendor ID */
|
||||
int pid; /*!< Product ID */
|
||||
int conf; /*!< Configuration */
|
||||
int iface; /*!< interface */
|
||||
int alt; /*!< alternate */
|
||||
char *vendor_name; /*!< Vendor name (opt.) */
|
||||
char *product; /*!< Product (opt.) */
|
||||
} usb; /*!< USB attributes */
|
||||
|
||||
struct {
|
||||
int on_value; /*!< GPIO: 1 == normal, GPION: 0 == inverted */
|
||||
int value; /*!< Toggle PTT ON or OFF */
|
||||
} gpio; /*!< GPIO attributes */
|
||||
} parm; /*!< Port parameter union */
|
||||
int client_port; /*!< client socket port for tcp connection */
|
||||
RIG *rig; /*!< our parent RIG device */
|
||||
int asyncio; /*!< enable asynchronous data handling if true -- async collides with python keyword so _async is used */
|
||||
#if defined(_WIN32)
|
||||
hamlib_async_pipe_t *sync_data_pipe; /*!< pipe data structure for synchronous data */
|
||||
hamlib_async_pipe_t *sync_data_error_pipe; /*!< pipe data structure for synchronous data error codes */
|
||||
#else
|
||||
int fd_sync_write; /*!< file descriptor for writing synchronous data */
|
||||
int fd_sync_read; /*!< file descriptor for reading synchronous data */
|
||||
int fd_sync_error_write; /*!< file descriptor for writing synchronous data error codes */
|
||||
int fd_sync_error_read; /*!< file descriptor for reading synchronous data error codes */
|
||||
#endif
|
||||
short timeout_retry; /*!< number of retries to make in case of read timeout errors, some serial interfaces may require this, 0 to disable */
|
||||
// DO NOT ADD ANYTHING HERE UNTIL 5.0!!
|
||||
} hamlib_port_t;
|
||||
|
||||
|
||||
// DO NOT CHANGE THIS STRUCTURE AT ALL
|
||||
// Will be removed in 5.0
|
||||
typedef struct hamlib_port_deprecated {
|
||||
union {
|
||||
rig_port_t rig; /*!< Communication port type */
|
||||
ptt_type_t ptt; /*!< PTT port type */
|
||||
dcd_type_t dcd; /*!< DCD port type */
|
||||
} type;
|
||||
|
||||
int fd; /*!< File descriptor */
|
||||
void *handle; /*!< handle for USB */
|
||||
|
||||
int write_delay; /*!< Delay between each byte sent out, in mS */
|
||||
int post_write_delay; /*!< Delay between each commands send out, in mS */
|
||||
|
||||
struct {
|
||||
int tv_sec, tv_usec;
|
||||
} post_write_date; /*!< hamlib internal use */
|
||||
|
||||
int timeout; /*!< Timeout, in mS */
|
||||
short retry; /*!< Maximum number of retries, 0 to disable */
|
||||
short flushx; /*!< If true flush is done with read instead of TCFLUSH - MicroHam */
|
||||
|
||||
char pathname[HAMLIB_FILPATHLEN]; /*!< Port pathname */
|
||||
|
||||
union {
|
||||
struct {
|
||||
int rate; /*!< Serial baud rate */
|
||||
int data_bits; /*!< Number of data bits */
|
||||
int stop_bits; /*!< Number of stop bits */
|
||||
enum serial_parity_e parity; /*!< Serial parity */
|
||||
enum serial_handshake_e handshake; /*!< Serial handshake */
|
||||
enum serial_control_state_e rts_state; /*!< RTS set state */
|
||||
enum serial_control_state_e dtr_state; /*!< DTR set state */
|
||||
} serial; /*!< serial attributes */
|
||||
|
||||
struct {
|
||||
int pin; /*!< Parallel port pin number */
|
||||
} parallel; /*!< parallel attributes */
|
||||
|
||||
struct {
|
||||
int ptt_bitnum; /*!< Bit number for CM108 GPIO PTT */
|
||||
} cm108; /*!< CM108 attributes */
|
||||
|
||||
struct {
|
||||
int vid; /*!< Vendor ID */
|
||||
int pid; /*!< Product ID */
|
||||
int conf; /*!< Configuration */
|
||||
int iface; /*!< interface */
|
||||
int alt; /*!< alternate */
|
||||
char *vendor_name; /*!< Vendor name (opt.) */
|
||||
char *product; /*!< Product (opt.) */
|
||||
} usb; /*!< USB attributes */
|
||||
|
||||
struct {
|
||||
int on_value; /*!< GPIO: 1 == normal, GPION: 0 == inverted */
|
||||
int value; /*!< Toggle PTT ON or OFF */
|
||||
} gpio; /*!< GPIO attributes */
|
||||
} parm; /*!< Port parameter union */
|
||||
int client_port; /*!< client socket port for tcp connection */
|
||||
RIG *rig; /*!< our parent RIG device */
|
||||
} hamlib_port_t_deprecated;
|
||||
//! @endcond
|
||||
|
||||
#if !defined(__APPLE__) || !defined(__cplusplus)
|
||||
typedef hamlib_port_t_deprecated port_t_deprecated;
|
||||
typedef hamlib_port_t port_t;
|
||||
#endif
|
||||
|
||||
// Macros for app access to hamlib_port_t data
|
||||
#define HAMLIB_RIGPORT(r) ((hamlib_port_t *)rig_data_pointer((r), RIG_PTRX_RIGPORT))
|
||||
#define HAMLIB_PTTPORT(r) ((hamlib_port_t *)rig_data_pointer((r), RIG_PTRX_PTTPORT))
|
||||
#define HAMLIB_DCDPORT(r) ((hamlib_port_t *)rig_data_pointer((r), RIG_PTRX_DCDPORT))
|
||||
#define HAMLIB_AMPPORT(a) ((hamlib_port_t *)amp_data_pointer((a), RIG_PTRX_AMPPORT))
|
||||
#define HAMLIB_ROTPORT(r) ((hamlib_port_t *)rot_data_pointer((r), RIG_PTRX_ROTPORT))
|
||||
#define HAMLIB_ROTPORT2(r) ((hamlib_port_t *)rot_data_pointer((r), RIG_PTRX_ROTPORT2))
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _HL_PORT_H */
|
|
@ -261,6 +261,12 @@ enum rig_debug_level_e {
|
|||
struct rig;
|
||||
struct rig_state;
|
||||
struct rig_cache;
|
||||
struct hamlib_port;
|
||||
typedef struct hamlib_port hamlib_port_t;
|
||||
//---Start cut here---
|
||||
struct hamlib_port_deprecated;
|
||||
typedef struct hamlib_port_deprecated hamlib_port_t_deprecated;
|
||||
//---End cut here---
|
||||
|
||||
/**
|
||||
* \brief Rig structure definition (see rig for details).
|
||||
|
@ -2354,159 +2360,19 @@ struct hamlib_async_pipe;
|
|||
|
||||
typedef struct hamlib_async_pipe hamlib_async_pipe_t;
|
||||
|
||||
/**
|
||||
* \brief Port definition
|
||||
*
|
||||
* Of course, looks like OO painstakingly programmed in C, sigh.
|
||||
*/
|
||||
//! @cond Doxygen_Suppress
|
||||
// DO NOT CHANGE THIS STRUCTURE ALL UNTIL 5.0
|
||||
// Right now it is static inside rig structure
|
||||
// 5.0 will change it to a pointer which can then be added to
|
||||
// At that point only add to the end of the structure
|
||||
typedef struct hamlib_port {
|
||||
union {
|
||||
rig_port_t rig; /*!< Communication port type */
|
||||
ptt_type_t ptt; /*!< PTT port type */
|
||||
dcd_type_t dcd; /*!< DCD port type */
|
||||
} type;
|
||||
//---Start cut here---
|
||||
// Definition of struct hamlib_port moved to port.h
|
||||
// Temporary include here until 5.0
|
||||
/* For non-invasive debugging */
|
||||
#ifndef NO_OLD_INCLUDES
|
||||
__END_DECLS
|
||||
|
||||
int fd; /*!< File descriptor */
|
||||
void *handle; /*!< handle for USB */
|
||||
#include <hamlib/port.h>
|
||||
|
||||
int write_delay; /*!< Delay between each byte sent out, in mS */
|
||||
int post_write_delay; /*!< Delay between each commands send out, in mS */
|
||||
|
||||
struct {
|
||||
int tv_sec, tv_usec;
|
||||
} post_write_date; /*!< hamlib internal use */
|
||||
|
||||
int timeout; /*!< Timeout, in mS */
|
||||
short retry; /*!< Maximum number of retries, 0 to disable */
|
||||
short flushx; /*!< If true flush is done with read instead of TCFLUSH - MicroHam */
|
||||
|
||||
char pathname[HAMLIB_FILPATHLEN]; /*!< Port pathname */
|
||||
|
||||
union {
|
||||
struct {
|
||||
int rate; /*!< Serial baud rate */
|
||||
int data_bits; /*!< Number of data bits */
|
||||
int stop_bits; /*!< Number of stop bits */
|
||||
enum serial_parity_e parity; /*!< Serial parity */
|
||||
enum serial_handshake_e handshake; /*!< Serial handshake */
|
||||
enum serial_control_state_e rts_state; /*!< RTS set state */
|
||||
enum serial_control_state_e dtr_state; /*!< DTR set state */
|
||||
} serial; /*!< serial attributes */
|
||||
|
||||
struct {
|
||||
int pin; /*!< Parallel port pin number */
|
||||
} parallel; /*!< parallel attributes */
|
||||
|
||||
struct {
|
||||
int ptt_bitnum; /*!< Bit number for CM108 GPIO PTT */
|
||||
} cm108; /*!< CM108 attributes */
|
||||
|
||||
struct {
|
||||
int vid; /*!< Vendor ID */
|
||||
int pid; /*!< Product ID */
|
||||
int conf; /*!< Configuration */
|
||||
int iface; /*!< interface */
|
||||
int alt; /*!< alternate */
|
||||
char *vendor_name; /*!< Vendor name (opt.) */
|
||||
char *product; /*!< Product (opt.) */
|
||||
} usb; /*!< USB attributes */
|
||||
|
||||
struct {
|
||||
int on_value; /*!< GPIO: 1 == normal, GPION: 0 == inverted */
|
||||
int value; /*!< Toggle PTT ON or OFF */
|
||||
} gpio; /*!< GPIO attributes */
|
||||
} parm; /*!< Port parameter union */
|
||||
int client_port; /*!< client socket port for tcp connection */
|
||||
RIG *rig; /*!< our parent RIG device */
|
||||
int asyncio; /*!< enable asynchronous data handling if true -- async collides with python keyword so _async is used */
|
||||
#if defined(_WIN32)
|
||||
hamlib_async_pipe_t *sync_data_pipe; /*!< pipe data structure for synchronous data */
|
||||
hamlib_async_pipe_t *sync_data_error_pipe; /*!< pipe data structure for synchronous data error codes */
|
||||
#else
|
||||
int fd_sync_write; /*!< file descriptor for writing synchronous data */
|
||||
int fd_sync_read; /*!< file descriptor for reading synchronous data */
|
||||
int fd_sync_error_write; /*!< file descriptor for writing synchronous data error codes */
|
||||
int fd_sync_error_read; /*!< file descriptor for reading synchronous data error codes */
|
||||
#endif
|
||||
short timeout_retry; /*!< number of retries to make in case of read timeout errors, some serial interfaces may require this, 0 to disable */
|
||||
// DO NOT ADD ANYTHING HERE UNTIL 5.0!!
|
||||
} hamlib_port_t;
|
||||
|
||||
|
||||
// DO NOT CHANGE THIS STRUCTURE AT ALL
|
||||
// Will be removed in 5.0
|
||||
typedef struct hamlib_port_deprecated {
|
||||
union {
|
||||
rig_port_t rig; /*!< Communication port type */
|
||||
ptt_type_t ptt; /*!< PTT port type */
|
||||
dcd_type_t dcd; /*!< DCD port type */
|
||||
} type;
|
||||
|
||||
int fd; /*!< File descriptor */
|
||||
void *handle; /*!< handle for USB */
|
||||
|
||||
int write_delay; /*!< Delay between each byte sent out, in mS */
|
||||
int post_write_delay; /*!< Delay between each commands send out, in mS */
|
||||
|
||||
struct {
|
||||
int tv_sec, tv_usec;
|
||||
} post_write_date; /*!< hamlib internal use */
|
||||
|
||||
int timeout; /*!< Timeout, in mS */
|
||||
short retry; /*!< Maximum number of retries, 0 to disable */
|
||||
short flushx; /*!< If true flush is done with read instead of TCFLUSH - MicroHam */
|
||||
|
||||
char pathname[HAMLIB_FILPATHLEN]; /*!< Port pathname */
|
||||
|
||||
union {
|
||||
struct {
|
||||
int rate; /*!< Serial baud rate */
|
||||
int data_bits; /*!< Number of data bits */
|
||||
int stop_bits; /*!< Number of stop bits */
|
||||
enum serial_parity_e parity; /*!< Serial parity */
|
||||
enum serial_handshake_e handshake; /*!< Serial handshake */
|
||||
enum serial_control_state_e rts_state; /*!< RTS set state */
|
||||
enum serial_control_state_e dtr_state; /*!< DTR set state */
|
||||
} serial; /*!< serial attributes */
|
||||
|
||||
struct {
|
||||
int pin; /*!< Parallel port pin number */
|
||||
} parallel; /*!< parallel attributes */
|
||||
|
||||
struct {
|
||||
int ptt_bitnum; /*!< Bit number for CM108 GPIO PTT */
|
||||
} cm108; /*!< CM108 attributes */
|
||||
|
||||
struct {
|
||||
int vid; /*!< Vendor ID */
|
||||
int pid; /*!< Product ID */
|
||||
int conf; /*!< Configuration */
|
||||
int iface; /*!< interface */
|
||||
int alt; /*!< alternate */
|
||||
char *vendor_name; /*!< Vendor name (opt.) */
|
||||
char *product; /*!< Product (opt.) */
|
||||
} usb; /*!< USB attributes */
|
||||
|
||||
struct {
|
||||
int on_value; /*!< GPIO: 1 == normal, GPION: 0 == inverted */
|
||||
int value; /*!< Toggle PTT ON or OFF */
|
||||
} gpio; /*!< GPIO attributes */
|
||||
} parm; /*!< Port parameter union */
|
||||
int client_port; /*!< client socket port for tcp connection */
|
||||
RIG *rig; /*!< our parent RIG device */
|
||||
} hamlib_port_t_deprecated;
|
||||
//! @endcond
|
||||
|
||||
#if !defined(__APPLE__) || !defined(__cplusplus)
|
||||
typedef hamlib_port_t_deprecated port_t_deprecated;
|
||||
typedef hamlib_port_t port_t;
|
||||
__BEGIN_DECLS
|
||||
#endif
|
||||
|
||||
//---End cut here---
|
||||
/* Macros to access data structures/pointers
|
||||
* Make it easier to change location in preparation
|
||||
* for moving them out of rig->state.
|
||||
|
@ -2519,16 +2385,16 @@ typedef hamlib_port_t port_t;
|
|||
// Note: Experimental, and subject to change!!
|
||||
#if defined(IN_HAMLIB)
|
||||
/* These are for internal use only */
|
||||
#define RIGPORT(r) (&r->state.rigport)
|
||||
#define PTTPORT(r) (&r->state.pttport)
|
||||
#define DCDPORT(r) (&r->state.dcdport)
|
||||
//Moved to cache.h #define CACHE(r) ((r)->cache_addr)
|
||||
#define AMPPORT(a) (&a->state.ampport)
|
||||
#define ROTPORT(r) (&r->state.rotport)
|
||||
#define ROTPORT2(r) (&r->state.rotport2)
|
||||
#define STATE(r) (&r->state)
|
||||
#define AMPSTATE(a) (&(a)->state)
|
||||
#define ROTSTATE(r) (&(r)->state)
|
||||
#define RIGPORT(r) (&(r)->state.rigport)
|
||||
#define PTTPORT(r) (&(r)->state.pttport)
|
||||
#define DCDPORT(r) (&(r)->state.dcdport)
|
||||
//Moved to src/cache.h #define CACHE(r) ((r)->cache_addr)
|
||||
#define AMPPORT(a) (&(a)->state.ampport)
|
||||
#define ROTPORT(r) (&(r)->state.rotport)
|
||||
#define ROTPORT2(r) (&(r)->state.rotport2)
|
||||
//Moved to include/hamlib/rig_state.h #define STATE(r) (&r->state)
|
||||
//Moved to include/hamlib/amp_state.h #define AMPSTATE(a) (&(a)->state)
|
||||
//Moved to include/hamlib/rot_state.h #define ROTSTATE(r) (&(r)->state)
|
||||
/* Then when the rigport address is stored as a pointer somewhere else(say,
|
||||
* in the rig structure itself), the definition could be changed to
|
||||
* #define RIGPORT(r) r->somewhereelse
|
||||
|
@ -2536,16 +2402,16 @@ typedef hamlib_port_t port_t;
|
|||
*/
|
||||
#else
|
||||
/* Define external unique names */
|
||||
#define HAMLIB_RIGPORT(r) ((hamlib_port_t *)rig_data_pointer(r, RIG_PTRX_RIGPORT))
|
||||
#define HAMLIB_PTTPORT(r) ((hamlib_port_t *)rig_data_pointer(r, RIG_PTRX_PTTPORT))
|
||||
#define HAMLIB_DCDPORT(r) ((hamlib_port_t *)rig_data_pointer(r, RIG_PTRX_DCDPORT))
|
||||
//#define HAMLIB_RIGPORT(r) ((hamlib_port_t *)rig_data_pointer(r, RIG_PTRX_RIGPORT))
|
||||
//#define HAMLIB_PTTPORT(r) ((hamlib_port_t *)rig_data_pointer(r, RIG_PTRX_PTTPORT))
|
||||
//#define HAMLIB_DCDPORT(r) ((hamlib_port_t *)rig_data_pointer(r, RIG_PTRX_DCDPORT))
|
||||
//#define HAMLIB_CACHE(r) ((struct rig_cache *)rig_data_pointer(r, RIG_PTRX_CACHE))
|
||||
#define HAMLIB_AMPPORT(a) ((hamlib_port_t *)amp_data_pointer(a, RIG_PTRX_AMPPORT))
|
||||
#define HAMLIB_ROTPORT(r) ((hamlib_port_t *)rot_data_pointer(r, RIG_PTRX_ROTPORT))
|
||||
#define HAMLIB_ROTPORT2(r) ((hamlib_port_t *)rot_data_pointer(r, RIG_PTRX_ROTPORT2))
|
||||
#define HAMLIB_STATE(r) ((struct rig_state *)rig_data_pointer(r, RIG_PTRX_STATE))
|
||||
#define HAMLIB_AMPSTATE(a) ((struct amp_state *)amp_data_pointer(a, RIG_PTRX_AMPSTATE))
|
||||
#define HAMLIB_ROTSTATE(r) ((struct rot_state *)rot_data_pointer(r, RIG_PTRX_ROTSTATE))
|
||||
//#define HAMLIB_AMPPORT(a) ((hamlib_port_t *)amp_data_pointer(a, RIG_PTRX_AMPPORT))
|
||||
//#define HAMLIB_ROTPORT(r) ((hamlib_port_t *)rot_data_pointer(r, RIG_PTRX_ROTPORT))
|
||||
//#define HAMLIB_ROTPORT2(r) ((hamlib_port_t *)rot_data_pointer(r, RIG_PTRX_ROTPORT2))
|
||||
//#define HAMLIB_STATE(r) ((struct rig_state *)rig_data_pointer(r, RIG_PTRX_STATE))
|
||||
//#define HAMLIB_AMPSTATE(a) ((struct amp_state *)amp_data_pointer(a, RIG_PTRX_AMPSTATE))
|
||||
//#define HAMLIB_ROTSTATE(r) ((struct rot_state *)rot_data_pointer(r, RIG_PTRX_ROTSTATE))
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
|
@ -2699,337 +2565,18 @@ typedef unsigned int rig_comm_status_t;
|
|||
#define RIG_COMM_STATUS_WARNING 0x04
|
||||
#define RIG_COMM_STATUS_ERROR 0x05
|
||||
|
||||
/**
|
||||
* \brief Rig state containing live data and customized fields.
|
||||
*
|
||||
* This struct contains live data, as well as a copy of capability fields
|
||||
* that may be updated (ie. customized)
|
||||
*
|
||||
* It is NOT fine to move fields around as it can break shared library offset
|
||||
* As of 2024-03-03 freq_event_elapsed is the last known item being reference externally
|
||||
* So any additions or changes to this structure must be at the end of the structure
|
||||
*/
|
||||
struct rig_state {
|
||||
/********* ENSURE ANY NEW ITEMS ARE ADDED AT BOTTOM OF THIS STRUCTURE *********/
|
||||
/*
|
||||
* overridable fields
|
||||
*/
|
||||
// moving the hamlib_port_t to the end of rig_state and making it a pointer
|
||||
// this should allow changes to hamlib_port_t without breaking shared libraries
|
||||
// these will maintain a copy of the new port_t for backwards compatibility
|
||||
// to these offsets -- note these must stay until a major version update is done like 5.0
|
||||
hamlib_port_t_deprecated rigport_deprecated; /*!< Rig port (internal use). */
|
||||
hamlib_port_t_deprecated pttport_deprecated; /*!< PTT port (internal use). */
|
||||
hamlib_port_t_deprecated dcdport_deprecated; /*!< DCD port (internal use). */
|
||||
//---Start cut here---
|
||||
/* rig_state definition moved to include/hamlib/rig_state.h */
|
||||
#ifndef NO_OLD_INCLUDES
|
||||
|
||||
double vfo_comp; /*!< VFO compensation in PPM, 0.0 to disable */
|
||||
__END_DECLS
|
||||
|
||||
int deprecated_itu_region; /*!< ITU region to select among freq_range_t */
|
||||
freq_range_t rx_range_list[HAMLIB_FRQRANGESIZ]; /*!< Receive frequency range list */
|
||||
freq_range_t tx_range_list[HAMLIB_FRQRANGESIZ]; /*!< Transmit frequency range list */
|
||||
#include <hamlib/rig_state.h>
|
||||
|
||||
struct tuning_step_list tuning_steps[HAMLIB_TSLSTSIZ]; /*!< Tuning step list */
|
||||
__BEGIN_DECLS
|
||||
|
||||
struct filter_list filters[HAMLIB_FLTLSTSIZ]; /*!< Mode/filter table, at -6dB */
|
||||
|
||||
cal_table_t str_cal; /*!< S-meter calibration table */
|
||||
|
||||
chan_t chan_list[HAMLIB_CHANLSTSIZ]; /*!< Channel list, zero ended */
|
||||
|
||||
shortfreq_t max_rit; /*!< max absolute RIT */
|
||||
shortfreq_t max_xit; /*!< max absolute XIT */
|
||||
shortfreq_t max_ifshift; /*!< max absolute IF-SHIFT */
|
||||
|
||||
ann_t announces; /*!< Announces bit field list */
|
||||
|
||||
int preamp[HAMLIB_MAXDBLSTSIZ]; /*!< Preamp list in dB, 0 terminated */
|
||||
int attenuator[HAMLIB_MAXDBLSTSIZ]; /*!< Attenuator list in dB, 0 terminated */
|
||||
|
||||
setting_t has_get_func; /*!< List of get functions */
|
||||
setting_t has_set_func; /*!< List of set functions */
|
||||
setting_t has_get_level; /*!< List of get level */
|
||||
setting_t has_set_level; /*!< List of set level */
|
||||
setting_t has_get_parm; /*!< List of get parm */
|
||||
setting_t has_set_parm; /*!< List of set parm */
|
||||
|
||||
gran_t level_gran[RIG_SETTING_MAX]; /*!< level granularity */
|
||||
gran_t parm_gran[RIG_SETTING_MAX]; /*!< parm granularity */
|
||||
|
||||
|
||||
/*
|
||||
* non overridable fields, internal use
|
||||
*/
|
||||
|
||||
int transaction_active; /*!< set to 1 to inform the async reader thread that a synchronous command transaction is waiting for a response, otherwise 0 */
|
||||
vfo_t current_vfo; /*!< VFO currently set */
|
||||
int vfo_list; /*!< Complete list of VFO for this rig */
|
||||
int comm_state; /*!< Comm port state, opened/closed. */
|
||||
rig_ptr_t priv; /*!< Pointer to private rig state data. */
|
||||
rig_ptr_t obj; /*!< Internal use by hamlib++ for event handling. */
|
||||
|
||||
int async_data_enabled; /*!< Whether async data mode is enabled */
|
||||
int poll_interval; /*!< Rig state polling period in milliseconds */
|
||||
freq_t current_freq; /*!< Frequency currently set */
|
||||
rmode_t current_mode; /*!< Mode currently set */
|
||||
//rmode_t current_modeB; /*!< Mode currently set VFOB */
|
||||
pbwidth_t current_width; /*!< Passband width currently set */
|
||||
vfo_t tx_vfo; /*!< Tx VFO currently set */
|
||||
rmode_t mode_list; /*!< Complete list of modes for this rig */
|
||||
// mode_list is used by some
|
||||
// so anything added to this structure must be below here
|
||||
int transmit; /*!< rig should be transmitting i.e. hard
|
||||
wired PTT asserted - used by rigs that
|
||||
don't do CAT while in Tx */
|
||||
freq_t lo_freq; /*!< Local oscillator frequency of any transverter */
|
||||
time_t twiddle_time; /*!< time when vfo twiddling was detected */
|
||||
int twiddle_timeout; /*!< timeout to resume from twiddling */
|
||||
// uplink allows gpredict to behave better by no reading the uplink VFO
|
||||
int uplink; /*!< uplink=1 will not read Sub, uplink=2 will not read Main */
|
||||
struct rig_cache_deprecated cache; // Only here for backward compatability
|
||||
int vfo_opt; /*!< Is -o switch turned on? */
|
||||
int auto_power_on; /*!< Allow Hamlib to power on rig
|
||||
automatically if supported */
|
||||
int auto_power_off; /*!< Allow Hamlib to power off rig
|
||||
automatically if supported */
|
||||
int auto_disable_screensaver; /*!< Allow Hamlib to disable the
|
||||
rig's screen saver automatically if
|
||||
supported */
|
||||
int ptt_share; /*!< Share ptt port by open/close during get_ptt, set_ptt hogs the port while active */
|
||||
int power_now; /*!< Current RF power level in rig units */
|
||||
int power_min; /*!< Minimum RF power level in rig units */
|
||||
int power_max; /*!< Maximum RF power level in rig units */
|
||||
unsigned char disable_yaesu_bandselect; /*!< Disables Yaesu band select logic */
|
||||
int twiddle_rit; /*!< Suppresses VFOB reading (cached value used) so RIT control can be used */
|
||||
int twiddle_state; /*!< keeps track of twiddle status */
|
||||
vfo_t rx_vfo; /*!< Rx VFO currently set */
|
||||
|
||||
volatile unsigned int snapshot_packet_sequence_number;
|
||||
|
||||
volatile int multicast_publisher_run;
|
||||
void *multicast_publisher_priv_data;
|
||||
volatile int async_data_handler_thread_run;
|
||||
void *async_data_handler_priv_data;
|
||||
volatile int poll_routine_thread_run;
|
||||
void *poll_routine_priv_data;
|
||||
pthread_mutex_t mutex_set_transaction;
|
||||
hamlib_port_t rigport; /*!< Rig port (internal use). */
|
||||
hamlib_port_t pttport; /*!< PTT port (internal use). */
|
||||
hamlib_port_t dcdport; /*!< DCD port (internal use). */
|
||||
/********* DO NOT ADD or CHANGE anything (or than to rename) ABOVE THIS LINE *********/
|
||||
/********* ENSURE ANY NEW ITEMS ARE ADDED AFTER HERE *********/
|
||||
/* flags instructing the rig_get routines to use cached values when asyncio is in use */
|
||||
int use_cached_freq; /*!< flag instructing rig_get_freq to use cached values when asyncio is in use */
|
||||
int use_cached_mode; /*!< flag instructing rig_get_mode to use cached values when asyncio is in use */
|
||||
int use_cached_ptt; /*!< flag instructing rig_get_ptt to use cached values when asyncio is in use */
|
||||
int depth; /*!< a depth counter to use for debug indentation and such */
|
||||
int lock_mode; /*!< flag that prevents mode changes if ~= 0 -- see set/get_lock_mode */
|
||||
powerstat_t powerstat; /*!< power status */
|
||||
char *tuner_control_pathname; /*!< Path to external tuner control program that get 0/1 (Off/On) argument */
|
||||
char client_version[32]; /*!<! Allow client to report version for compatibility checks/capability */
|
||||
freq_t offset_vfoa; /*!< Offset to apply to VFOA/Main set_freq */
|
||||
freq_t offset_vfob; /*!< Offset to apply to VFOB/Sub set_freq */
|
||||
struct multicast_s *multicast; /*!< Pointer to multicast server data */
|
||||
// Adding a number of items so netrigctl can see the real rig information
|
||||
// Eventually may want to add these so that rigctld can see more of the backend
|
||||
// But that will come later if requested -- for now they just fill out dumpstate.c
|
||||
rig_model_t rig_model; /*!< Rig model. */
|
||||
const char *model_name; /*!< Model name. */
|
||||
const char *mfg_name; /*!< Manufacturer. */
|
||||
const char *version; /*!< Driver version. */
|
||||
const char *copyright; /*!< Copyright info. */
|
||||
enum rig_status_e status; /*!< Driver status. */
|
||||
int rig_type; /*!< Rig type. */
|
||||
ptt_type_t ptt_type; /*!< Type of the PTT port. */
|
||||
dcd_type_t dcd_type; /*!< Type of the DCD port. */
|
||||
rig_port_t port_type; /*!< Type of communication port. */
|
||||
int serial_rate_min; /*!< Minimum serial speed. */
|
||||
int serial_rate_max; /*!< Maximum serial speed. */
|
||||
int serial_data_bits; /*!< Number of data bits. */
|
||||
int serial_stop_bits; /*!< Number of stop bits. */
|
||||
enum serial_parity_e serial_parity; /*!< Parity. */
|
||||
enum serial_handshake_e serial_handshake; /*!< Handshake. */
|
||||
int write_delay; /*!< Delay between each byte sent out, in mS */
|
||||
int post_write_delay; /*!< Delay between each commands send out, in mS */
|
||||
int timeout; /*!< Timeout, in mS */
|
||||
int retry; /*!< Maximum number of retries if command fails, 0 to disable */
|
||||
int targetable_vfo; /*!< Bit field list of direct VFO access commands */
|
||||
int async_data_supported; /*!< Indicates that rig is capable of outputting asynchronous data updates, such as transceive state updates or spectrum data. 1 if true, 0 otherwise. */
|
||||
int agc_level_count; /*!< Number of supported AGC levels. Zero indicates all modes should be available (for backwards-compatibility). */
|
||||
enum agc_level_e agc_levels[HAMLIB_MAX_AGC_LEVELS]; /*!< Supported AGC levels */
|
||||
tone_t *ctcss_list; /*!< CTCSS tones list, zero ended */
|
||||
tone_t *dcs_list; /*!< DCS code list, zero ended */
|
||||
vfo_op_t vfo_ops; /*!< VFO op bit field list */
|
||||
scan_t scan_ops; /*!< Scan bit field list */
|
||||
int transceive; /*!< \deprecated Use async_data_supported instead */
|
||||
int bank_qty; /*!< Number of banks */
|
||||
int chan_desc_sz; /*!< Max length of memory channel name */
|
||||
freq_range_t rx_range_list1[HAMLIB_FRQRANGESIZ]; /*!< Receive frequency range list #1 */
|
||||
freq_range_t tx_range_list1[HAMLIB_FRQRANGESIZ]; /*!< Transmit frequency range list #1 */
|
||||
freq_range_t rx_range_list2[HAMLIB_FRQRANGESIZ]; /*!< Receive frequency range list #2 */
|
||||
freq_range_t tx_range_list2[HAMLIB_FRQRANGESIZ]; /*!< Transmit frequency range list #2 */
|
||||
freq_range_t rx_range_list3[HAMLIB_FRQRANGESIZ]; /*!< Receive frequency range list #3 */
|
||||
freq_range_t tx_range_list3[HAMLIB_FRQRANGESIZ]; /*!< Transmit frequency range list #3 */
|
||||
freq_range_t rx_range_list4[HAMLIB_FRQRANGESIZ]; /*!< Receive frequency range list #4 */
|
||||
freq_range_t tx_range_list4[HAMLIB_FRQRANGESIZ]; /*!< Transmit frequency range list #4 */
|
||||
freq_range_t rx_range_list5[HAMLIB_FRQRANGESIZ]; /*!< Receive frequency range list #5 */
|
||||
freq_range_t tx_range_list5[HAMLIB_FRQRANGESIZ]; /*!< Transmit frequency range list #5 */
|
||||
struct rig_spectrum_scope spectrum_scopes[HAMLIB_MAX_SPECTRUM_SCOPES]; /*!< Supported spectrum scopes. The array index must match the scope ID. Last entry must have NULL name. */
|
||||
enum rig_spectrum_mode_e spectrum_modes[HAMLIB_MAX_SPECTRUM_MODES]; /*!< Supported spectrum scope modes. Last entry must be RIG_SPECTRUM_MODE_NONE. */
|
||||
freq_t spectrum_spans[HAMLIB_MAX_SPECTRUM_SPANS]; /*!< Supported spectrum scope frequency spans in Hz in center mode. Last entry must be 0. */
|
||||
struct rig_spectrum_avg_mode spectrum_avg_modes[HAMLIB_MAX_SPECTRUM_AVG_MODES]; /*!< Supported spectrum scope averaging modes. Last entry must have NULL name. */
|
||||
int spectrum_attenuator[HAMLIB_MAXDBLSTSIZ]; /*!< Spectrum attenuator list in dB, 0 terminated */
|
||||
volatile int morse_data_handler_thread_run;
|
||||
void *morse_data_handler_priv_data;
|
||||
FIFO_RIG *fifo_morse;
|
||||
int doppler; /*!< True if doppler changing detected */
|
||||
char *multicast_data_addr; /*!< Multicast data UDP address for publishing rig data and state */
|
||||
int multicast_data_port; /*!< Multicast data UDP port for publishing rig data and state */
|
||||
char *multicast_cmd_addr; /*!< Multicast command server UDP address for sending commands to rig */
|
||||
int multicast_cmd_port; /*!< Multicast command server UDP port for sending commands to rig */
|
||||
volatile int multicast_receiver_run;
|
||||
void *multicast_receiver_priv_data;
|
||||
rig_comm_status_t comm_status; /*!< Detailed rig control status */
|
||||
char device_id[HAMLIB_RIGNAMSIZ];
|
||||
int dual_watch; /*!< Boolean DUAL_WATCH status */
|
||||
int post_ptt_delay; /*!< delay after PTT to allow for relays and such */
|
||||
struct timespec freq_event_elapsed;
|
||||
int freq_skip; /*!< allow frequency skip for gpredict RX/TX freq set */
|
||||
client_t client;
|
||||
pthread_mutex_t api_mutex; // Lock for any API entry
|
||||
// New rig_state items go before this line ============================================
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Deprecated Rig state containing live data and customized fields.
|
||||
* Due to DLL problems this remains in-place in the rig_caps structure but is no longer referred to
|
||||
* A new rig_state has been added at the end of the structure instead of the middle
|
||||
*
|
||||
* This struct contains no data and is just a place holder for DLL alignment
|
||||
*
|
||||
* It is NOT fine to touch this struct AT ALL!!!
|
||||
*/
|
||||
struct rig_state_deprecated {
|
||||
/********* ENSURE YOU DO NOT EVER MODIFY THIS STRUCTURE *********/
|
||||
/********* It will remain forever to provide DLL backwards compatibility ******/
|
||||
/*
|
||||
* overridable fields
|
||||
*/
|
||||
// moving the hamlib_port_t to the end of rig_state and making it a pointer
|
||||
// this should allow changes to hamlib_port_t without breaking shared libraries
|
||||
// these will maintain a copy of the new port_t for backwards compatibility
|
||||
// to these offsets -- note these must stay until a major version update is done like 5.0
|
||||
hamlib_port_t_deprecated rigport_deprecated; /*!< Rig port (internal use). */
|
||||
hamlib_port_t_deprecated pttport_deprecated; /*!< PTT port (internal use). */
|
||||
hamlib_port_t_deprecated dcdport_deprecated; /*!< DCD port (internal use). */
|
||||
|
||||
double vfo_comp; /*!< VFO compensation in PPM, 0.0 to disable */
|
||||
|
||||
int deprecated_itu_region; /*!< ITU region to select among freq_range_t */
|
||||
freq_range_t rx_range_list[HAMLIB_FRQRANGESIZ]; /*!< Receive frequency range list */
|
||||
freq_range_t tx_range_list[HAMLIB_FRQRANGESIZ]; /*!< Transmit frequency range list */
|
||||
|
||||
struct tuning_step_list tuning_steps[HAMLIB_TSLSTSIZ]; /*!< Tuning step list */
|
||||
|
||||
struct filter_list filters[HAMLIB_FLTLSTSIZ]; /*!< Mode/filter table, at -6dB */
|
||||
|
||||
cal_table_t str_cal; /*!< S-meter calibration table */
|
||||
|
||||
chan_t chan_list[HAMLIB_CHANLSTSIZ]; /*!< Channel list, zero ended */
|
||||
|
||||
shortfreq_t max_rit; /*!< max absolute RIT */
|
||||
shortfreq_t max_xit; /*!< max absolute XIT */
|
||||
shortfreq_t max_ifshift; /*!< max absolute IF-SHIFT */
|
||||
|
||||
ann_t announces; /*!< Announces bit field list */
|
||||
|
||||
int preamp[HAMLIB_MAXDBLSTSIZ]; /*!< Preamp list in dB, 0 terminated */
|
||||
int attenuator[HAMLIB_MAXDBLSTSIZ]; /*!< Attenuator list in dB, 0 terminated */
|
||||
|
||||
setting_t has_get_func; /*!< List of get functions */
|
||||
setting_t has_set_func; /*!< List of set functions */
|
||||
setting_t has_get_level; /*!< List of get level */
|
||||
setting_t has_set_level; /*!< List of set level */
|
||||
setting_t has_get_parm; /*!< List of get parm */
|
||||
setting_t has_set_parm; /*!< List of set parm */
|
||||
|
||||
gran_t level_gran[RIG_SETTING_MAX]; /*!< level granularity */
|
||||
gran_t parm_gran[RIG_SETTING_MAX]; /*!< parm granularity */
|
||||
|
||||
|
||||
/*
|
||||
* non overridable fields, internal use
|
||||
*/
|
||||
|
||||
int transaction_active; /*!< set to 1 to inform the async reader thread that a synchronous command transaction is waiting for a response, otherwise 0 */
|
||||
vfo_t current_vfo; /*!< VFO currently set */
|
||||
int vfo_list; /*!< Complete list of VFO for this rig */
|
||||
int comm_state; /*!< Comm port state, opened/closed. */
|
||||
rig_ptr_t priv; /*!< Pointer to private rig state data. */
|
||||
rig_ptr_t obj; /*!< Internal use by hamlib++ for event handling. */
|
||||
|
||||
int async_data_enabled; /*!< Whether async data mode is enabled */
|
||||
int poll_interval; /*!< Rig state polling period in milliseconds */
|
||||
freq_t current_freq; /*!< Frequency currently set */
|
||||
rmode_t current_mode; /*!< Mode currently set */
|
||||
//rmode_t current_modeB; /*!< Mode currently set VFOB */
|
||||
pbwidth_t current_width; /*!< Passband width currently set */
|
||||
vfo_t tx_vfo; /*!< Tx VFO currently set */
|
||||
rmode_t mode_list; /*!< Complete list of modes for this rig */
|
||||
// mode_list is used by some
|
||||
// so anything added to this structure must be below here
|
||||
int transmit; /*!< rig should be transmitting i.e. hard
|
||||
wired PTT asserted - used by rigs that
|
||||
don't do CAT while in Tx */
|
||||
freq_t lo_freq; /*!< Local oscillator frequency of any transverter */
|
||||
time_t twiddle_time; /*!< time when vfo twiddling was detected */
|
||||
int twiddle_timeout; /*!< timeout to resume from twiddling */
|
||||
// uplink allows gpredict to behave better by no reading the uplink VFO
|
||||
int uplink; /*!< uplink=1 will not read Sub, uplink=2 will not read Main */
|
||||
struct rig_cache_deprecated cache; // Here for backward compatibility
|
||||
int vfo_opt; /*!< Is -o switch turned on? */
|
||||
int auto_power_on; /*!< Allow Hamlib to power on rig
|
||||
automatically if supported */
|
||||
int auto_power_off; /*!< Allow Hamlib to power off rig
|
||||
automatically if supported */
|
||||
int auto_disable_screensaver; /*!< Allow Hamlib to disable the
|
||||
rig's screen saver automatically if
|
||||
supported */
|
||||
int ptt_share; /*!< Share ptt port by open/close during get_ptt, set_ptt hogs the port while active */
|
||||
int power_now; /*!< Current RF power level in rig units */
|
||||
int power_min; /*!< Minimum RF power level in rig units */
|
||||
int power_max; /*!< Maximum RF power level in rig units */
|
||||
unsigned char disable_yaesu_bandselect; /*!< Disables Yaesu band select logic */
|
||||
int twiddle_rit; /*!< Suppresses VFOB reading (cached value used) so RIT control can be used */
|
||||
int twiddle_state; /*!< keeps track of twiddle status */
|
||||
vfo_t rx_vfo; /*!< Rx VFO currently set */
|
||||
|
||||
volatile unsigned int snapshot_packet_sequence_number;
|
||||
|
||||
volatile int multicast_publisher_run;
|
||||
void *multicast_publisher_priv_data;
|
||||
volatile int async_data_handler_thread_run;
|
||||
void *async_data_handler_priv_data;
|
||||
volatile int poll_routine_thread_run;
|
||||
void *poll_routine_priv_data;
|
||||
pthread_mutex_t mutex_set_transaction;
|
||||
hamlib_port_t rigport; /*!< Rig port (internal use). */
|
||||
hamlib_port_t pttport; /*!< PTT port (internal use). */
|
||||
hamlib_port_t dcdport; /*!< DCD port (internal use). */
|
||||
/********* DO NOT ADD or CHANGE anything (or than to rename) ABOVE THIS LINE *********/
|
||||
/********* ENSURE ANY NEW ITEMS ARE ADDED AFTER HERE *********/
|
||||
/* flags instructing the rig_get routines to use cached values when asyncio is in use */
|
||||
int use_cached_freq; /*!< flag instructing rig_get_freq to use cached values when asyncio is in use */
|
||||
int use_cached_mode; /*!< flag instructing rig_get_mode to use cached values when asyncio is in use */
|
||||
int use_cached_ptt; /*!< flag instructing rig_get_ptt to use cached values when asyncio is in use */
|
||||
int depth; /*!< a depth counter to use for debug indentation and such */
|
||||
int lock_mode; /*!< flag that prevents mode changes if ~= 0 -- see set/get_lock_mode */
|
||||
powerstat_t powerstat; /*!< power status */
|
||||
char *tuner_control_pathname; /*!< Path to external tuner control program that get 0/1 (Off/On) argument */
|
||||
char client_version[32]; /*!<! Allow client to report version for compatibility checks/capability */
|
||||
freq_t offset_vfoa; /*!< Offset to apply to VFOA/Main set_freq */
|
||||
freq_t offset_vfob; /*!< Offset to apply to VFOB/Sub set_freq */
|
||||
struct multicast_s *multicast; /*!< Pointer to multicast server data */
|
||||
};
|
||||
#endif
|
||||
//---End cut here---
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
typedef int (*vprintf_cb_t)(enum rig_debug_level_e,
|
||||
|
@ -3052,7 +2599,6 @@ typedef int (*spectrum_cb_t)(RIG *,
|
|||
rig_ptr_t);
|
||||
|
||||
//! @endcond
|
||||
|
||||
/**
|
||||
* \brief Callback functions and args for rig event.
|
||||
*
|
||||
|
|
|
@ -0,0 +1,369 @@
|
|||
/*
|
||||
* Hamlib Interface - Rig state structure
|
||||
* Copyright (c) 2000-2025 The Hamlib Group
|
||||
* Copyright (c) 2025 George Baltz
|
||||
*
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#ifndef _RIG_STATE_H
|
||||
#define _RIG_STATE_H 1
|
||||
|
||||
__BEGIN_DECLS
|
||||
/**
|
||||
* \brief Rig state containing live data and customized fields.
|
||||
*
|
||||
* This struct contains live data, as well as a copy of capability fields
|
||||
* that may be updated (ie. customized)
|
||||
*
|
||||
* It is NOT fine to move fields around as it can break shared library offset
|
||||
* As of 2024-03-03 freq_event_elapsed is the last known item being reference externally
|
||||
* So any additions or changes to this structure must be at the end of the structure
|
||||
*/
|
||||
struct rig_state {
|
||||
/********* ENSURE ANY NEW ITEMS ARE ADDED AT BOTTOM OF THIS STRUCTURE *********/
|
||||
/*
|
||||
* overridable fields
|
||||
*/
|
||||
// moving the hamlib_port_t to the end of rig_state and making it a pointer
|
||||
// this should allow changes to hamlib_port_t without breaking shared libraries
|
||||
// these will maintain a copy of the new port_t for backwards compatibility
|
||||
// to these offsets -- note these must stay until a major version update is done like 5.0
|
||||
hamlib_port_t_deprecated rigport_deprecated; /*!< Rig port (internal use). */
|
||||
hamlib_port_t_deprecated pttport_deprecated; /*!< PTT port (internal use). */
|
||||
hamlib_port_t_deprecated dcdport_deprecated; /*!< DCD port (internal use). */
|
||||
|
||||
double vfo_comp; /*!< VFO compensation in PPM, 0.0 to disable */
|
||||
|
||||
int deprecated_itu_region; /*!< ITU region to select among freq_range_t */
|
||||
freq_range_t rx_range_list[HAMLIB_FRQRANGESIZ]; /*!< Receive frequency range list */
|
||||
freq_range_t tx_range_list[HAMLIB_FRQRANGESIZ]; /*!< Transmit frequency range list */
|
||||
|
||||
struct tuning_step_list tuning_steps[HAMLIB_TSLSTSIZ]; /*!< Tuning step list */
|
||||
|
||||
struct filter_list filters[HAMLIB_FLTLSTSIZ]; /*!< Mode/filter table, at -6dB */
|
||||
|
||||
cal_table_t str_cal; /*!< S-meter calibration table */
|
||||
|
||||
chan_t chan_list[HAMLIB_CHANLSTSIZ]; /*!< Channel list, zero ended */
|
||||
|
||||
shortfreq_t max_rit; /*!< max absolute RIT */
|
||||
shortfreq_t max_xit; /*!< max absolute XIT */
|
||||
shortfreq_t max_ifshift; /*!< max absolute IF-SHIFT */
|
||||
|
||||
ann_t announces; /*!< Announces bit field list */
|
||||
|
||||
int preamp[HAMLIB_MAXDBLSTSIZ]; /*!< Preamp list in dB, 0 terminated */
|
||||
int attenuator[HAMLIB_MAXDBLSTSIZ]; /*!< Attenuator list in dB, 0 terminated */
|
||||
|
||||
setting_t has_get_func; /*!< List of get functions */
|
||||
setting_t has_set_func; /*!< List of set functions */
|
||||
setting_t has_get_level; /*!< List of get level */
|
||||
setting_t has_set_level; /*!< List of set level */
|
||||
setting_t has_get_parm; /*!< List of get parm */
|
||||
setting_t has_set_parm; /*!< List of set parm */
|
||||
|
||||
gran_t level_gran[RIG_SETTING_MAX]; /*!< level granularity */
|
||||
gran_t parm_gran[RIG_SETTING_MAX]; /*!< parm granularity */
|
||||
|
||||
|
||||
/*
|
||||
* non overridable fields, internal use
|
||||
*/
|
||||
|
||||
int transaction_active; /*!< set to 1 to inform the async reader thread that a synchronous command transaction is waiting for a response, otherwise 0 */
|
||||
vfo_t current_vfo; /*!< VFO currently set */
|
||||
int vfo_list; /*!< Complete list of VFO for this rig */
|
||||
int comm_state; /*!< Comm port state, opened/closed. */
|
||||
rig_ptr_t priv; /*!< Pointer to private rig state data. */
|
||||
rig_ptr_t obj; /*!< Internal use by hamlib++ for event handling. */
|
||||
|
||||
int async_data_enabled; /*!< Whether async data mode is enabled */
|
||||
int poll_interval; /*!< Rig state polling period in milliseconds */
|
||||
freq_t current_freq; /*!< Frequency currently set */
|
||||
rmode_t current_mode; /*!< Mode currently set */
|
||||
//rmode_t current_modeB; /*!< Mode currently set VFOB */
|
||||
pbwidth_t current_width; /*!< Passband width currently set */
|
||||
vfo_t tx_vfo; /*!< Tx VFO currently set */
|
||||
rmode_t mode_list; /*!< Complete list of modes for this rig */
|
||||
// mode_list is used by some
|
||||
// so anything added to this structure must be below here
|
||||
int transmit; /*!< rig should be transmitting i.e. hard
|
||||
wired PTT asserted - used by rigs that
|
||||
don't do CAT while in Tx */
|
||||
freq_t lo_freq; /*!< Local oscillator frequency of any transverter */
|
||||
time_t twiddle_time; /*!< time when vfo twiddling was detected */
|
||||
int twiddle_timeout; /*!< timeout to resume from twiddling */
|
||||
// uplink allows gpredict to behave better by no reading the uplink VFO
|
||||
int uplink; /*!< uplink=1 will not read Sub, uplink=2 will not read Main */
|
||||
struct rig_cache_deprecated cache; // Only here for backward compatability
|
||||
int vfo_opt; /*!< Is -o switch turned on? */
|
||||
int auto_power_on; /*!< Allow Hamlib to power on rig
|
||||
automatically if supported */
|
||||
int auto_power_off; /*!< Allow Hamlib to power off rig
|
||||
automatically if supported */
|
||||
int auto_disable_screensaver; /*!< Allow Hamlib to disable the
|
||||
rig's screen saver automatically if
|
||||
supported */
|
||||
int ptt_share; /*!< Share ptt port by open/close during get_ptt, set_ptt hogs the port while active */
|
||||
int power_now; /*!< Current RF power level in rig units */
|
||||
int power_min; /*!< Minimum RF power level in rig units */
|
||||
int power_max; /*!< Maximum RF power level in rig units */
|
||||
unsigned char disable_yaesu_bandselect; /*!< Disables Yaesu band select logic */
|
||||
int twiddle_rit; /*!< Suppresses VFOB reading (cached value used) so RIT control can be used */
|
||||
int twiddle_state; /*!< keeps track of twiddle status */
|
||||
vfo_t rx_vfo; /*!< Rx VFO currently set */
|
||||
|
||||
volatile unsigned int snapshot_packet_sequence_number;
|
||||
|
||||
volatile int multicast_publisher_run;
|
||||
void *multicast_publisher_priv_data;
|
||||
volatile int async_data_handler_thread_run;
|
||||
void *async_data_handler_priv_data;
|
||||
volatile int poll_routine_thread_run;
|
||||
void *poll_routine_priv_data;
|
||||
pthread_mutex_t mutex_set_transaction;
|
||||
hamlib_port_t rigport; /*!< Rig port (internal use). */
|
||||
hamlib_port_t pttport; /*!< PTT port (internal use). */
|
||||
hamlib_port_t dcdport; /*!< DCD port (internal use). */
|
||||
/********* DO NOT ADD or CHANGE anything (or than to rename) ABOVE THIS LINE *********/
|
||||
/********* ENSURE ANY NEW ITEMS ARE ADDED AFTER HERE *********/
|
||||
/* flags instructing the rig_get routines to use cached values when asyncio is in use */
|
||||
int use_cached_freq; /*!< flag instructing rig_get_freq to use cached values when asyncio is in use */
|
||||
int use_cached_mode; /*!< flag instructing rig_get_mode to use cached values when asyncio is in use */
|
||||
int use_cached_ptt; /*!< flag instructing rig_get_ptt to use cached values when asyncio is in use */
|
||||
int depth; /*!< a depth counter to use for debug indentation and such */
|
||||
int lock_mode; /*!< flag that prevents mode changes if ~= 0 -- see set/get_lock_mode */
|
||||
powerstat_t powerstat; /*!< power status */
|
||||
char *tuner_control_pathname; /*!< Path to external tuner control program that get 0/1 (Off/On) argument */
|
||||
char client_version[32]; /*!<! Allow client to report version for compatibility checks/capability */
|
||||
freq_t offset_vfoa; /*!< Offset to apply to VFOA/Main set_freq */
|
||||
freq_t offset_vfob; /*!< Offset to apply to VFOB/Sub set_freq */
|
||||
struct multicast_s *multicast; /*!< Pointer to multicast server data */
|
||||
// Adding a number of items so netrigctl can see the real rig information
|
||||
// Eventually may want to add these so that rigctld can see more of the backend
|
||||
// But that will come later if requested -- for now they just fill out dumpstate.c
|
||||
rig_model_t rig_model; /*!< Rig model. */
|
||||
const char *model_name; /*!< Model name. */
|
||||
const char *mfg_name; /*!< Manufacturer. */
|
||||
const char *version; /*!< Driver version. */
|
||||
const char *copyright; /*!< Copyright info. */
|
||||
enum rig_status_e status; /*!< Driver status. */
|
||||
int rig_type; /*!< Rig type. */
|
||||
ptt_type_t ptt_type; /*!< Type of the PTT port. */
|
||||
dcd_type_t dcd_type; /*!< Type of the DCD port. */
|
||||
rig_port_t port_type; /*!< Type of communication port. */
|
||||
int serial_rate_min; /*!< Minimum serial speed. */
|
||||
int serial_rate_max; /*!< Maximum serial speed. */
|
||||
int serial_data_bits; /*!< Number of data bits. */
|
||||
int serial_stop_bits; /*!< Number of stop bits. */
|
||||
enum serial_parity_e serial_parity; /*!< Parity. */
|
||||
enum serial_handshake_e serial_handshake; /*!< Handshake. */
|
||||
int write_delay; /*!< Delay between each byte sent out, in mS */
|
||||
int post_write_delay; /*!< Delay between each commands send out, in mS */
|
||||
int timeout; /*!< Timeout, in mS */
|
||||
int retry; /*!< Maximum number of retries if command fails, 0 to disable */
|
||||
int targetable_vfo; /*!< Bit field list of direct VFO access commands */
|
||||
int async_data_supported; /*!< Indicates that rig is capable of outputting asynchronous data updates, such as transceive state updates or spectrum data. 1 if true, 0 otherwise. */
|
||||
int agc_level_count; /*!< Number of supported AGC levels. Zero indicates all modes should be available (for backwards-compatibility). */
|
||||
enum agc_level_e agc_levels[HAMLIB_MAX_AGC_LEVELS]; /*!< Supported AGC levels */
|
||||
tone_t *ctcss_list; /*!< CTCSS tones list, zero ended */
|
||||
tone_t *dcs_list; /*!< DCS code list, zero ended */
|
||||
vfo_op_t vfo_ops; /*!< VFO op bit field list */
|
||||
scan_t scan_ops; /*!< Scan bit field list */
|
||||
int transceive; /*!< \deprecated Use async_data_supported instead */
|
||||
int bank_qty; /*!< Number of banks */
|
||||
int chan_desc_sz; /*!< Max length of memory channel name */
|
||||
freq_range_t rx_range_list1[HAMLIB_FRQRANGESIZ]; /*!< Receive frequency range list #1 */
|
||||
freq_range_t tx_range_list1[HAMLIB_FRQRANGESIZ]; /*!< Transmit frequency range list #1 */
|
||||
freq_range_t rx_range_list2[HAMLIB_FRQRANGESIZ]; /*!< Receive frequency range list #2 */
|
||||
freq_range_t tx_range_list2[HAMLIB_FRQRANGESIZ]; /*!< Transmit frequency range list #2 */
|
||||
freq_range_t rx_range_list3[HAMLIB_FRQRANGESIZ]; /*!< Receive frequency range list #3 */
|
||||
freq_range_t tx_range_list3[HAMLIB_FRQRANGESIZ]; /*!< Transmit frequency range list #3 */
|
||||
freq_range_t rx_range_list4[HAMLIB_FRQRANGESIZ]; /*!< Receive frequency range list #4 */
|
||||
freq_range_t tx_range_list4[HAMLIB_FRQRANGESIZ]; /*!< Transmit frequency range list #4 */
|
||||
freq_range_t rx_range_list5[HAMLIB_FRQRANGESIZ]; /*!< Receive frequency range list #5 */
|
||||
freq_range_t tx_range_list5[HAMLIB_FRQRANGESIZ]; /*!< Transmit frequency range list #5 */
|
||||
struct rig_spectrum_scope spectrum_scopes[HAMLIB_MAX_SPECTRUM_SCOPES]; /*!< Supported spectrum scopes. The array index must match the scope ID. Last entry must have NULL name. */
|
||||
enum rig_spectrum_mode_e spectrum_modes[HAMLIB_MAX_SPECTRUM_MODES]; /*!< Supported spectrum scope modes. Last entry must be RIG_SPECTRUM_MODE_NONE. */
|
||||
freq_t spectrum_spans[HAMLIB_MAX_SPECTRUM_SPANS]; /*!< Supported spectrum scope frequency spans in Hz in center mode. Last entry must be 0. */
|
||||
struct rig_spectrum_avg_mode spectrum_avg_modes[HAMLIB_MAX_SPECTRUM_AVG_MODES]; /*!< Supported spectrum scope averaging modes. Last entry must have NULL name. */
|
||||
int spectrum_attenuator[HAMLIB_MAXDBLSTSIZ]; /*!< Spectrum attenuator list in dB, 0 terminated */
|
||||
volatile int morse_data_handler_thread_run;
|
||||
void *morse_data_handler_priv_data;
|
||||
FIFO_RIG *fifo_morse;
|
||||
int doppler; /*!< True if doppler changing detected */
|
||||
char *multicast_data_addr; /*!< Multicast data UDP address for publishing rig data and state */
|
||||
int multicast_data_port; /*!< Multicast data UDP port for publishing rig data and state */
|
||||
char *multicast_cmd_addr; /*!< Multicast command server UDP address for sending commands to rig */
|
||||
int multicast_cmd_port; /*!< Multicast command server UDP port for sending commands to rig */
|
||||
volatile int multicast_receiver_run;
|
||||
void *multicast_receiver_priv_data;
|
||||
rig_comm_status_t comm_status; /*!< Detailed rig control status */
|
||||
char device_id[HAMLIB_RIGNAMSIZ];
|
||||
int dual_watch; /*!< Boolean DUAL_WATCH status */
|
||||
int post_ptt_delay; /*!< delay after PTT to allow for relays and such */
|
||||
struct timespec freq_event_elapsed;
|
||||
int freq_skip; /*!< allow frequency skip for gpredict RX/TX freq set */
|
||||
client_t client;
|
||||
pthread_mutex_t api_mutex; // Lock for any API entry
|
||||
// New rig_state items go before this line ============================================
|
||||
};
|
||||
|
||||
//---Start cut here---
|
||||
/**
|
||||
* \brief Deprecated Rig state containing live data and customized fields.
|
||||
* Due to DLL problems this remains in-place in the rig_caps structure but is no longer referred to
|
||||
* A new rig_state has been added at the end of the structure instead of the middle
|
||||
*
|
||||
* This struct contains no data and is just a place holder for DLL alignment
|
||||
*
|
||||
* It is NOT fine to touch this struct AT ALL!!!
|
||||
*/
|
||||
struct rig_state_deprecated {
|
||||
/********* ENSURE YOU DO NOT EVER MODIFY THIS STRUCTURE *********/
|
||||
/********* It will remain forever to provide DLL backwards compatibility ******/
|
||||
/*
|
||||
* overridable fields
|
||||
*/
|
||||
// moving the hamlib_port_t to the end of rig_state and making it a pointer
|
||||
// this should allow changes to hamlib_port_t without breaking shared libraries
|
||||
// these will maintain a copy of the new port_t for backwards compatibility
|
||||
// to these offsets -- note these must stay until a major version update is done like 5.0
|
||||
hamlib_port_t_deprecated rigport_deprecated; /*!< Rig port (internal use). */
|
||||
hamlib_port_t_deprecated pttport_deprecated; /*!< PTT port (internal use). */
|
||||
hamlib_port_t_deprecated dcdport_deprecated; /*!< DCD port (internal use). */
|
||||
|
||||
double vfo_comp; /*!< VFO compensation in PPM, 0.0 to disable */
|
||||
|
||||
int deprecated_itu_region; /*!< ITU region to select among freq_range_t */
|
||||
freq_range_t rx_range_list[HAMLIB_FRQRANGESIZ]; /*!< Receive frequency range list */
|
||||
freq_range_t tx_range_list[HAMLIB_FRQRANGESIZ]; /*!< Transmit frequency range list */
|
||||
|
||||
struct tuning_step_list tuning_steps[HAMLIB_TSLSTSIZ]; /*!< Tuning step list */
|
||||
|
||||
struct filter_list filters[HAMLIB_FLTLSTSIZ]; /*!< Mode/filter table, at -6dB */
|
||||
|
||||
cal_table_t str_cal; /*!< S-meter calibration table */
|
||||
|
||||
chan_t chan_list[HAMLIB_CHANLSTSIZ]; /*!< Channel list, zero ended */
|
||||
|
||||
shortfreq_t max_rit; /*!< max absolute RIT */
|
||||
shortfreq_t max_xit; /*!< max absolute XIT */
|
||||
shortfreq_t max_ifshift; /*!< max absolute IF-SHIFT */
|
||||
|
||||
ann_t announces; /*!< Announces bit field list */
|
||||
|
||||
int preamp[HAMLIB_MAXDBLSTSIZ]; /*!< Preamp list in dB, 0 terminated */
|
||||
int attenuator[HAMLIB_MAXDBLSTSIZ]; /*!< Attenuator list in dB, 0 terminated */
|
||||
|
||||
setting_t has_get_func; /*!< List of get functions */
|
||||
setting_t has_set_func; /*!< List of set functions */
|
||||
setting_t has_get_level; /*!< List of get level */
|
||||
setting_t has_set_level; /*!< List of set level */
|
||||
setting_t has_get_parm; /*!< List of get parm */
|
||||
setting_t has_set_parm; /*!< List of set parm */
|
||||
|
||||
gran_t level_gran[RIG_SETTING_MAX]; /*!< level granularity */
|
||||
gran_t parm_gran[RIG_SETTING_MAX]; /*!< parm granularity */
|
||||
|
||||
|
||||
/*
|
||||
* non overridable fields, internal use
|
||||
*/
|
||||
|
||||
int transaction_active; /*!< set to 1 to inform the async reader thread that a synchronous command transaction is waiting for a response, otherwise 0 */
|
||||
vfo_t current_vfo; /*!< VFO currently set */
|
||||
int vfo_list; /*!< Complete list of VFO for this rig */
|
||||
int comm_state; /*!< Comm port state, opened/closed. */
|
||||
rig_ptr_t priv; /*!< Pointer to private rig state data. */
|
||||
rig_ptr_t obj; /*!< Internal use by hamlib++ for event handling. */
|
||||
|
||||
int async_data_enabled; /*!< Whether async data mode is enabled */
|
||||
int poll_interval; /*!< Rig state polling period in milliseconds */
|
||||
freq_t current_freq; /*!< Frequency currently set */
|
||||
rmode_t current_mode; /*!< Mode currently set */
|
||||
//rmode_t current_modeB; /*!< Mode currently set VFOB */
|
||||
pbwidth_t current_width; /*!< Passband width currently set */
|
||||
vfo_t tx_vfo; /*!< Tx VFO currently set */
|
||||
rmode_t mode_list; /*!< Complete list of modes for this rig */
|
||||
// mode_list is used by some
|
||||
// so anything added to this structure must be below here
|
||||
int transmit; /*!< rig should be transmitting i.e. hard
|
||||
wired PTT asserted - used by rigs that
|
||||
don't do CAT while in Tx */
|
||||
freq_t lo_freq; /*!< Local oscillator frequency of any transverter */
|
||||
time_t twiddle_time; /*!< time when vfo twiddling was detected */
|
||||
int twiddle_timeout; /*!< timeout to resume from twiddling */
|
||||
// uplink allows gpredict to behave better by no reading the uplink VFO
|
||||
int uplink; /*!< uplink=1 will not read Sub, uplink=2 will not read Main */
|
||||
struct rig_cache_deprecated cache; // Here for backward compatibility
|
||||
int vfo_opt; /*!< Is -o switch turned on? */
|
||||
int auto_power_on; /*!< Allow Hamlib to power on rig
|
||||
automatically if supported */
|
||||
int auto_power_off; /*!< Allow Hamlib to power off rig
|
||||
automatically if supported */
|
||||
int auto_disable_screensaver; /*!< Allow Hamlib to disable the
|
||||
rig's screen saver automatically if
|
||||
supported */
|
||||
int ptt_share; /*!< Share ptt port by open/close during get_ptt, set_ptt hogs the port while active */
|
||||
int power_now; /*!< Current RF power level in rig units */
|
||||
int power_min; /*!< Minimum RF power level in rig units */
|
||||
int power_max; /*!< Maximum RF power level in rig units */
|
||||
unsigned char disable_yaesu_bandselect; /*!< Disables Yaesu band select logic */
|
||||
int twiddle_rit; /*!< Suppresses VFOB reading (cached value used) so RIT control can be used */
|
||||
int twiddle_state; /*!< keeps track of twiddle status */
|
||||
vfo_t rx_vfo; /*!< Rx VFO currently set */
|
||||
|
||||
volatile unsigned int snapshot_packet_sequence_number;
|
||||
|
||||
volatile int multicast_publisher_run;
|
||||
void *multicast_publisher_priv_data;
|
||||
volatile int async_data_handler_thread_run;
|
||||
void *async_data_handler_priv_data;
|
||||
volatile int poll_routine_thread_run;
|
||||
void *poll_routine_priv_data;
|
||||
pthread_mutex_t mutex_set_transaction;
|
||||
hamlib_port_t rigport; /*!< Rig port (internal use). */
|
||||
hamlib_port_t pttport; /*!< PTT port (internal use). */
|
||||
hamlib_port_t dcdport; /*!< DCD port (internal use). */
|
||||
/********* DO NOT ADD or CHANGE anything (or than to rename) ABOVE THIS LINE *********/
|
||||
/********* ENSURE ANY NEW ITEMS ARE ADDED AFTER HERE *********/
|
||||
/* flags instructing the rig_get routines to use cached values when asyncio is in use */
|
||||
int use_cached_freq; /*!< flag instructing rig_get_freq to use cached values when asyncio is in use */
|
||||
int use_cached_mode; /*!< flag instructing rig_get_mode to use cached values when asyncio is in use */
|
||||
int use_cached_ptt; /*!< flag instructing rig_get_ptt to use cached values when asyncio is in use */
|
||||
int depth; /*!< a depth counter to use for debug indentation and such */
|
||||
int lock_mode; /*!< flag that prevents mode changes if ~= 0 -- see set/get_lock_mode */
|
||||
powerstat_t powerstat; /*!< power status */
|
||||
char *tuner_control_pathname; /*!< Path to external tuner control program that get 0/1 (Off/On) argument */
|
||||
char client_version[32]; /*!<! Allow client to report version for compatibility checks/capability */
|
||||
freq_t offset_vfoa; /*!< Offset to apply to VFOA/Main set_freq */
|
||||
freq_t offset_vfob; /*!< Offset to apply to VFOB/Sub set_freq */
|
||||
struct multicast_s *multicast; /*!< Pointer to multicast server data */
|
||||
};
|
||||
//---End cut here---
|
||||
|
||||
#if defined(IN_HAMLIB)
|
||||
#define STATE(r) (&(r)->state)
|
||||
#endif
|
||||
#define HAMLIB_STATE(r) ((struct rig_state *)rig_data_pointer(r, RIG_PTRX_STATE))
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _RIG_STATE_H */
|
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* Hamlib Interface - Rotator state structure
|
||||
* Copyright (c) 2000-2025 The Hamlib Group
|
||||
* Copyright (c) 2025 George Baltz
|
||||
*
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#ifndef _ROT_STATE_H
|
||||
#define _ROT_STATE_H 1
|
||||
|
||||
__BEGIN_DECLS
|
||||
/**
|
||||
* \struct rot_state
|
||||
* \brief Rotator state structure
|
||||
*
|
||||
* This structure contains live data, as well as a copy of capability fields
|
||||
* that may be updated, i.e. customized while the #ROT handle is instantiated.
|
||||
*
|
||||
* It is fine to move fields around, as this kind of structure should not be
|
||||
* initialized like rot_caps are.
|
||||
*/
|
||||
struct rot_state {
|
||||
/*
|
||||
* overridable fields
|
||||
*/
|
||||
azimuth_t min_az; /*!< Lower limit for azimuth (overridable). */
|
||||
azimuth_t max_az; /*!< Upper limit for azimuth (overridable). */
|
||||
elevation_t min_el; /*!< Lower limit for elevation (overridable). */
|
||||
elevation_t max_el; /*!< Upper limit for elevation (overridable). */
|
||||
int south_zero; /*!< South is zero degrees. */
|
||||
azimuth_t az_offset; /*!< Offset to be applied to azimuth. */
|
||||
elevation_t el_offset; /*!< Offset to be applied to elevation. */
|
||||
|
||||
setting_t has_get_func; /*!< List of get functions. */
|
||||
setting_t has_set_func; /*!< List of set functions. */
|
||||
setting_t has_get_level; /*!< List of get levels. */
|
||||
setting_t has_set_level; /*!< List of set levels. */
|
||||
setting_t has_get_parm; /*!< List of get parameters. */
|
||||
setting_t has_set_parm; /*!< List of set parameters. */
|
||||
|
||||
rot_status_t has_status; /*!< Supported status flags. */
|
||||
|
||||
gran_t level_gran[RIG_SETTING_MAX]; /*!< Level granularity. */
|
||||
gran_t parm_gran[RIG_SETTING_MAX]; /*!< Parameter granularity. */
|
||||
|
||||
/*
|
||||
* non overridable fields, internal use
|
||||
*/
|
||||
hamlib_port_t_deprecated rotport_deprecated; /*!< Rotator port (internal use). Deprecated */
|
||||
hamlib_port_t_deprecated rotport2_deprecated; /*!< 2nd Rotator port (internal use). Deprecated */
|
||||
|
||||
int comm_state; /*!< Comm port state, i.e. opened or closed. */
|
||||
rig_ptr_t priv; /*!< Pointer to private rotator state data. */
|
||||
rig_ptr_t obj; /*!< Internal use by hamlib++ for event handling. */
|
||||
|
||||
int current_speed; /*!< Current speed 1-100, to be used when no change to speed is requested. */
|
||||
hamlib_port_t rotport; /*!< Rotator port (internal use). */
|
||||
hamlib_port_t rotport2; /*!< 2nd Rotator port (internal use). */
|
||||
rig_ptr_t *pstrotator_handler_priv_data;
|
||||
deferred_config_header_t config_queue;
|
||||
};
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#if defined(IN_HAMLIB)
|
||||
#define ROTSTATE(r) (&(r)->state)
|
||||
#endif
|
||||
#define HAMLIB_ROTSTATE(r) ((struct rot_state *)rot_data_pointer(r, RIG_PTRX_ROTSTATE))
|
||||
|
||||
#endif /* _ROT_STATE_H */
|
|
@ -580,59 +580,19 @@ struct rot_caps {
|
|||
#define ROT_MODEL(arg) .rot_model=arg,.macro_name=#arg
|
||||
//! @endcond
|
||||
|
||||
//---Start cut here---
|
||||
// Rotatot state definition moved to include/hamlib/rot_state.h
|
||||
// Temporary include until 5.0
|
||||
#ifndef NO_OLD_INCLUDES
|
||||
|
||||
/**
|
||||
* \struct rot_state
|
||||
* \brief Rotator state structure
|
||||
*
|
||||
* This structure contains live data, as well as a copy of capability fields
|
||||
* that may be updated, i.e. customized while the #ROT handle is instantiated.
|
||||
*
|
||||
* It is fine to move fields around, as this kind of structure should not be
|
||||
* initialized like rot_caps are.
|
||||
*/
|
||||
struct rot_state {
|
||||
/*
|
||||
* overridable fields
|
||||
*/
|
||||
azimuth_t min_az; /*!< Lower limit for azimuth (overridable). */
|
||||
azimuth_t max_az; /*!< Upper limit for azimuth (overridable). */
|
||||
elevation_t min_el; /*!< Lower limit for elevation (overridable). */
|
||||
elevation_t max_el; /*!< Upper limit for elevation (overridable). */
|
||||
int south_zero; /*!< South is zero degrees. */
|
||||
azimuth_t az_offset; /*!< Offset to be applied to azimuth. */
|
||||
elevation_t el_offset; /*!< Offset to be applied to elevation. */
|
||||
__END_DECLS
|
||||
|
||||
setting_t has_get_func; /*!< List of get functions. */
|
||||
setting_t has_set_func; /*!< List of set functions. */
|
||||
setting_t has_get_level; /*!< List of get levels. */
|
||||
setting_t has_set_level; /*!< List of set levels. */
|
||||
setting_t has_get_parm; /*!< List of get parameters. */
|
||||
setting_t has_set_parm; /*!< List of set parameters. */
|
||||
|
||||
rot_status_t has_status; /*!< Supported status flags. */
|
||||
|
||||
gran_t level_gran[RIG_SETTING_MAX]; /*!< Level granularity. */
|
||||
gran_t parm_gran[RIG_SETTING_MAX]; /*!< Parameter granularity. */
|
||||
|
||||
/*
|
||||
* non overridable fields, internal use
|
||||
*/
|
||||
hamlib_port_t_deprecated rotport_deprecated; /*!< Rotator port (internal use). Deprecated */
|
||||
hamlib_port_t_deprecated rotport2_deprecated; /*!< 2nd Rotator port (internal use). Deprecated */
|
||||
|
||||
int comm_state; /*!< Comm port state, i.e. opened or closed. */
|
||||
rig_ptr_t priv; /*!< Pointer to private rotator state data. */
|
||||
rig_ptr_t obj; /*!< Internal use by hamlib++ for event handling. */
|
||||
|
||||
int current_speed; /*!< Current speed 1-100, to be used when no change to speed is requested. */
|
||||
hamlib_port_t rotport; /*!< Rotator port (internal use). */
|
||||
hamlib_port_t rotport2; /*!< 2nd Rotator port (internal use). */
|
||||
rig_ptr_t *pstrotator_handler_priv_data;
|
||||
deferred_config_header_t config_queue;
|
||||
};
|
||||
#include <hamlib/rot_state.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#endif
|
||||
//---End cut here---
|
||||
/**
|
||||
* \struct s_rot
|
||||
* \brief Master rotator structure.
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#endif
|
||||
|
||||
#include <hamlib/rotator.h>
|
||||
#include "hamlib/rot_state.h"
|
||||
#include "parallel.h"
|
||||
#include "register.h"
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include <math.h>
|
||||
|
||||
#include "hamlib/rotator.h"
|
||||
#include "hamlib/rot_state.h"
|
||||
#include "register.h"
|
||||
|
||||
#include "androidsensor.h"
|
||||
|
@ -111,7 +112,7 @@ androidsensor_rot_cleanup(ROT *rot)
|
|||
|
||||
delete priv->imu;
|
||||
free(ROTSTATE(rot)->priv);
|
||||
ROTSTATE(rot) = NULL;
|
||||
ROTSTATE(rot)->priv = NULL;
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#endif
|
||||
|
||||
#include "hamlib/rotator.h"
|
||||
#include "hamlib/rot_state.h"
|
||||
#include "parallel.h"
|
||||
#include "misc.h"
|
||||
#include "register.h"
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include <string.h>
|
||||
|
||||
#include "hamlib/rotator.h"
|
||||
#include "hamlib/port.h"
|
||||
#include "serial.h"
|
||||
#include "register.h"
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <string.h> /* String function definitions */
|
||||
|
||||
#include "hamlib/rotator.h"
|
||||
#include "hamlib/rot_state.h"
|
||||
#include "serial.h"
|
||||
#include "register.h"
|
||||
#include "idx_builtin.h"
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <string.h> /* String function definitions */
|
||||
|
||||
#include <hamlib/rotator.h>
|
||||
#include "hamlib/rot_state.h"
|
||||
#include "serial.h"
|
||||
#include "register.h"
|
||||
#include "idx_builtin.h"
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
#include <sys/time.h>
|
||||
|
||||
#include "hamlib/rotator.h"
|
||||
#include "hamlib/port.h"
|
||||
#include "hamlib/rot_state.h"
|
||||
#include "register.h"
|
||||
#include "idx_builtin.h"
|
||||
#include "serial.h"
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#endif
|
||||
|
||||
#include "hamlib/rotator.h"
|
||||
#include "hamlib/rot_state.h"
|
||||
#include "parallel.h"
|
||||
#include "misc.h"
|
||||
#include "register.h"
|
||||
|
|
|
@ -34,6 +34,8 @@
|
|||
#endif
|
||||
|
||||
#include "hamlib/rotator.h"
|
||||
#include "hamlib/port.h"
|
||||
#include "hamlib/rot_state.h"
|
||||
#include "hamlib/rig.h"
|
||||
#include "misc.h"
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <math.h>
|
||||
|
||||
#include "hamlib/rotator.h"
|
||||
#include "hamlib/port.h"
|
||||
#include "serial.h"
|
||||
|
||||
#define EOM "\r"
|
||||
|
|
|
@ -23,13 +23,13 @@
|
|||
// cppcheck-suppress *
|
||||
#include <stdio.h>
|
||||
// cppcheck-suppress *
|
||||
// cppcheck-suppress *
|
||||
#include <string.h> /* String function definitions */
|
||||
// cppcheck-suppress *
|
||||
// cppcheck-suppress *
|
||||
#include <math.h>
|
||||
|
||||
#include "hamlib/rotator.h"
|
||||
#include "hamlib/port.h"
|
||||
#include "hamlib/rot_state.h"
|
||||
#include "serial.h"
|
||||
#include "misc.h"
|
||||
#include "register.h"
|
||||
|
|
|
@ -29,6 +29,8 @@
|
|||
#include <math.h>
|
||||
|
||||
#include "hamlib/rotator.h"
|
||||
#include "hamlib/port.h"
|
||||
#include "hamlib/rot_state.h"
|
||||
#include "serial.h"
|
||||
#include "misc.h"
|
||||
#include "idx_builtin.h"
|
||||
|
|
|
@ -32,6 +32,8 @@
|
|||
#include <string.h> /* String function definitions */
|
||||
|
||||
#include "hamlib/rotator.h"
|
||||
#include "hamlib/port.h"
|
||||
#include "hamlib/rot_state.h"
|
||||
#include "serial.h"
|
||||
#include "register.h"
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include <string.h>
|
||||
|
||||
#include "hamlib/rotator.h"
|
||||
#include "hamlib/port.h"
|
||||
#include "serial.h"
|
||||
#include "misc.h"
|
||||
#include "register.h"
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
#include <sys/time.h>
|
||||
|
||||
#include <hamlib/rotator.h>
|
||||
#include "hamlib/port.h"
|
||||
#include "hamlib/rot_state.h"
|
||||
#include <num_stdio.h>
|
||||
|
||||
#include "serial.h"
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <string.h>
|
||||
|
||||
#include "hamlib/rotator.h"
|
||||
#include "hamlib/port.h"
|
||||
#include "serial.h"
|
||||
#include "register.h"
|
||||
#include "num_stdio.h"
|
||||
|
|
|
@ -37,6 +37,8 @@
|
|||
#include <ctype.h> /* for isdigit function */
|
||||
|
||||
#include "hamlib/rotator.h"
|
||||
#include "hamlib/port.h"
|
||||
#include "hamlib/rot_state.h"
|
||||
#include "serial.h"
|
||||
#include "register.h"
|
||||
#include "iofunc.h"
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <string.h> /* String function definitions */
|
||||
|
||||
#include "hamlib/rotator.h"
|
||||
#include "hamlib/port.h"
|
||||
#include "serial.h"
|
||||
#include "register.h"
|
||||
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include "skywatcher.h"
|
||||
#include "hamlib/port.h"
|
||||
#include "hamlib/rot_state.h"
|
||||
#include "register.h"
|
||||
#include "serial.h"
|
||||
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
#include <string.h>
|
||||
|
||||
#include "hamlib/rotator.h"
|
||||
#include "hamlib/port.h"
|
||||
#include "hamlib/rot_state.h"
|
||||
#include "serial.h"
|
||||
#include "register.h"
|
||||
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
#include <sys/time.h>
|
||||
|
||||
#include <hamlib/rotator.h>
|
||||
#include "hamlib/port.h"
|
||||
#include "hamlib/rot_state.h"
|
||||
#include "serial.h"
|
||||
#include "misc.h"
|
||||
#include "register.h"
|
||||
|
|
|
@ -1,3 +1,28 @@
|
|||
/*
|
||||
* simts890.c - Copyright 2019-2024 The Hamlib Group
|
||||
* Copyright 2024-2025 George Baltz
|
||||
*
|
||||
* This program simulates the CAT actions of the Kenwood TS-890S
|
||||
* transceiver. It takes commands over a pseudo-tty port, and responds
|
||||
* as closely as possible in the same way as the real hardware.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
//#define TRACE /* Full traffic trace if enabled */
|
||||
// can run this using rigctl/rigctld and socat pty devices
|
||||
#define _XOPEN_SOURCE 700
|
||||
|
|
|
@ -38,6 +38,8 @@
|
|||
#include <string.h> /* String function definitions */
|
||||
|
||||
#include <hamlib/amplifier.h>
|
||||
#include "hamlib/port.h"
|
||||
#include "hamlib/amp_state.h"
|
||||
|
||||
#include "amp_conf.h"
|
||||
#include "token.h"
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include <hamlib/config.h>
|
||||
|
||||
#include <hamlib/rig.h>
|
||||
#include "hamlib/amp_state.h"
|
||||
#include <hamlib/amplifier.h>
|
||||
|
||||
|
||||
|
|
|
@ -58,6 +58,8 @@
|
|||
#include <fcntl.h>
|
||||
|
||||
#include <hamlib/amplifier.h>
|
||||
#include "hamlib/port.h"
|
||||
#include "hamlib/amp_state.h"
|
||||
#include "serial.h"
|
||||
#include "parallel.h"
|
||||
#include "usb_port.h"
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include "cache.h"
|
||||
#include "hamlib/rig_state.h"
|
||||
#include "misc.h"
|
||||
|
||||
#define CHECK_RIG_ARG(r) (!(r) || !(r)->caps || !STATE(r)->comm_state)
|
||||
|
|
|
@ -38,6 +38,8 @@
|
|||
#include <string.h> /* String function definitions */
|
||||
|
||||
#include <hamlib/rig.h>
|
||||
#include "hamlib/port.h"
|
||||
#include "hamlib/rig_state.h"
|
||||
#include "token.h"
|
||||
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
#endif
|
||||
|
||||
#include <hamlib/rig.h>
|
||||
#include "hamlib/rig_state.h"
|
||||
#include "event.h"
|
||||
#include "misc.h"
|
||||
#include "cache.h"
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include <fcntl.h>
|
||||
|
||||
#include "gpio.h"
|
||||
#include "hamlib/port.h"
|
||||
|
||||
|
||||
int gpio_open(hamlib_port_t *port, int output, int on_value)
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <hamlib/rig.h>
|
||||
#include "hamlib/port.h"
|
||||
#include "iofunc.h"
|
||||
#include "misc.h"
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
#include <sys/stat.h>
|
||||
|
||||
#include <hamlib/rig.h>
|
||||
#include "hamlib/rig_state.h"
|
||||
|
||||
#ifndef DOC_HIDDEN
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
#include <math.h>
|
||||
|
||||
#include <hamlib/rig.h>
|
||||
#include "hamlib/rig_state.h"
|
||||
#include <hamlib/rotator.h>
|
||||
#include <hamlib/amplifier.h>
|
||||
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#include "hamlib/rig.h"
|
||||
#include "hamlib/port.h"
|
||||
#include "hamlib/rig_state.h"
|
||||
#include "misc.h"
|
||||
#include "cache.h"
|
||||
#include "multicast.h"
|
||||
|
|
|
@ -74,6 +74,8 @@
|
|||
#endif
|
||||
|
||||
#include <hamlib/rig.h>
|
||||
#include "hamlib/port.h"
|
||||
#include "hamlib/rig_state.h"
|
||||
#include "network.h"
|
||||
#include "misc.h"
|
||||
#include "asyncpipe.h"
|
||||
|
|
|
@ -58,6 +58,7 @@
|
|||
# include <winbase.h>
|
||||
#endif
|
||||
|
||||
#include "hamlib/port.h"
|
||||
#include "parallel.h"
|
||||
|
||||
#ifdef HAVE_LINUX_PPDEV_H
|
||||
|
|
|
@ -50,8 +50,10 @@
|
|||
* \example ../tests/testrig.c
|
||||
*/
|
||||
|
||||
#include "hamlib/rig.h"
|
||||
#include "hamlib/config.h"
|
||||
#include "hamlib/rig.h"
|
||||
#include "hamlib/port.h"
|
||||
#include "hamlib/rig_state.h"
|
||||
#include "fifo.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -39,6 +39,8 @@
|
|||
#include <string.h> /* String function definitions */
|
||||
|
||||
#include <hamlib/rotator.h>
|
||||
#include "hamlib/port.h"
|
||||
#include "hamlib/rot_state.h"
|
||||
|
||||
#include "rot_conf.h"
|
||||
#include "token.h"
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
|
||||
#include <hamlib/rig.h>
|
||||
#include <hamlib/rotator.h>
|
||||
#include "hamlib/rot_state.h"
|
||||
|
||||
|
||||
#ifndef DOC_HIDDEN
|
||||
|
|
|
@ -58,6 +58,8 @@
|
|||
#include <fcntl.h>
|
||||
|
||||
#include <hamlib/rotator.h>
|
||||
#include "hamlib/port.h"
|
||||
#include "hamlib/rot_state.h"
|
||||
#include "serial.h"
|
||||
#include "parallel.h"
|
||||
#if defined(HAVE_LIB_USB_H) || defined(HAMB_LIBUSB_1_0_LIBUSB_H)
|
||||
|
|
|
@ -64,6 +64,7 @@
|
|||
#endif
|
||||
|
||||
#include <hamlib/rig.h>
|
||||
#include "hamlib/port.h"
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
#if defined(WIN32) && !defined(HAVE_TERMIOS_H)
|
||||
|
@ -211,7 +212,7 @@ int check_com_port_in_use(const char *port)
|
|||
#endif
|
||||
|
||||
/**
|
||||
* \brief Open serial port using STATE(rig) data
|
||||
* \brief Open serial port using port data only
|
||||
* \param rp port data structure (must spec port id eg /dev/ttyS1)
|
||||
* \return RIG_OK or < 0 if error
|
||||
*/
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include <unistd.h>
|
||||
|
||||
#include <hamlib/rig.h>
|
||||
#include "hamlib/rig_state.h"
|
||||
#include "cal.h"
|
||||
#include "misc.h"
|
||||
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
#include <unistd.h>
|
||||
#include <hamlib/config.h>
|
||||
#include <hamlib/rig.h>
|
||||
#include "hamlib/port.h"
|
||||
#include "hamlib/rig_state.h"
|
||||
#include "misc.h"
|
||||
#include "cache.h"
|
||||
#include "snapshot_data.h"
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
#include <hamlib/rig.h>
|
||||
#include "hamlib/rig_state.h"
|
||||
#include "tones.h"
|
||||
|
||||
#if !defined(_WIN32) && !defined(__CYGWIN__)
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include <sys/types.h>
|
||||
|
||||
#include <hamlib/rig.h>
|
||||
#include "hamlib/port.h"
|
||||
|
||||
#ifdef HAVE_LIBUSB_H
|
||||
# include <libusb.h>
|
||||
|
|
|
@ -11,11 +11,13 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <hamlib/rig.h>
|
||||
#include <hamlib/port.h>
|
||||
#include <hamlib/rig_state.h>
|
||||
#include <hamlib/riglist.h>
|
||||
#include "sprintflst.h"
|
||||
#include <hamlib/rotator.h>
|
||||
|
||||
#if 0
|
||||
#if 1
|
||||
#define MODEL RIG_MODEL_DUMMY
|
||||
#define PATH "/dev/ttyUSB0"
|
||||
#define BAUD 19200
|
||||
|
@ -31,14 +33,14 @@ int main()
|
|||
char *info_buf;
|
||||
freq_t freq;
|
||||
value_t rawstrength, power, strength;
|
||||
float s_meter, rig_raw2val();
|
||||
float s_meter, rig_raw2val(int i, cal_table_t *t);
|
||||
int status, retcode;
|
||||
unsigned int mwpower;
|
||||
rmode_t mode;
|
||||
pbwidth_t width;
|
||||
|
||||
/* Set verbosity level */
|
||||
rig_set_debug(RIG_DEBUG_TRACE); // errors only
|
||||
rig_set_debug(RIG_DEBUG_TRACE); // Lots of output
|
||||
|
||||
/* Instantiate a rig */
|
||||
my_rig = rig_init(MODEL); // your rig model.
|
||||
|
@ -123,7 +125,8 @@ int main()
|
|||
|
||||
printf("LEVEL_STRENGTH returns %d\n", strength.i);
|
||||
|
||||
const freq_range_t *range = rig_get_range(&my_rig->state.rx_range_list[0],
|
||||
const struct rig_state *my_rs = HAMLIB_STATE(my_rig);
|
||||
const freq_range_t *range = rig_get_range(&my_rs->rx_range_list[0],
|
||||
14074000, RIG_MODE_USB);
|
||||
|
||||
if (status != RIG_OK) { rig_debug(RIG_DEBUG_ERR, "%s: error rig_get_ragne: %s\n", __func__, rigerror(status)); }
|
||||
|
@ -131,7 +134,7 @@ int main()
|
|||
if (range)
|
||||
{
|
||||
char vfolist[256];
|
||||
rig_sprintf_vfo(vfolist, sizeof(vfolist), my_rig->state.vfo_list);
|
||||
rig_sprintf_vfo(vfolist, sizeof(vfolist), my_rs->vfo_list);
|
||||
printf("Range start=%"PRIfreq", end=%"PRIfreq", low_power=%d, high_power=%d, vfos=%s\n",
|
||||
range->startf, range->endf, range->low_power, range->high_power, vfolist);
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue