Larus glider flight sensor system 3.9.2024
Software-In-The-Loop test and validation system
Loading...
Searching...
No Matches
TCP_server.cpp File Reference

TCP server to feed XCsoar with flight data. More...

#include "system_configuration.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/types.h>
#include "TCP_server.h"

Go to the source code of this file.

Enumerations

enum  { MAX_CLIENTS =10 }
 

Functions

bool accept_TCP_client (bool wait_for_client)
 
bool open_TCP_port (void)
 
void write_TCP_port (char *data, unsigned length)
 
void close_TCP_port (void)
 

Variables

int listening_socket_file_descriptor
 
struct sockaddr_in servaddr cli
 
socklen_t len
 
int TCP_clients [MAX_CLIENTS]
 
int number_of_TCP_clients = 0
 

Detailed Description

TCP server to feed XCsoar with flight data.

Author
Dr. Klaus Schaefer

<Larus Flight Sensor Firmware>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file TCP_server.cpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
MAX_CLIENTS 

Definition at line 50 of file TCP_server.cpp.

Function Documentation

◆ accept_TCP_client()

bool accept_TCP_client ( bool  wait_for_client)

◆ close_TCP_port()

◆ open_TCP_port()

bool open_TCP_port ( void  )

◆ write_TCP_port()

void write_TCP_port ( char data,
unsigned  length 
)

Variable Documentation

◆ cli

Definition at line 44 of file TCP_server.cpp.

Referenced by accept_TCP_client(), and open_TCP_port().

◆ len

socklen_t len

Definition at line 48 of file TCP_server.cpp.

Referenced by accept_TCP_client(), open_TCP_port(), and read_EEPROM_file().

◆ listening_socket_file_descriptor

int listening_socket_file_descriptor

Definition at line 43 of file TCP_server.cpp.

Referenced by accept_TCP_client(), close_TCP_port(), and open_TCP_port().

◆ number_of_TCP_clients

int number_of_TCP_clients = 0

Definition at line 52 of file TCP_server.cpp.

Referenced by accept_TCP_client(), close_TCP_port(), and write_TCP_port().

◆ TCP_clients

int TCP_clients[MAX_CLIENTS]

Definition at line 51 of file TCP_server.cpp.

Referenced by accept_TCP_client(), close_TCP_port(), and write_TCP_port().