HardwareSerial and SoftwareSerial should have a common super class #4185
Labels
Component: HardwareSerial
The hardware serial functionality of the core libraries
feature request
A request to make an enhancement (not a bug fix)
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
The text was updated successfully, but these errors were encountered: