APM:Libraries
|
#include <AP_SerialManager.h>
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_SerialManager & | operator= (const AP_SerialManager &)=delete |
void | init_console () |
void | init () |
AP_HAL::UARTDriver * | find_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_SerialManager * | get_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 |
Definition at line 75 of file AP_SerialManager.h.
Definition at line 83 of file AP_SerialManager.h.
AP_SerialManager::AP_SerialManager | ( | ) |
|
delete |
uint32_t AP_SerialManager::find_baudrate | ( | enum SerialProtocol | protocol, |
uint8_t | instance | ||
) | const |
Definition at line 282 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(), get_instance(), and GCS_MAVLINK::setup_uart().
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().
|
inlinestatic |
Definition at line 106 of file AP_SerialManager.h.
Referenced by AP_SBusOut::init(), and AP::serialmanager().
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().
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().
void AP_SerialManager::init | ( | void | ) |
Definition at line 159 of file AP_SerialManager.cpp.
Referenced by get_instance(), and setup().
void AP_SerialManager::init_console | ( | ) |
Definition at line 147 of file AP_SerialManager.cpp.
Referenced by get_instance(), and init().
|
private |
Definition at line 368 of file AP_SerialManager.cpp.
Referenced by find_baudrate(), init(), and set_console_baud().
|
delete |
|
private |
Definition at line 402 of file AP_SerialManager.cpp.
Referenced by find_baudrate(), find_serial(), get_mavlink_channel(), and set_console_baud().
void AP_SerialManager::set_blocking_writes_all | ( | bool | blocking | ) |
Definition at line 336 of file AP_SerialManager.cpp.
Referenced by get_instance().
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().
|
staticprivate |
Definition at line 145 of file AP_SerialManager.h.
Referenced by AP_SerialManager(), and get_instance().
AP_Int32 AP_SerialManager::baud |
Definition at line 150 of file AP_SerialManager.h.
Referenced by find_baudrate(), init(), and set_console_baud().
AP_Int8 AP_SerialManager::protocol |
Definition at line 149 of file AP_SerialManager.h.
Referenced by get_instance(), get_mavlink_protocol(), and init().
struct { ... } AP_SerialManager::state[SERIALMANAGER_NUM_PORTS] |
Referenced by find_baudrate(), find_serial(), get_mavlink_protocol(), init(), init_console(), set_blocking_writes_all(), and set_console_baud().
AP_HAL::UARTDriver* AP_SerialManager::uart |
Definition at line 151 of file AP_SerialManager.h.
Referenced by init(), and set_blocking_writes_all().
|
static |
Definition at line 142 of file AP_SerialManager.h.
Referenced by AP_SerialManager(), and setup().