Added getPort back in to Serial interface. Only setPort needed to be removed

This commit is contained in:
Eric Katzfey
2023-07-20 13:21:27 -07:00
parent 884763b577
commit 9c5b1477d4
4 changed files with 7 additions and 19 deletions
@@ -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;