opened 01:14PM - 10 Aug 20 UTC
closed 03:22PM - 20 Oct 21 UTC
type: bug
component: core
priority: untriaged
<!--
************************************** WARNING **********************…****************
The ciarcom bot parses this header automatically. Any deviation from the
template may cause the bot to automatically correct this header or may result in a
warning message, requesting updates.
Please ensure all sections of the template below are filled in and no changes
are made to the template format. Only bugs should be raised here as issues.
Questions or enhancements should instead be raised on our forums:
https://forums.mbed.com/ .
*************************************************************************************
-->
### Description of defect
From the forum:
Why does the new Mbed OS 6.x BufferedSerial use the set_baud and set_format methods when UnbufferedSerial uses the baud and format methods? Since they do the same things with the same arguments, shouldn’t they be named the same?
Looking further it appears that BufferedSerial has it's own direct methods:
```
set_baud(int baud)
set_format(int bits=8, Parity parity=BufferedSerial::None, int stop_bits=1)
```
Whereas UnbufferedSerial has:
```
using SerialBase::format;
using SerialBase::attach;
using SerialBase::baud;
```
where SerialBase has
```
public:
/** Set the baud rate of the serial port
*
* @param baudrate The baudrate of the serial port (default = 9600).
*/
void baud(int baudrate);
/** Set the transmission format used by the serial port
*
* @param bits The number of bits in a word (5-8; default = 8)
* @param parity The parity used (SerialBase::None, SerialBase::Odd, SerialBase::Even, SerialBase::Forced1, SerialBase::Forced0; default = SerialBase::None)
* @param stop_bits The number of stop bits (1 or 2; default = 1)
*/
void format(int bits = 8, Parity parity = SerialBase::None, int stop_bits = 1);
```
So this does indeed appear inconsistent.
#### Target(s) affected by this defect ?
All
#### Toolchain(s) (name and version) displaying this defect ?
n/a
#### What version of Mbed-os are you using (tag or sha) ?
<!--
For a released version please provide the release tag (this can be found as per the instructions below)
mbed-os version can be found in /platform/mbed_version.h. The tag can be reconstructed as follows:
mbed-os-MBED_MAJOR_VERSION.MBED_MINOR_VERSION.MBED_PATCH_VERSION
Master branch is indicated by 'mbed-os-99.99.99
For an issue found on Master please provide the sha being used.
-->
mbed-os-6.2.0
#### What version(s) of tools are you using. List all that apply (E.g. mbed-cli)
n/a
#### How is this defect reproduced ?
n/a