Motivation was to use BluetoothSerial based GPS module and it's not good way to support "BTSerial" class. But since in arduino most of those classes are based on "Stream" class. This chage will add support not only to Bluetooth Serial, but should add also for network based sockets (tcp/udp streams) and other classes which are based on Stream class.
Maybe consider remove SW/HW serial too and make it as stream too. But there should be somehow kept function ->begin() which HW/SW Serial has.
Since I do not have any HWSerial based GPS here I can not test if this PR not break HardwareSerial constructor as it's also based on Stream. But I guess it should take most exact class and then go to parent ones.
Added support for generic Stream class.
Motivation was to use BluetoothSerial based GPS module and it's not good way to support "BTSerial" class. But since in arduino most of those classes are based on "Stream" class. This chage will add support not only to Bluetooth Serial, but should add also for network based sockets (tcp/udp streams) and other classes which are based on Stream class.
Maybe consider remove SW/HW serial too and make it as stream too. But there should be somehow kept function ->begin() which HW/SW Serial has.
Since I do not have any HWSerial based GPS here I can not test if this PR not break HardwareSerial constructor as it's also based on Stream. But I guess it should take most exact class and then go to parent ones.