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


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 void backup_memory_clear (size_t len)=0
virtual void backup_memory_init ()=0
virtual bool backup_memory_read (void *dest, size_t len)=0
virtual void backup_memory_write (const void *src, size_t len)=0
virtual bool baro_present ()=0
virtual void baro_read (float *pressure, float *temperature)=0
virtual void baro_update ()=0
virtual bool battery_current_present () const =0
virtual float battery_current_read () const =0
virtual void battery_current_set_multiplier (double multiplier)=0
virtual bool battery_voltage_present () const =0
virtual float battery_voltage_read () const =0
virtual void battery_voltage_set_multiplier (double multiplier)=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 GNSSFull gnss_full_read ()=0
virtual bool gnss_has_new_data ()=0
virtual bool gnss_present ()=0
virtual GNSSData gnss_read ()=0
virtual void gnss_update ()=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 51 of file udp_board.h.

Member Typedef Documentation

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

Definition at line 91 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 44 of file udp_board.cpp.

rosflight_firmware::UDPBoard::~UDPBoard ( )

Definition at line 55 of file udp_board.cpp.

Member Function Documentation

void rosflight_firmware::UDPBoard::async_read ( )

Definition at line 137 of file udp_board.cpp.

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

Definition at line 148 of file udp_board.cpp.

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

Definition at line 158 of file udp_board.cpp.

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

Definition at line 174 of file udp_board.cpp.

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

Implements rosflight_firmware::Board.

Definition at line 113 of file udp_board.cpp.

void rosflight_firmware::UDPBoard::serial_flush ( )

Implements rosflight_firmware::Board.

Definition at line 99 of file udp_board.cpp.

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

Implements rosflight_firmware::Board.

Definition at line 75 of file udp_board.cpp.

uint8_t rosflight_firmware::UDPBoard::serial_read ( void  )

Implements rosflight_firmware::Board.

Definition at line 119 of file udp_board.cpp.

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

Implements rosflight_firmware::Board.

Definition at line 101 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 67 of file udp_board.cpp.

Member Data Documentation

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

Definition at line 112 of file udp_board.h.

std::string rosflight_firmware::UDPBoard::bind_host_

Definition at line 99 of file udp_board.h.

uint16_t rosflight_firmware::UDPBoard::bind_port_

Definition at line 100 of file udp_board.h.

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

Definition at line 109 of file udp_board.h.

boost::thread rosflight_firmware::UDPBoard::io_thread_

Definition at line 105 of file udp_board.h.

uint8_t rosflight_firmware::UDPBoard::read_buffer_[MAVLINK_MAX_PACKET_LEN]

Definition at line 115 of file udp_board.h.

boost::recursive_mutex rosflight_firmware::UDPBoard::read_mutex_

Definition at line 107 of file udp_board.h.

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

Definition at line 116 of file udp_board.h.

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

Definition at line 113 of file udp_board.h.

std::string rosflight_firmware::UDPBoard::remote_host_

Definition at line 102 of file udp_board.h.

uint16_t rosflight_firmware::UDPBoard::remote_port_

Definition at line 103 of file udp_board.h.

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

Definition at line 111 of file udp_board.h.

bool rosflight_firmware::UDPBoard::write_in_progress_

Definition at line 119 of file udp_board.h.

boost::recursive_mutex rosflight_firmware::UDPBoard::write_mutex_

Definition at line 106 of file udp_board.h.

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

Definition at line 118 of file udp_board.h.

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

Author(s): Daniel Koch , James Jackson
autogenerated on Thu Apr 15 2021 05:07:58