aboutsummaryrefslogtreecommitdiff
path: root/bikewedge/software/RetoolingForOpenSprints/serproxy-0.1.3.src/pipe.h
blob: a0786ab180dcb0b398efcdeff8ca68cb1bd81779 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef PIPE_H
#define PIPE_H

#include "sio.h"
#include "sock.h"
#include "thread.h"

typedef struct
{
	/* Serial port */
	sio_s sio;

	/* Socket */
	tcpsock_s sock;

	/* Mutex lock */
	thr_mutex_t *mutex;
	
	/* Time out in seconds */
	int timeout;
	
	/* Convert newlines from the serial port to nils? */
	int newlines;
} pipe_s;

int pipe_init(pipe_s *pipe, int sock_port);
void pipe_cleanup(pipe_s *pipe);
void pipe_destroy(void *data);

#endif	/* PIPE_H */