2 ******************************************************************************
4 * @file pios_tcp_priv.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
6 * @brief TCP private definitions.
7 * @see The GNU Public License (GPL) Version 3
9 *****************************************************************************/
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 3 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
18 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #ifndef PIOS_TCP_PRIV_H
27 #define PIOS_TCP_PRIV_H
32 #include <sys/socket.h>
33 #include <arpa/inet.h>
38 #include <netinet/in.h>
39 #include "fifo_buffer.h"
47 const struct pios_tcp_cfg
*cfg
;
51 struct sockaddr_in server
;
52 struct sockaddr_in client
;
53 uint32_t clientLength
;
54 int socket_connection
;
57 pthread_mutex_t mutex
;
59 pios_com_callback tx_out_cb
;
60 uint32_t tx_out_context
;
61 pios_com_callback rx_in_cb
;
62 uint32_t rx_in_context
;
64 t_fifo_buffer rx_fifo
;
65 uint8_t rx_buffer
[PIOS_TCP_RX_BUFFER_SIZE
];
66 uint8_t tx_buffer
[PIOS_TCP_RX_BUFFER_SIZE
];
69 extern int32_t PIOS_TCP_Init(uint32_t *tcp_id
, const struct pios_tcp_cfg
*cfg
);
71 #endif /* PIOS_TCP_PRIV_H */