Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
rosflight_firmware::UDPBoard Class Reference

#include <udp_board.h>

Inheritance diagram for rosflight_firmware::UDPBoard:
Inheritance graph
[legend]

Classes

struct  Buffer
 

Public Member Functions

uint16_t serial_bytes_available (void) override
 
void serial_flush () override
 
void serial_init (uint32_t baud_rate, uint32_t dev) override
 
uint8_t serial_read (void) override
 
void serial_write (const uint8_t *src, size_t len) override
 
void set_ports (std::string bind_host, uint16_t bind_port, std::string remote_host, uint16_t remote_port)
 
 UDPBoard (std::string bind_host="localhost", uint16_t bind_port=14525, std::string remote_host="localhost", uint16_t remote_port=14520)
 
 ~UDPBoard ()
 
- Public Member Functions inherited from rosflight_firmware::Board
virtual bool baro_present ()=0
 
virtual void baro_read (float *pressure, float *temperature)=0
 
virtual void baro_update ()=0
 
virtual void board_reset (bool bootloader)=0
 
virtual void clock_delay (uint32_t milliseconds)=0
 
virtual uint64_t clock_micros ()=0
 
virtual uint32_t clock_millis ()=0
 
virtual bool diff_pressure_present ()=0
 
virtual void diff_pressure_read (float *diff_pressure, float *temperature)=0
 
virtual void diff_pressure_update ()=0
 
virtual BackupData get_backup_data ()=0
 
virtual bool gnss_has_new_data ()=0
 
virtual bool gnss_present ()=0
 
virtual GNSSRaw gnss_raw_read ()=0
 
virtual GNSSData gnss_read ()=0
 
virtual void gnss_update ()=0
 
virtual bool has_backup_data ()=0
 
virtual void imu_not_responding_error ()=0
 
virtual bool imu_read (float accel[3], float *temperature, float gyro[3], uint64_t *time)=0
 
virtual void init_board ()=0
 
virtual void led0_off ()=0
 
virtual void led0_on ()=0
 
virtual void led0_toggle ()=0
 
virtual void led1_off ()=0
 
virtual void led1_on ()=0
 
virtual void led1_toggle ()=0
 
virtual bool mag_present ()=0
 
virtual void mag_read (float mag[3])=0
 
virtual void mag_update ()=0
 
virtual void memory_init ()=0
 
virtual bool memory_read (void *dest, size_t len)=0
 
virtual bool memory_write (const void *src, size_t len)=0
 
virtual bool new_imu_data ()=0
 
virtual uint16_t num_sensor_errors ()=0
 
virtual void pwm_disable ()=0
 
virtual void pwm_init (uint32_t refresh_rate, uint16_t idle_pwm)=0
 
virtual void pwm_write (uint8_t channel, float value)=0
 
virtual void rc_init (rc_type_t rc_type)=0
 
virtual bool rc_lost ()=0
 
virtual float rc_read (uint8_t channel)=0
 
virtual void sensors_init ()=0
 
virtual bool sonar_present ()=0
 
virtual float sonar_read ()=0
 
virtual void sonar_update ()=0
 

Private Types

typedef boost::lock_guard< boost::recursive_mutex > MutexLock
 

Private Member Functions

void async_read ()
 
void async_read_end (const boost::system::error_code &error, size_t bytes_transferred)
 
void async_write (bool check_write_state)
 
void async_write_end (const boost::system::error_code &error, size_t bytes_transferred)
 

Private Attributes

boost::asio::ip::udp::endpoint bind_endpoint_
 
std::string bind_host_
 
uint16_t bind_port_
 
boost::asio::io_service io_service_
 
boost::thread io_thread_
 
uint8_t read_buffer_ [MAVLINK_MAX_PACKET_LEN]
 
boost::recursive_mutex read_mutex_
 
std::list< Buffer * > read_queue_
 
boost::asio::ip::udp::endpoint remote_endpoint_
 
std::string remote_host_
 
uint16_t remote_port_
 
boost::asio::ip::udp::socket socket_
 
bool write_in_progress_
 
boost::recursive_mutex write_mutex_
 
std::list< Buffer * > write_queue_
 

Additional Inherited Members

- Public Types inherited from rosflight_firmware::Board
enum  rc_type_t { RC_TYPE_PPM = 0, RC_TYPE_SBUS = 1 }
 

Detailed Description

Definition at line 52 of file udp_board.h.

Member Typedef Documentation

typedef boost::lock_guard<boost::recursive_mutex> rosflight_firmware::UDPBoard::MutexLock
private

Definition at line 92 of file udp_board.h.

Constructor & Destructor Documentation

rosflight_firmware::UDPBoard::UDPBoard ( std::string  bind_host = "localhost",
uint16_t  bind_port = 14525,
std::string  remote_host = "localhost",
uint16_t  remote_port = 14520 
)

Definition at line 45 of file udp_board.cpp.

rosflight_firmware::UDPBoard::~UDPBoard ( )

Definition at line 56 of file udp_board.cpp.

Member Function Documentation

void rosflight_firmware::UDPBoard::async_read ( )
private

Definition at line 136 of file udp_board.cpp.

void rosflight_firmware::UDPBoard::async_read_end ( const boost::system::error_code &  error,
size_t  bytes_transferred 
)
private

Definition at line 149 of file udp_board.cpp.

void rosflight_firmware::UDPBoard::async_write ( bool  check_write_state)
private

Definition at line 159 of file udp_board.cpp.

void rosflight_firmware::UDPBoard::async_write_end ( const boost::system::error_code &  error,
size_t  bytes_transferred 
)
private

Definition at line 178 of file udp_board.cpp.

uint16_t rosflight_firmware::UDPBoard::serial_bytes_available ( void  )
overridevirtual
Todo:
This should return a number, not a bool

Implements rosflight_firmware::Board.

Definition at line 112 of file udp_board.cpp.

void rosflight_firmware::UDPBoard::serial_flush ( )
inlineoverridevirtual

Implements rosflight_firmware::Board.

Definition at line 63 of file udp_board.h.

void rosflight_firmware::UDPBoard::serial_init ( uint32_t  baud_rate,
uint32_t  dev 
)
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 76 of file udp_board.cpp.

uint8_t rosflight_firmware::UDPBoard::serial_read ( void  )
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 118 of file udp_board.cpp.

void rosflight_firmware::UDPBoard::serial_write ( const uint8_t *  src,
size_t  len 
)
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 100 of file udp_board.cpp.

void rosflight_firmware::UDPBoard::set_ports ( std::string  bind_host,
uint16_t  bind_port,
std::string  remote_host,
uint16_t  remote_port 
)

Definition at line 68 of file udp_board.cpp.

Member Data Documentation

boost::asio::ip::udp::endpoint rosflight_firmware::UDPBoard::bind_endpoint_
private

Definition at line 113 of file udp_board.h.

std::string rosflight_firmware::UDPBoard::bind_host_
private

Definition at line 100 of file udp_board.h.

uint16_t rosflight_firmware::UDPBoard::bind_port_
private

Definition at line 101 of file udp_board.h.

boost::asio::io_service rosflight_firmware::UDPBoard::io_service_
private

Definition at line 110 of file udp_board.h.

boost::thread rosflight_firmware::UDPBoard::io_thread_
private

Definition at line 106 of file udp_board.h.

uint8_t rosflight_firmware::UDPBoard::read_buffer_[MAVLINK_MAX_PACKET_LEN]
private

Definition at line 116 of file udp_board.h.

boost::recursive_mutex rosflight_firmware::UDPBoard::read_mutex_
private

Definition at line 108 of file udp_board.h.

std::list<Buffer*> rosflight_firmware::UDPBoard::read_queue_
private

Definition at line 117 of file udp_board.h.

boost::asio::ip::udp::endpoint rosflight_firmware::UDPBoard::remote_endpoint_
private

Definition at line 114 of file udp_board.h.

std::string rosflight_firmware::UDPBoard::remote_host_
private

Definition at line 103 of file udp_board.h.

uint16_t rosflight_firmware::UDPBoard::remote_port_
private

Definition at line 104 of file udp_board.h.

boost::asio::ip::udp::socket rosflight_firmware::UDPBoard::socket_
private

Definition at line 112 of file udp_board.h.

bool rosflight_firmware::UDPBoard::write_in_progress_
private

Definition at line 120 of file udp_board.h.

boost::recursive_mutex rosflight_firmware::UDPBoard::write_mutex_
private

Definition at line 107 of file udp_board.h.

std::list<Buffer*> rosflight_firmware::UDPBoard::write_queue_
private

Definition at line 119 of file udp_board.h.


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


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Wed Jul 3 2019 19:59:31