APM:Libraries
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
AP_SerialManager Class Reference

#include <AP_SerialManager.h>

Collaboration diagram for AP_SerialManager:
[legend]

Public Types

enum  SerialProtocol {
  SerialProtocol_None = -1, SerialProtocol_Console = 0, SerialProtocol_MAVLink = 1, SerialProtocol_MAVLink2 = 2,
  SerialProtocol_FrSky_D = 3, SerialProtocol_FrSky_SPort = 4, SerialProtocol_GPS = 5, SerialProtocol_GPS2 = 6,
  SerialProtocol_AlexMos = 7, SerialProtocol_SToRM32 = 8, SerialProtocol_Rangefinder = 9, SerialProtocol_FrSky_SPort_Passthrough = 10,
  SerialProtocol_Lidar360 = 11, SerialProtocol_Aerotenna_uLanding = 12, SerialProtocol_Beacon = 13, SerialProtocol_Volz = 14,
  SerialProtocol_Sbus1 = 15, SerialProtocol_ESCTelemetry = 16, SerialProtocol_Devo_Telem = 17
}
 

Public Member Functions

 AP_SerialManager ()
 
 AP_SerialManager (const AP_SerialManager &other)=delete
 
AP_SerialManageroperator= (const AP_SerialManager &)=delete
 
void init_console ()
 
void init ()
 
AP_HAL::UARTDriverfind_serial (enum SerialProtocol protocol, uint8_t instance) const
 
uint32_t find_baudrate (enum SerialProtocol protocol, uint8_t instance) const
 
bool get_mavlink_channel (enum SerialProtocol protocol, uint8_t instance, mavlink_channel_t &mav_chan) const
 
SerialProtocol get_mavlink_protocol (mavlink_channel_t mav_chan) const
 
void set_blocking_writes_all (bool blocking)
 
void set_console_baud (enum SerialProtocol protocol, uint8_t instance) const
 

Static Public Member Functions

static AP_SerialManagerget_instance (void)
 

Static Public Attributes

static const struct AP_Param::GroupInfo var_info []
 

Private Member Functions

uint32_t map_baudrate (int32_t rate) const
 
bool protocol_match (enum SerialProtocol protocol1, enum SerialProtocol protocol2) const
 

Private Attributes

struct {
   AP_Int8   protocol
 
   AP_Int32   baud
 
   AP_HAL::UARTDriver *   uart
 
state [SERIALMANAGER_NUM_PORTS]
 

Static Private Attributes

static AP_SerialManager_instance
 

Detailed Description

Definition at line 75 of file AP_SerialManager.h.

Member Enumeration Documentation

◆ SerialProtocol

Enumerator
SerialProtocol_None 
SerialProtocol_Console 
SerialProtocol_MAVLink 
SerialProtocol_MAVLink2 
SerialProtocol_FrSky_D 
SerialProtocol_FrSky_SPort 
SerialProtocol_GPS 
SerialProtocol_GPS2 
SerialProtocol_AlexMos 
SerialProtocol_SToRM32 
SerialProtocol_Rangefinder 
SerialProtocol_FrSky_SPort_Passthrough 
SerialProtocol_Lidar360 
SerialProtocol_Aerotenna_uLanding 
SerialProtocol_Beacon 
SerialProtocol_Volz 
SerialProtocol_Sbus1 
SerialProtocol_ESCTelemetry 
SerialProtocol_Devo_Telem 

Definition at line 83 of file AP_SerialManager.h.

Constructor & Destructor Documentation

◆ AP_SerialManager() [1/2]

AP_SerialManager::AP_SerialManager ( )

Definition at line 139 of file AP_SerialManager.cpp.

Here is the call graph for this function:

◆ AP_SerialManager() [2/2]

AP_SerialManager::AP_SerialManager ( const AP_SerialManager other)
delete

Member Function Documentation

◆ find_baudrate()

uint32_t AP_SerialManager::find_baudrate ( enum SerialProtocol  protocol,
uint8_t  instance 
) const

◆ find_serial()

AP_HAL::UARTDriver * AP_SerialManager::find_serial ( enum SerialProtocol  protocol,
uint8_t  instance 
) const

Definition at line 261 of file AP_SerialManager.cpp.

Referenced by AP_Beacon_Marvelmind::AP_Beacon_Marvelmind(), AP_Beacon_Pozyx::AP_Beacon_Pozyx(), AP_Proximity_LightWareSF40C::AP_Proximity_LightWareSF40C(), AP_Proximity_RPLidarA2::AP_Proximity_RPLidarA2(), AP_Proximity_TeraRangerTower::AP_Proximity_TeraRangerTower(), AP_RangeFinder_Benewake::AP_RangeFinder_Benewake(), AP_RangeFinder_LeddarOne::AP_RangeFinder_LeddarOne(), AP_RangeFinder_LightWareSerial::AP_RangeFinder_LightWareSerial(), AP_RangeFinder_MaxsonarSerialLV::AP_RangeFinder_MaxsonarSerialLV(), AP_RangeFinder_NMEA::AP_RangeFinder_NMEA(), AP_RangeFinder_uLanding::AP_RangeFinder_uLanding(), AP_RangeFinder_Wasp::AP_RangeFinder_Wasp(), AP_Proximity_LightWareSF40C::detect(), AP_RangeFinder_LightWareSerial::detect(), AP_RangeFinder_MaxsonarSerialLV::detect(), AP_RangeFinder_uLanding::detect(), AP_Proximity_TeraRangerTower::detect(), AP_RangeFinder_Wasp::detect(), AP_RangeFinder_Benewake::detect(), AP_RangeFinder_NMEA::detect(), AP_Proximity_RPLidarA2::detect(), AP_RangeFinder_LeddarOne::detect(), get_instance(), AP_Mount_SToRM32_serial::init(), AP_SBusOut::init(), AP_DEVO_Telem::init(), AP_Volz_Protocol::init(), AP_Mount_Alexmos::init(), AP_Frsky_Telem::init(), AP_GPS::init(), and GCS_MAVLINK::setup_uart().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_instance()

static AP_SerialManager* AP_SerialManager::get_instance ( void  )
inlinestatic

Definition at line 106 of file AP_SerialManager.h.

Referenced by AP_SBusOut::init(), and AP::serialmanager().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_mavlink_channel()

bool AP_SerialManager::get_mavlink_channel ( enum SerialProtocol  protocol,
uint8_t  instance,
mavlink_channel_t &  mav_chan 
) const

Definition at line 303 of file AP_SerialManager.cpp.

Referenced by get_instance(), and GCS_MAVLINK::setup_uart().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_mavlink_protocol()

AP_SerialManager::SerialProtocol AP_SerialManager::get_mavlink_protocol ( mavlink_channel_t  mav_chan) const

Definition at line 319 of file AP_SerialManager.cpp.

Referenced by get_instance(), GCS_MAVLINK::packetReceived(), and GCS_MAVLINK::setup_uart().

Here is the caller graph for this function:

◆ init()

void AP_SerialManager::init ( void  )

Definition at line 159 of file AP_SerialManager.cpp.

Referenced by get_instance(), and setup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_console()

void AP_SerialManager::init_console ( )

Definition at line 147 of file AP_SerialManager.cpp.

Referenced by get_instance(), and init().

Here is the caller graph for this function:

◆ map_baudrate()

uint32_t AP_SerialManager::map_baudrate ( int32_t  rate) const
private

Definition at line 368 of file AP_SerialManager.cpp.

Referenced by find_baudrate(), init(), and set_console_baud().

Here is the caller graph for this function:

◆ operator=()

AP_SerialManager& AP_SerialManager::operator= ( const AP_SerialManager )
delete

◆ protocol_match()

bool AP_SerialManager::protocol_match ( enum SerialProtocol  protocol1,
enum SerialProtocol  protocol2 
) const
private

Definition at line 402 of file AP_SerialManager.cpp.

Referenced by find_baudrate(), find_serial(), get_mavlink_channel(), and set_console_baud().

Here is the caller graph for this function:

◆ set_blocking_writes_all()

void AP_SerialManager::set_blocking_writes_all ( bool  blocking)

Definition at line 336 of file AP_SerialManager.cpp.

Referenced by get_instance().

Here is the caller graph for this function:

◆ set_console_baud()

void AP_SerialManager::set_console_baud ( enum SerialProtocol  protocol,
uint8_t  instance 
) const

Definition at line 347 of file AP_SerialManager.cpp.

Referenced by get_instance().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _instance

AP_SerialManager * AP_SerialManager::_instance
staticprivate

Definition at line 145 of file AP_SerialManager.h.

Referenced by AP_SerialManager(), and get_instance().

◆ baud

AP_Int32 AP_SerialManager::baud

Definition at line 150 of file AP_SerialManager.h.

Referenced by find_baudrate(), init(), and set_console_baud().

◆ protocol

AP_Int8 AP_SerialManager::protocol

Definition at line 149 of file AP_SerialManager.h.

Referenced by get_instance(), get_mavlink_protocol(), and init().

◆ state

struct { ... } AP_SerialManager::state[SERIALMANAGER_NUM_PORTS]

◆ uart

AP_HAL::UARTDriver* AP_SerialManager::uart

Definition at line 151 of file AP_SerialManager.h.

Referenced by init(), and set_blocking_writes_all().

◆ var_info

const AP_Param::GroupInfo AP_SerialManager::var_info
static

Definition at line 142 of file AP_SerialManager.h.

Referenced by AP_SerialManager(), and setup().


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