APM:Libraries
Public Member Functions | Private Attributes | List of all members
TCPServerDevice Class Reference

#include <TCPServerDevice.h>

Inheritance diagram for TCPServerDevice:
[legend]
Collaboration diagram for TCPServerDevice:
[legend]

Public Member Functions

 TCPServerDevice (const char *ip, uint16_t port, bool wait)
 
virtual ~TCPServerDevice ()
 
virtual bool open () override
 
virtual bool close () override
 
virtual void set_blocking (bool blocking) override
 
virtual void set_speed (uint32_t speed) override
 
virtual ssize_t write (const uint8_t *buf, uint16_t n) override
 
virtual ssize_t read (uint8_t *buf, uint16_t n) override
 
- Public Member Functions inherited from SerialDevice
virtual ~SerialDevice ()
 
virtual AP_HAL::UARTDriver::flow_control get_flow_control (void)
 
virtual void set_flow_control (AP_HAL::UARTDriver::flow_control flow_control_setting)
 

Private Attributes

SocketAPM listener {false}
 
SocketAPM * sock = nullptr
 
const char * _ip
 
uint16_t _port
 
bool _wait
 
bool _blocking = false
 
uint32_t _last_bind_warning = 0
 

Detailed Description

Definition at line 6 of file TCPServerDevice.h.

Constructor & Destructor Documentation

◆ TCPServerDevice()

TCPServerDevice::TCPServerDevice ( const char *  ip,
uint16_t  port,
bool  wait 
)

Definition at line 12 of file TCPServerDevice.cpp.

◆ ~TCPServerDevice()

TCPServerDevice::~TCPServerDevice ( )
virtual

Definition at line 19 of file TCPServerDevice.cpp.

Member Function Documentation

◆ close()

bool TCPServerDevice::close ( )
overridevirtual

Implements SerialDevice.

Definition at line 103 of file TCPServerDevice.cpp.

◆ open()

bool TCPServerDevice::open ( )
overridevirtual

Implements SerialDevice.

Definition at line 60 of file TCPServerDevice.cpp.

Here is the call graph for this function:

◆ read()

ssize_t TCPServerDevice::read ( uint8_t *  buf,
uint16_t  n 
)
overridevirtual

Implements SerialDevice.

Definition at line 39 of file TCPServerDevice.cpp.

◆ set_blocking()

void TCPServerDevice::set_blocking ( bool  blocking)
overridevirtual

Implements SerialDevice.

Definition at line 112 of file TCPServerDevice.cpp.

◆ set_speed()

void TCPServerDevice::set_speed ( uint32_t  speed)
overridevirtual

Implements SerialDevice.

Definition at line 118 of file TCPServerDevice.cpp.

◆ write()

ssize_t TCPServerDevice::write ( const uint8_t *  buf,
uint16_t  n 
)
overridevirtual

Implements SerialDevice.

Definition at line 27 of file TCPServerDevice.cpp.

Member Data Documentation

◆ _blocking

bool TCPServerDevice::_blocking = false
private

Definition at line 24 of file TCPServerDevice.h.

Referenced by open(), read(), and set_blocking().

◆ _ip

const char* TCPServerDevice::_ip
private

Definition at line 21 of file TCPServerDevice.h.

Referenced by open().

◆ _last_bind_warning

uint32_t TCPServerDevice::_last_bind_warning = 0
private

Definition at line 25 of file TCPServerDevice.h.

Referenced by open().

◆ _port

uint16_t TCPServerDevice::_port
private

Definition at line 22 of file TCPServerDevice.h.

Referenced by open().

◆ _wait

bool TCPServerDevice::_wait
private

Definition at line 23 of file TCPServerDevice.h.

Referenced by open().

◆ listener

SocketAPM TCPServerDevice::listener {false}
private

Definition at line 19 of file TCPServerDevice.h.

Referenced by open(), read(), and set_blocking().

◆ sock

SocketAPM* TCPServerDevice::sock = nullptr
private

Definition at line 20 of file TCPServerDevice.h.

Referenced by close(), open(), read(), write(), and ~TCPServerDevice().


The documentation for this class was generated from the following files: