Hamlib 4.7~git
Loading...
Searching...
No Matches
iofunc.h
1/*
2 * Hamlib Interface - io function header
3 * Copyright (c) 2000-2005 by Stephane Fillod and Frank Singleton
4 *
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 *
20 */
21
22#ifndef _IOFUNC_H
23#define _IOFUNC_H 1
24
25#include "hamlib/rig.h"
26
27extern HAMLIB_EXPORT(int) port_open(hamlib_port_t *p);
28extern HAMLIB_EXPORT(int) port_close(hamlib_port_t *p, rig_port_t port_type);
29
30
31extern HAMLIB_EXPORT(int) read_block(hamlib_port_t *p,
32 unsigned char *rxbuffer,
33 size_t count);
34
35extern HAMLIB_EXPORT(int) read_block_direct(hamlib_port_t *p,
36 unsigned char *rxbuffer,
37 size_t count);
38
39extern HAMLIB_EXPORT(int) write_block(hamlib_port_t *p,
40 const unsigned char *txbuffer,
41 size_t count);
42
43extern HAMLIB_EXPORT(int) write_block_sync(hamlib_port_t *p,
44 const unsigned char *txbuffer,
45 size_t count);
46
47extern HAMLIB_EXPORT(int) write_block_sync_error(hamlib_port_t *p,
48 const unsigned char *txbuffer,
49 size_t count);
50
51extern HAMLIB_EXPORT(int) port_flush_sync_pipes(hamlib_port_t *p);
52
53extern HAMLIB_EXPORT(int) read_string(hamlib_port_t *p,
54 unsigned char *rxbuffer,
55 size_t rxmax,
56 const char *stopset,
57 int stopset_len,
58 int flush_flag,
59 int expected_len);
60
61extern HAMLIB_EXPORT(int) read_string_direct(hamlib_port_t *p,
62 unsigned char *rxbuffer,
63 size_t rxmax,
64 const char *stopset,
65 int stopset_len,
66 int flush_flag,
67 int expected_len);
68
69#endif /* _IOFUNC_H */
struct hamlib_port hamlib_port_t
Port definition.
int port_close(hamlib_port_t *p, rig_port_t port_type)
Close a hamlib_port.
Definition iofunc.c:383
int read_string(hamlib_port_t *p, unsigned char *rxbuffer, size_t rxmax, const char *stopset, int stopset_len, int flush_flag, int expected_len)
Read a string from the device directly or from the synchronous data pipe, depending on the device cap...
Definition iofunc.c:1555
int write_block(hamlib_port_t *p, const unsigned char *txbuffer, size_t count)
Write a block of characters to an fd.
Definition iofunc.c:1064
int read_block_direct(hamlib_port_t *p, unsigned char *rxbuffer, size_t count)
Read bytes directly from the device file descriptor.
Definition iofunc.c:1309
int port_open(hamlib_port_t *p)
Open a hamlib_port based on its rig port type.
Definition iofunc.c:228
int read_block(hamlib_port_t *p, unsigned char *rxbuffer, size_t count)
Read bytes from the device directly or from the synchronous data pipe, depending on the device caps.
Definition iofunc.c:1285
int read_string_direct(hamlib_port_t *p, unsigned char *rxbuffer, size_t rxmax, const char *stopset, int stopset_len, int flush_flag, int expected_len)
Read a string directly from the device file descriptor.
Definition iofunc.c:1594
enum rig_port_e rig_port_t
Port type.
Hamlib rig data structures.