AP_SerialManager: add support for fetching serial port by id
This commit is contained in:
parent
32a71cef92
commit
3a46fb59e5
@ -437,6 +437,15 @@ AP_SerialManager::SerialProtocol AP_SerialManager::get_mavlink_protocol(mavlink_
|
||||
return SerialProtocol_None;
|
||||
}
|
||||
|
||||
// get_serial_by_id - gets serial by serial id
|
||||
AP_HAL::UARTDriver *AP_SerialManager::get_serial_by_id(uint8_t id)
|
||||
{
|
||||
if (id < SERIALMANAGER_NUM_PORTS) {
|
||||
return state[id].uart;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// set_blocking_writes_all - sets block_writes on or off for all serial channels
|
||||
void AP_SerialManager::set_blocking_writes_all(bool blocking)
|
||||
{
|
||||
|
@ -146,7 +146,10 @@ public:
|
||||
|
||||
// disable passthru by settings SERIAL_PASS2 to -1
|
||||
void disable_passthru(void);
|
||||
|
||||
|
||||
// get Serial Port
|
||||
AP_HAL::UARTDriver *get_serial_by_id(uint8_t id);
|
||||
|
||||
// parameter var table
|
||||
static const struct AP_Param::GroupInfo var_info[];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user