update serTcpOpen declaration to fix compile errors (#14113)
[betaflight.git] / src / main / drivers / serial_tcp.h
bloba391e10891c6d137a073cd74fd3431c427873231
1 /*
2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
8 * any later version.
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
21 #pragma once
23 #include <netinet/in.h>
24 #include <pthread.h>
25 #include "dyad.h"
26 #include "io/serial.h"
28 #define RX_BUFFER_SIZE 1400
29 #define TX_BUFFER_SIZE 1400
31 typedef struct {
32 serialPort_t port;
33 uint8_t rxBuffer[RX_BUFFER_SIZE];
34 uint8_t txBuffer[TX_BUFFER_SIZE];
36 dyad_Stream *serv;
37 dyad_Stream *conn;
38 pthread_mutex_t txLock;
39 pthread_mutex_t rxLock;
40 bool connected;
41 uint16_t clientCount;
42 uint8_t id;
43 } tcpPort_t;
45 serialPort_t *serTcpOpen(serialPortIdentifier_e id, serialReceiveCallbackPtr rxCallback, void *rxCallbackData, uint32_t baudRate, portMode_e mode, portOptions_e options);
47 // tcpPort API
48 void tcpDataIn(tcpPort_t *instance, uint8_t* ch, int size);
49 void tcpDataOut(tcpPort_t *instance);
51 bool tcpIsStart(void);
52 bool* tcpGetUsed(void);
53 tcpPort_t* tcpGetPool(void);