Hamlib 4.7~git
Loading...
Searching...
No Matches
port.h
Go to the documentation of this file.
1/*
2 * Hamlib Interface - Port structure
3 * Copyright (c) 2000-2025 The Hamlib Group
4 * Copyright (c) 2025 George Baltz
5 *
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 *
21 */
22/* SPDX-License-Identifier: LGPL-2.1-or-later */
23
24#ifndef _HL_PORT_H
25#define _HL_PORT_H 1
26
27
28__BEGIN_DECLS
29
34
43
55typedef struct hamlib_port {
56 union {
60 } type;
61
62 int fd;
63 void *handle;
64
67
68 struct {
69 int tv_sec, tv_usec;
71
72 int timeout;
73 short retry;
74 short flushx;
75
76 char pathname[HAMLIB_FILPATHLEN];
77
78 union {
79 struct {
80 int rate;
88
89 struct {
90 int pin;
92
93 struct {
96
97 struct {
98 int vid;
99 int pid;
100 int conf;
101 int iface;
102 int alt;
104 char *product;
105 } usb;
106
107 struct {
109 int value;
111 } parm;
115#if defined(_WIN32)
116 hamlib_async_pipe_t *sync_data_pipe;
117 hamlib_async_pipe_t *sync_data_error_pipe;
118#else
123#endif
125// DO NOT ADD ANYTHING HERE UNTIL 5.0!!
127
128
138 union {
142 } type;
143
144 int fd;
145 void *handle;
146
149
150 struct {
151 int tv_sec, tv_usec;
153
155 short retry;
156 short flushx;
157
158 char pathname[HAMLIB_FILPATHLEN];
159
160 union {
161 struct {
162 int rate;
170
171 struct {
172 int pin;
174
175 struct {
178
179 struct {
180 int vid;
181 int pid;
182 int conf;
183 int iface;
184 int alt;
186 char *product;
187 } usb;
188
189 struct {
191 int value;
193 } parm;
197
198#if !defined(__APPLE__) || !defined(__cplusplus)
201
204#endif
205
208#define HAMLIB_RIGPORT(r) ((hamlib_port_t *)rig_data_pointer((r), RIG_PTRX_RIGPORT))
209#define HAMLIB_PTTPORT(r) ((hamlib_port_t *)rig_data_pointer((r), RIG_PTRX_PTTPORT))
210#define HAMLIB_DCDPORT(r) ((hamlib_port_t *)rig_data_pointer((r), RIG_PTRX_DCDPORT))
211#define HAMLIB_AMPPORT(a) ((hamlib_port_t *)amp_data_pointer((a), RIG_PTRX_AMPPORT))
212#define HAMLIB_ROTPORT(r) ((hamlib_port_t *)rot_data_pointer((r), RIG_PTRX_ROTPORT))
213#define HAMLIB_ROTPORT2(r) ((hamlib_port_t *)rot_data_pointer((r), RIG_PTRX_ROTPORT2))
215
216__END_DECLS
217
218#endif /* _HL_PORT_H */
219
struct hamlib_port_deprecated hamlib_port_t_deprecated
hamlib_port_t_deprecated port_t_deprecated
Definition port.h:200
hamlib_port_t port_t
Short type name of the hamlib_port structure.
Definition port.h:203
struct hamlib_port hamlib_port_t
Port definition.
serial_parity_e
Serial parity.
Definition rig.h:359
serial_control_state_e
Serial control state.
Definition rig.h:381
enum rig_port_e rig_port_t
Port type.
enum ptt_type_e ptt_type_t
PTT (Push To Talk) type.
serial_handshake_e
Serial handshake.
Definition rig.h:371
struct s_rig RIG
Rig structure definition (see rig for details).
Definition rig.h:290
enum dcd_type_e dcd_type_t
DCD (Data Carrier Detect) type.
Definition port.h:137
int post_write_delay
Definition port.h:148
int client_port
Definition port.h:194
int pid
Definition port.h:181
int alt
Definition port.h:184
rig_port_t rig
Definition port.h:139
struct hamlib_port_deprecated::@250067024232125234252224161170240011015365167362::@040234064325244304062237167144256312071031321161 parallel
int iface
Definition port.h:183
int ptt_bitnum
Definition port.h:176
enum serial_parity_e parity
Definition port.h:165
short flushx
Definition port.h:156
struct hamlib_port_deprecated::@250067024232125234252224161170240011015365167362::@025141261127224222215237017367211047327223332357 cm108
int on_value
Definition port.h:190
char * vendor_name
Definition port.h:185
void * handle
Definition port.h:145
int data_bits
Definition port.h:163
struct hamlib_port_deprecated::@250067024232125234252224161170240011015365167362::@256022254115250350070374146176110041037347034366 serial
struct hamlib_port_deprecated::@250067024232125234252224161170240011015365167362::@307317132264060315152044000211047244111112374243 usb
int write_delay
Definition port.h:147
enum serial_control_state_e rts_state
Definition port.h:167
struct hamlib_port_deprecated::@250067024232125234252224161170240011015365167362::@340373033125206205152300020311310017277172036324 gpio
int conf
Definition port.h:182
ptt_type_t ptt
Definition port.h:140
int rate
Definition port.h:162
int timeout
Definition port.h:154
char * product
Definition port.h:186
dcd_type_t dcd
Definition port.h:141
enum serial_handshake_e handshake
Definition port.h:166
int stop_bits
Definition port.h:164
short retry
Definition port.h:155
struct hamlib_port_deprecated::@161177131146177057136054032211251251200240241227 post_write_date
int value
Definition port.h:191
int pin
Definition port.h:172
int fd
Definition port.h:144
char pathname[HAMLIB_FILPATHLEN]
Definition port.h:158
enum serial_control_state_e dtr_state
Definition port.h:168
int vid
Definition port.h:180
Port definition.
Definition port.h:55
void * handle
Definition port.h:63
int asyncio
Definition port.h:114
int alt
Definition port.h:102
int conf
Definition port.h:100
short retry
Definition port.h:73
enum serial_control_state_e rts_state
Definition port.h:85
int ptt_bitnum
Definition port.h:94
int pin
Definition port.h:90
short flushx
Definition port.h:74
int data_bits
Definition port.h:81
int fd_sync_read
Definition port.h:120
char * product
Definition port.h:104
int fd_sync_error_write
Definition port.h:121
int rate
Definition port.h:80
short timeout_retry
Definition port.h:124
int fd_sync_error_read
Definition port.h:122
int iface
Definition port.h:101
enum serial_control_state_e dtr_state
Definition port.h:86
int fd_sync_write
Definition port.h:119
struct hamlib_port::@010252341134000141374371065010022176366123126005::@051345052205163377070330333041347045362102261170 gpio
int pid
Definition port.h:99
int vid
Definition port.h:98
struct hamlib_port::@010252341134000141374371065010022176366123126005::@344161164022162143047217032106274234314102371047 parallel
enum serial_handshake_e handshake
Definition port.h:84
char * vendor_name
Definition port.h:103
int on_value
Definition port.h:108
struct hamlib_port::@010252341134000141374371065010022176366123126005::@265066055170122133055006326126303070255211223273 usb
rig_port_t rig
Definition port.h:57
struct hamlib_port::@233314311010012050223325235114014012340317032347 post_write_date
int timeout
Definition port.h:72
int fd
Definition port.h:62
int client_port
Definition port.h:112
int post_write_delay
Definition port.h:66
char pathname[HAMLIB_FILPATHLEN]
Definition port.h:76
enum serial_parity_e parity
Definition port.h:83
struct hamlib_port::@010252341134000141374371065010022176366123126005::@107223103132214137304013246371124141205072105116 serial
int stop_bits
Definition port.h:82
int value
Definition port.h:109
dcd_type_t dcd
Definition port.h:59
ptt_type_t ptt
Definition port.h:58
int write_delay
Definition port.h:65
struct hamlib_port::@010252341134000141374371065010022176366123126005::@214121014302363300071166046011273065116146071047 cm108