Hamlib
4.7.2
Toggle main menu visibility
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
55
typedef
struct
hamlib_port
{
56
union
{
57
rig_port_t
rig
;
58
ptt_type_t
ptt
;
59
dcd_type_t
dcd
;
60
} type;
61
62
int
fd
;
63
void
*
handle
;
64
65
int
write_delay
;
66
int
post_write_delay
;
67
68
struct
{
69
int
tv_sec, tv_usec;
70
}
post_write_date
;
71
72
int
timeout
;
73
short
retry
;
74
short
flushx
;
75
76
char
pathname
[HAMLIB_FILPATHLEN];
77
78
union
{
79
struct
{
80
int
rate
;
81
int
data_bits
;
82
int
stop_bits
;
83
enum
serial_parity_e
parity
;
84
enum
serial_handshake_e
handshake
;
85
enum
serial_control_state_e
rts_state
;
86
enum
serial_control_state_e
dtr_state
;
87
}
serial
;
88
89
struct
{
90
int
pin
;
91
}
parallel
;
92
93
struct
{
94
int
ptt_bitnum
;
95
}
cm108
;
96
97
struct
{
98
int
vid
;
99
int
pid
;
100
int
conf
;
101
int
iface
;
102
int
alt
;
103
char
*
vendor_name
;
104
char
*
product
;
105
}
usb
;
106
107
struct
{
108
int
on_value
;
109
int
value
;
110
}
gpio
;
111
}
parm
;
112
int
client_port
;
113
RIG
*
rig
;
114
int
asyncio
;
115
#if defined(_WIN32)
116
hamlib_async_pipe_t *sync_data_pipe;
117
hamlib_async_pipe_t *sync_data_error_pipe;
118
#else
119
int
fd_sync_write
;
120
int
fd_sync_read
;
121
int
fd_sync_error_write
;
122
int
fd_sync_error_read
;
123
#endif
124
short
timeout_retry
;
125
// DO NOT ADD ANYTHING HERE UNTIL 5.0!!
126
}
hamlib_port_t
;
127
128
137
typedef
struct
hamlib_port_deprecated
{
138
union
{
139
rig_port_t
rig
;
140
ptt_type_t
ptt
;
141
dcd_type_t
dcd
;
142
} type;
143
144
int
fd
;
145
void
*
handle
;
146
147
int
write_delay
;
148
int
post_write_delay
;
149
150
struct
{
151
int
tv_sec, tv_usec;
152
}
post_write_date
;
153
154
int
timeout
;
155
short
retry
;
156
short
flushx
;
157
158
char
pathname
[HAMLIB_FILPATHLEN];
159
160
union
{
161
struct
{
162
int
rate
;
163
int
data_bits
;
164
int
stop_bits
;
165
enum
serial_parity_e
parity
;
166
enum
serial_handshake_e
handshake
;
167
enum
serial_control_state_e
rts_state
;
168
enum
serial_control_state_e
dtr_state
;
169
}
serial
;
170
171
struct
{
172
int
pin
;
173
}
parallel
;
174
175
struct
{
176
int
ptt_bitnum
;
177
}
cm108
;
178
179
struct
{
180
int
vid
;
181
int
pid
;
182
int
conf
;
183
int
iface
;
184
int
alt
;
185
char
*
vendor_name
;
186
char
*
product
;
187
}
usb
;
188
189
struct
{
190
int
on_value
;
191
int
value
;
192
}
gpio
;
193
}
parm
;
194
int
client_port
;
195
RIG
*
rig
;
196
}
hamlib_port_t_deprecated
;
197
198
#if !defined(__APPLE__) || !defined(__cplusplus)
200
typedef
hamlib_port_t_deprecated
port_t_deprecated
;
201
203
typedef
hamlib_port_t
port_t
;
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
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:346
serial_control_state_e
serial_control_state_e
Serial control state.
Definition
rig.h:368
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:358
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::[union].parm::[struct].parm.cm108::ptt_bitnum
int ptt_bitnum
hamlib_port::[union].parm::[struct].parm.gpio::on_value
int on_value
hamlib_port::[union].parm::[struct].parm.gpio::value
int value
hamlib_port::[union].parm::[struct].parm.parallel::pin
int pin
hamlib_port::[union].parm::[struct].parm.serial::rate
int rate
hamlib_port::[union].parm::[struct].parm.serial::stop_bits
int stop_bits
hamlib_port::[union].parm::[struct].parm.serial::rts_state
enum serial_control_state_e rts_state
hamlib_port::[union].parm::[struct].parm.serial::dtr_state
enum serial_control_state_e dtr_state
hamlib_port::[union].parm::[struct].parm.serial::parity
enum serial_parity_e parity
hamlib_port::[union].parm::[struct].parm.serial::handshake
enum serial_handshake_e handshake
hamlib_port::[union].parm::[struct].parm.serial::data_bits
int data_bits
hamlib_port::[union].parm::[struct].parm.usb::vid
int vid
hamlib_port::[union].parm::[struct].parm.usb::iface
int iface
hamlib_port::[union].parm::[struct].parm.usb::pid
int pid
hamlib_port::[union].parm::[struct].parm.usb::vendor_name
char * vendor_name
hamlib_port::[union].parm::[struct].parm.usb::product
char * product
hamlib_port::[union].parm::[struct].parm.usb::conf
int conf
hamlib_port::[union].parm::[struct].parm.usb::alt
int alt
hamlib_port_deprecated::[union].parm::[struct].parm.cm108::ptt_bitnum
int ptt_bitnum
hamlib_port_deprecated::[union].parm::[struct].parm.gpio::value
int value
hamlib_port_deprecated::[union].parm::[struct].parm.gpio::on_value
int on_value
hamlib_port_deprecated::[union].parm::[struct].parm.parallel::pin
int pin
hamlib_port_deprecated::[union].parm::[struct].parm.serial::handshake
enum serial_handshake_e handshake
hamlib_port_deprecated::[union].parm::[struct].parm.serial::rate
int rate
hamlib_port_deprecated::[union].parm::[struct].parm.serial::dtr_state
enum serial_control_state_e dtr_state
hamlib_port_deprecated::[union].parm::[struct].parm.serial::stop_bits
int stop_bits
hamlib_port_deprecated::[union].parm::[struct].parm.serial::parity
enum serial_parity_e parity
hamlib_port_deprecated::[union].parm::[struct].parm.serial::rts_state
enum serial_control_state_e rts_state
hamlib_port_deprecated::[union].parm::[struct].parm.serial::data_bits
int data_bits
hamlib_port_deprecated::[union].parm::[struct].parm.usb::iface
int iface
hamlib_port_deprecated::[union].parm::[struct].parm.usb::alt
int alt
hamlib_port_deprecated::[union].parm::[struct].parm.usb::vid
int vid
hamlib_port_deprecated::[union].parm::[struct].parm.usb::vendor_name
char * vendor_name
hamlib_port_deprecated::[union].parm::[struct].parm.usb::product
char * product
hamlib_port_deprecated::[union].parm::[struct].parm.usb::conf
int conf
hamlib_port_deprecated::[union].parm::[struct].parm.usb::pid
int pid
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::parm
union hamlib_port_deprecated::@305311217216000035260066360007362023177273235126 parm
hamlib_port_deprecated::flushx
short flushx
Definition
port.h:156
hamlib_port_deprecated::rig
RIG * rig
Definition
port.h:195
hamlib_port_deprecated::post_write_date
struct hamlib_port_deprecated::@000223350032112107244007167117037254247212266064 post_write_date
hamlib_port_deprecated::handle
void * handle
Definition
port.h:145
hamlib_port_deprecated::write_delay
int write_delay
Definition
port.h:147
hamlib_port_deprecated::timeout
int timeout
Definition
port.h:154
hamlib_port_deprecated::retry
short retry
Definition
port.h:155
hamlib_port_deprecated::fd
int fd
Definition
port.h:144
hamlib_port_deprecated::pathname
char pathname[HAMLIB_FILPATHLEN]
Definition
port.h:158
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::retry
short retry
Definition
port.h:73
hamlib_port::flushx
short flushx
Definition
port.h:74
hamlib_port::fd_sync_read
int fd_sync_read
Definition
port.h:120
hamlib_port::fd_sync_error_write
int fd_sync_error_write
Definition
port.h:121
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::parm
union hamlib_port::@147055141360315117175354205071070217175261143220 parm
hamlib_port::fd_sync_write
int fd_sync_write
Definition
port.h:119
hamlib_port::post_write_date
struct hamlib_port::@077330211250007120160332353142301070354273003040 post_write_date
hamlib_port::timeout
int timeout
Definition
port.h:72
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::rig
RIG * rig
Definition
port.h:113
hamlib_port::write_delay
int write_delay
Definition
port.h:65
hamlib_port::[union].parm::cm108
struct hamlib_port::@147055141360315117175354205071070217175261143220::@360322352124044355177140322164123034363237173051 cm108
hamlib_port::[union].parm::parallel
struct hamlib_port::@147055141360315117175354205071070217175261143220::@233135027057156233215270254221311200120067254102 parallel
hamlib_port::[union].parm::usb
struct hamlib_port::@147055141360315117175354205071070217175261143220::@362352146311332015277377320056044162077222214320 usb
hamlib_port::[union].parm::gpio
struct hamlib_port::@147055141360315117175354205071070217175261143220::@103272155056216263130051043351275036043365072163 gpio
hamlib_port::[union].parm::serial
struct hamlib_port::@147055141360315117175354205071070217175261143220::@015001166055121256226137215046357026206123114364 serial
hamlib_port::[union].type::rig
rig_port_t rig
hamlib_port::[union].type::dcd
dcd_type_t dcd
hamlib_port::[union].type::ptt
ptt_type_t ptt
hamlib_port_deprecated::[union].parm::parallel
struct hamlib_port_deprecated::@305311217216000035260066360007362023177273235126::@036047160323217302260116213256311010114300201324 parallel
hamlib_port_deprecated::[union].parm::serial
struct hamlib_port_deprecated::@305311217216000035260066360007362023177273235126::@353213077104332117255254156373173263051032313317 serial
hamlib_port_deprecated::[union].parm::cm108
struct hamlib_port_deprecated::@305311217216000035260066360007362023177273235126::@163076200265216352227221030355256117156006342356 cm108
hamlib_port_deprecated::[union].parm::gpio
struct hamlib_port_deprecated::@305311217216000035260066360007362023177273235126::@267354354002115102134235060203014326337217265354 gpio
hamlib_port_deprecated::[union].parm::usb
struct hamlib_port_deprecated::@305311217216000035260066360007362023177273235126::@064346153307367106213341050167047116071150203121 usb
hamlib_port_deprecated::[union].type::ptt
ptt_type_t ptt
hamlib_port_deprecated::[union].type::dcd
dcd_type_t dcd
hamlib_port_deprecated::[union].type::rig
rig_port_t rig
include
hamlib
port.h
Generated by
1.18.0
Hamlib documentation for version 4.7.2—
Project page:
http://www.hamlib.org