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

#include <UDPDevice.h>

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

Public Member Functions

 UDPDevice (const char *ip, uint16_t port, bool bcast, bool input)
 
virtual ~UDPDevice ()
 
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 socket {true}
 
const char * _ip
 
uint16_t _port
 
bool _bcast
 
bool _input
 
bool _connected = false
 

Detailed Description

Definition at line 6 of file UDPDevice.h.

Constructor & Destructor Documentation

◆ UDPDevice()

UDPDevice::UDPDevice ( const char *  ip,
uint16_t  port,
bool  bcast,
bool  input 
)

Definition at line 9 of file UDPDevice.cpp.

◆ ~UDPDevice()

UDPDevice::~UDPDevice ( )
virtual

Definition at line 17 of file UDPDevice.cpp.

Member Function Documentation

◆ close()

bool UDPDevice::close ( )
overridevirtual

Implements SerialDevice.

Definition at line 63 of file UDPDevice.cpp.

◆ open()

bool UDPDevice::open ( )
overridevirtual

Implements SerialDevice.

Definition at line 48 of file UDPDevice.cpp.

◆ read()

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

Implements SerialDevice.

Definition at line 36 of file UDPDevice.cpp.

◆ set_blocking()

void UDPDevice::set_blocking ( bool  blocking)
overridevirtual

Implements SerialDevice.

Definition at line 68 of file UDPDevice.cpp.

◆ set_speed()

void UDPDevice::set_speed ( uint32_t  speed)
overridevirtual

Implements SerialDevice.

Definition at line 73 of file UDPDevice.cpp.

◆ write()

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

Implements SerialDevice.

Definition at line 21 of file UDPDevice.cpp.

Member Data Documentation

◆ _bcast

bool UDPDevice::_bcast
private

Definition at line 21 of file UDPDevice.h.

Referenced by open().

◆ _connected

bool UDPDevice::_connected = false
private

Definition at line 23 of file UDPDevice.h.

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

◆ _input

bool UDPDevice::_input
private

Definition at line 22 of file UDPDevice.h.

Referenced by open(), and write().

◆ _ip

const char* UDPDevice::_ip
private

Definition at line 19 of file UDPDevice.h.

Referenced by open(), and write().

◆ _port

uint16_t UDPDevice::_port
private

Definition at line 20 of file UDPDevice.h.

Referenced by open(), and write().

◆ socket

SocketAPM UDPDevice::socket {true}
private

Definition at line 18 of file UDPDevice.h.

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


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