Skip to content

HardwareSerial and SoftwareSerial should have a common super class #4185

Open
@drmpf

Description

@drmpf

HardwareSerial and SoftwareSerial are supposed to be variations on a Serial connection, but they do not share a common superclass

Please add a superclass, 'Serial_", or some such, which contains the methods common to both HardwareSerial and SoftwareSerial.

At present libraries cannot accept HardwareSerial / SoftwareSerial objects interchangeably.

Particular use case is a library to determine the baud rate of an attached device.
Need to call multiple begin() methods with different baud rates, but have to have lots of extra code to workout if user is using HardwareSerial or SoftwareSerial for the connection.
On UNO, most likely has to use SoftwareSerial.
On Mega can/should use HardwareSerial

Metadata

Metadata

Assignees

Labels

Component: HardwareSerialThe hardware serial functionality of the core librariesfeature requestA request to make an enhancement (not a bug fix)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions