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

#include <UARTDevice.h>

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

Public Member Functions

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

Private Member Functions

void _disable_crlf ()
 

Private Attributes

AP_HAL::UARTDriver::flow_control _flow_control = AP_HAL::UARTDriver::flow_control::FLOW_CONTROL_DISABLE
 
int _fd = -1
 
const char * _device_path
 

Detailed Description

Definition at line 6 of file UARTDevice.h.

Constructor & Destructor Documentation

◆ UARTDevice()

UARTDevice::UARTDevice ( const char *  device_path)

Definition at line 12 of file UARTDevice.cpp.

◆ ~UARTDevice()

UARTDevice::~UARTDevice ( )
virtual

Definition at line 17 of file UARTDevice.cpp.

Member Function Documentation

◆ _disable_crlf()

void UARTDevice::_disable_crlf ( )
private

Definition at line 87 of file UARTDevice.cpp.

Referenced by get_flow_control(), and open().

Here is the caller graph for this function:

◆ close()

bool UARTDevice::close ( )
overridevirtual

Implements SerialDevice.

Definition at line 21 of file UARTDevice.cpp.

◆ get_flow_control()

virtual AP_HAL::UARTDriver::flow_control UARTDevice::get_flow_control ( void  )
inlineoverridevirtual

Reimplemented from SerialDevice.

Definition at line 18 of file UARTDevice.h.

Here is the call graph for this function:

◆ open()

bool UARTDevice::open ( )
overridevirtual

Implements SerialDevice.

Definition at line 34 of file UARTDevice.cpp.

Here is the call graph for this function:

◆ read()

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

Implements SerialDevice.

Definition at line 49 of file UARTDevice.cpp.

Here is the call graph for this function:

◆ set_blocking()

void UARTDevice::set_blocking ( bool  blocking)
overridevirtual

Implements SerialDevice.

Definition at line 70 of file UARTDevice.cpp.

Here is the call graph for this function:

◆ set_flow_control()

void UARTDevice::set_flow_control ( enum AP_HAL::UARTDriver::flow_control  flow_control_setting)
overridevirtual

Reimplemented from SerialDevice.

Definition at line 113 of file UARTDevice.cpp.

◆ set_speed()

void UARTDevice::set_speed ( uint32_t  speed)
overridevirtual

Implements SerialDevice.

Definition at line 103 of file UARTDevice.cpp.

◆ write()

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

Implements SerialDevice.

Definition at line 54 of file UARTDevice.cpp.

Member Data Documentation

◆ _device_path

const char* UARTDevice::_device_path
private

Definition at line 28 of file UARTDevice.h.

Referenced by open(), and set_blocking().

◆ _fd

int UARTDevice::_fd = -1
private

◆ _flow_control

AP_HAL::UARTDriver::flow_control UARTDevice::_flow_control = AP_HAL::UARTDriver::flow_control::FLOW_CONTROL_DISABLE
private

Definition at line 25 of file UARTDevice.h.

Referenced by get_flow_control(), and set_flow_control().


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