mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-08 21:11:35 +08:00
Added getPort back in to Serial interface. Only setPort needed to be removed
This commit is contained in:
@@ -325,24 +325,6 @@ const char *SerialImpl::getPort() const
|
||||
return _port;
|
||||
}
|
||||
|
||||
bool SerialImpl::setPort(const char *port)
|
||||
{
|
||||
if (strcmp(port, _port) == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
strncpy(_port, port, sizeof(_port) - 1);
|
||||
_port[sizeof(_port) - 1] = '\0';
|
||||
|
||||
// If old port is already opened then close it and reopen it on new port
|
||||
if (_open) {
|
||||
close();
|
||||
return open();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32_t SerialImpl::getBaudrate() const
|
||||
{
|
||||
return _baudrate;
|
||||
|
||||
Reference in New Issue
Block a user