Changed the default baudrate handling around a little to make it cleaner

This commit is contained in:
Eric Katzfey
2023-07-19 17:21:59 -07:00
parent 2dbae8488e
commit 9accf81299
3 changed files with 29 additions and 20 deletions
+4 -8
View File
@@ -7,14 +7,10 @@ Serial::Serial(const char *port, uint32_t baudrate, ByteSize bytesize, Parity pa
FlowControl flowcontrol) :
_impl(port, baudrate, bytesize, parity, stopbits, flowcontrol)
{
// TODO: Device
// set_device_bus_type(device::Device::DeviceBusType::DeviceBusType_SERIAL);
// char c = _port[strlen(_port) - 1]; // last digit of path (eg /dev/ttyS2)
// set_device_bus(c - 48); // sub 48 to convert char to integer
// If no baudrate was specified then set it to a reasonable default value
if (baudrate == 0) {
(void) _impl.setBaudrate(9600);
}
}
Serial::~Serial()