Loading...
Searching...
No Matches
port.h
Go to the documentation of this file.
/*
* 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
typedef struct hamlib_port {
union {
rig_port_t rig;
ptt_type_t ptt;
dcd_type_t dcd;
} type;
int fd;
void *handle;
int write_delay;
int post_write_delay;
struct {
int tv_sec, tv_usec;
} post_write_date;
int timeout;
short retry;
short flushx;
char pathname[HAMLIB_FILPATHLEN];
union {
struct {
int rate;
int data_bits;
int stop_bits;
enum serial_parity_e parity;
enum serial_handshake_e handshake;
enum serial_control_state_e rts_state;
enum serial_control_state_e dtr_state;
} serial;
struct {
int pin;
} parallel;
struct {
int ptt_bitnum;
} cm108;
struct {
int vid;
int pid;
int conf;
int iface;
int alt;
char *vendor_name;
char *product;
} usb;
struct {
int on_value;
int value;
} gpio;
} parm;
int client_port;
RIG *rig;
int asyncio;
#if defined(_WIN32)
hamlib_async_pipe_t *sync_data_pipe;
hamlib_async_pipe_t *sync_data_error_pipe;
#else
int fd_sync_write;
int fd_sync_read;
int fd_sync_error_write;
int fd_sync_error_read;
#endif
short timeout_retry;
// DO NOT ADD ANYTHING HERE UNTIL 5.0!!
} hamlib_port_t;
typedef struct hamlib_port_deprecated {
union {
rig_port_t rig;
ptt_type_t ptt;
dcd_type_t dcd;
} type;
int fd;
void *handle;
int write_delay;
int post_write_delay;
struct {
int tv_sec, tv_usec;
} post_write_date;
int timeout;
short retry;
short flushx;
char pathname[HAMLIB_FILPATHLEN];
union {
struct {
int rate;
int data_bits;
int stop_bits;
enum serial_parity_e parity;
enum serial_handshake_e handshake;
enum serial_control_state_e rts_state;
enum serial_control_state_e dtr_state;
} serial;
struct {
int pin;
} parallel;
struct {
int ptt_bitnum;
} cm108;
struct {
int vid;
int pid;
int conf;
int iface;
int alt;
char *vendor_name;
char *product;
} usb;
struct {
int on_value;
int value;
} gpio;
} parm;
int client_port;
RIG *rig;
} hamlib_port_t_deprecated;
#if !defined(__APPLE__) || !defined(__cplusplus)
typedef hamlib_port_t_deprecated port_t_deprecated;
typedef hamlib_port_t port_t;
#endif
#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 */
hamlib_port_t_deprecated
struct hamlib_port_deprecated hamlib_port_t_deprecated
port_t_deprecated
hamlib_port_t_deprecated port_t_deprecated
Definition port.h:200
port_t
hamlib_port_t port_t
Short type name of the hamlib_port structure.
Definition port.h:203
hamlib_port_t
struct hamlib_port hamlib_port_t
Port definition.
serial_parity_e
serial_parity_e
Serial parity.
Definition rig.h:348
serial_control_state_e
serial_control_state_e
Serial control state.
Definition rig.h:370
rig_port_t
enum rig_port_e rig_port_t
Port type.
ptt_type_t
enum ptt_type_e ptt_type_t
PTT (Push To Talk) type.
serial_handshake_e
serial_handshake_e
Serial handshake.
Definition rig.h:360
RIG
struct s_rig RIG
Rig structure definition (see rig for details).
Definition rig.h:277
dcd_type_t
enum dcd_type_e dcd_type_t
DCD (Data Carrier Detect) type.
hamlib_port_deprecated
Definition port.h:137
hamlib_port_deprecated::post_write_delay
int post_write_delay
Definition port.h:148
hamlib_port_deprecated::client_port
int client_port
Definition port.h:194
hamlib_port_deprecated::pid
int pid
Definition port.h:181
hamlib_port_deprecated::alt
int alt
Definition port.h:184
hamlib_port_deprecated::rig
rig_port_t rig
Definition port.h:139
hamlib_port_deprecated::iface
int iface
Definition port.h:183
hamlib_port_deprecated::ptt_bitnum
int ptt_bitnum
Definition port.h:176
hamlib_port_deprecated::post_write_date
struct hamlib_port_deprecated::@210066067052274240044303104341022147230221375150 post_write_date
hamlib_port_deprecated::parity
enum serial_parity_e parity
Definition port.h:165
hamlib_port_deprecated::flushx
short flushx
Definition port.h:156
hamlib_port_deprecated::on_value
int on_value
Definition port.h:190
hamlib_port_deprecated::vendor_name
char * vendor_name
Definition port.h:185
hamlib_port_deprecated::handle
void * handle
Definition port.h:145
hamlib_port_deprecated::cm108
struct hamlib_port_deprecated::@131017137252375305100175022362075116140045004304::@322060253242211347141130311300132130302166133036 cm108
hamlib_port_deprecated::data_bits
int data_bits
Definition port.h:163
hamlib_port_deprecated::parallel
struct hamlib_port_deprecated::@131017137252375305100175022362075116140045004304::@314323066224360160077154152322373346306251037036 parallel
hamlib_port_deprecated::write_delay
int write_delay
Definition port.h:147
hamlib_port_deprecated::rts_state
enum serial_control_state_e rts_state
Definition port.h:167
hamlib_port_deprecated::conf
int conf
Definition port.h:182
hamlib_port_deprecated::ptt
ptt_type_t ptt
Definition port.h:140
hamlib_port_deprecated::usb
struct hamlib_port_deprecated::@131017137252375305100175022362075116140045004304::@025367001360231151312023100014045351216003066271 usb
hamlib_port_deprecated::rate
int rate
Definition port.h:162
hamlib_port_deprecated::gpio
struct hamlib_port_deprecated::@131017137252375305100175022362075116140045004304::@133004152201277167004244264344232175310057362003 gpio
hamlib_port_deprecated::timeout
int timeout
Definition port.h:154
hamlib_port_deprecated::product
char * product
Definition port.h:186
hamlib_port_deprecated::dcd
dcd_type_t dcd
Definition port.h:141
hamlib_port_deprecated::handshake
enum serial_handshake_e handshake
Definition port.h:166
hamlib_port_deprecated::stop_bits
int stop_bits
Definition port.h:164
hamlib_port_deprecated::retry
short retry
Definition port.h:155
hamlib_port_deprecated::value
int value
Definition port.h:191
hamlib_port_deprecated::serial
struct hamlib_port_deprecated::@131017137252375305100175022362075116140045004304::@024235247305212157174005122042063337036112134134 serial
hamlib_port_deprecated::pin
int pin
Definition port.h:172
hamlib_port_deprecated::fd
int fd
Definition port.h:144
hamlib_port_deprecated::pathname
char pathname[HAMLIB_FILPATHLEN]
Definition port.h:158
hamlib_port_deprecated::dtr_state
enum serial_control_state_e dtr_state
Definition port.h:168
hamlib_port_deprecated::vid
int vid
Definition port.h:180
hamlib_port
Port definition.
Definition port.h:55
hamlib_port::handle
void * handle
Definition port.h:63
hamlib_port::asyncio
int asyncio
Definition port.h:114
hamlib_port::alt
int alt
Definition port.h:102
hamlib_port::conf
int conf
Definition port.h:100
hamlib_port::retry
short retry
Definition port.h:73
hamlib_port::rts_state
enum serial_control_state_e rts_state
Definition port.h:85
hamlib_port::cm108
struct hamlib_port::@057360320261112035277026345302105300112350176063::@345016111254217030056351204246301313223234141111 cm108
hamlib_port::ptt_bitnum
int ptt_bitnum
Definition port.h:94
hamlib_port::pin
int pin
Definition port.h:90
hamlib_port::flushx
short flushx
Definition port.h:74
hamlib_port::data_bits
int data_bits
Definition port.h:81
hamlib_port::parallel
struct hamlib_port::@057360320261112035277026345302105300112350176063::@373261363353173065117357106075253365133272075306 parallel
hamlib_port::gpio
struct hamlib_port::@057360320261112035277026345302105300112350176063::@230222313215044303100336244366243354055154156273 gpio
hamlib_port::fd_sync_read
int fd_sync_read
Definition port.h:120
hamlib_port::serial
struct hamlib_port::@057360320261112035277026345302105300112350176063::@243323227203231232136152036347370331321235135327 serial
hamlib_port::product
char * product
Definition port.h:104
hamlib_port::fd_sync_error_write
int fd_sync_error_write
Definition port.h:121
hamlib_port::rate
int rate
Definition port.h:80
hamlib_port::timeout_retry
short timeout_retry
Definition port.h:124
hamlib_port::fd_sync_error_read
int fd_sync_error_read
Definition port.h:122
hamlib_port::iface
int iface
Definition port.h:101
hamlib_port::dtr_state
enum serial_control_state_e dtr_state
Definition port.h:86
hamlib_port::fd_sync_write
int fd_sync_write
Definition port.h:119
hamlib_port::pid
int pid
Definition port.h:99
hamlib_port::vid
int vid
Definition port.h:98
hamlib_port::handshake
enum serial_handshake_e handshake
Definition port.h:84
hamlib_port::vendor_name
char * vendor_name
Definition port.h:103
hamlib_port::on_value
int on_value
Definition port.h:108
hamlib_port::post_write_date
struct hamlib_port::@034336344324052256154260137224157274370136250205 post_write_date
hamlib_port::rig
rig_port_t rig
Definition port.h:57
hamlib_port::timeout
int timeout
Definition port.h:72
hamlib_port::usb
struct hamlib_port::@057360320261112035277026345302105300112350176063::@306333120103250277246061131170070332166334063274 usb
hamlib_port::fd
int fd
Definition port.h:62
hamlib_port::client_port
int client_port
Definition port.h:112
hamlib_port::post_write_delay
int post_write_delay
Definition port.h:66
hamlib_port::pathname
char pathname[HAMLIB_FILPATHLEN]
Definition port.h:76
hamlib_port::parity
enum serial_parity_e parity
Definition port.h:83
hamlib_port::stop_bits
int stop_bits
Definition port.h:82
hamlib_port::value
int value
Definition port.h:109
hamlib_port::dcd
dcd_type_t dcd
Definition port.h:59
hamlib_port::ptt
ptt_type_t ptt
Definition port.h:58
hamlib_port::write_delay
int write_delay
Definition port.h:65