urg_connection.h
Go to the documentation of this file.
1 #ifndef URG_CONNECTION_H
2 #define URG_CONNECTION_H
3 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 #include "urg_c/urg_serial.h"
18 #include "urg_c/urg_tcpclient.h"
19 
20 
24 enum {
26 };
27 
28 
32 typedef enum {
36 
37 
41 typedef struct
42 {
47 
48 
90 extern int connection_open(urg_connection_t *connection,
91  urg_connection_type_t connection_type,
92  const char *device, long baudrate_or_port);
93 
94 
107 extern void connection_close(urg_connection_t *connection);
108 
109 
111 extern int connection_set_baudrate(urg_connection_t *connection, long baudrate);
112 
113 
132 extern int connection_write(urg_connection_t *connection,
133  const char *data, int size);
134 
135 
164 extern int connection_read(urg_connection_t *connection,
165  char *data, int max_size, int timeout);
166 
167 
189 extern int connection_readline(urg_connection_t *connection,
190  char *data, int max_size, int timeout);
191 
192 #ifdef __cplusplus
193 }
194 #endif
195 
196 #endif /* !URG_CONNECTION_H */
URG_CONNECTION_TIMEOUT
@ URG_CONNECTION_TIMEOUT
タイムアウトが発生したときの戻り値
Definition: urg_connection.h:25
connection_close
void connection_close(urg_connection_t *connection)
切断
Definition: urg_connection.c:33
connection_set_baudrate
int connection_set_baudrate(urg_connection_t *connection, long baudrate)
Definition: urg_connection.c:47
urg_serial_t
シリアル通信用
Definition: urg_serial.h:40
urg_connection_type_t
urg_connection_type_t
通信タイプ
Definition: urg_connection.h:32
urg_connection_t::serial
urg_serial_t serial
シリアル接続
Definition: urg_connection.h:44
connection_readline
int connection_readline(urg_connection_t *connection, char *data, int max_size, int timeout)
改行文字までの受信
Definition: urg_connection.c:95
urg_tcpclient_t
TCP/IP connection.
Definition: urg_tcpclient.h:44
urg_connection_t
通信リソース
Definition: urg_connection.h:41
urg_connection_t::type
urg_connection_type_t type
接続タイプ
Definition: urg_connection.h:43
urg_tcpclient.h
TCP/IP read/write functions.
connection_open
int connection_open(urg_connection_t *connection, urg_connection_type_t connection_type, const char *device, long baudrate_or_port)
接続
Definition: urg_connection.c:13
urg_serial.h
シリアル通信
connection_read
int connection_read(urg_connection_t *connection, char *data, int max_size, int timeout)
受信
Definition: urg_connection.c:80
urg_connection_t::tcpclient
urg_tcpclient_t tcpclient
イーサーネット接続
Definition: urg_connection.h:45
URG_SERIAL
@ URG_SERIAL
シリアル, USB 接続
Definition: urg_connection.h:33
URG_ETHERNET
@ URG_ETHERNET
イーサーネット接続
Definition: urg_connection.h:34
connection_write
int connection_write(urg_connection_t *connection, const char *data, int size)
送信
Definition: urg_connection.c:65


urg_c
Author(s): Satofumi Kamimura , Katsumi Kimoto, Adrian Boeing
autogenerated on Wed Mar 2 2022 01:08:11