Hello All,
I'm trying to create a generic class that handles Serial Communications. I would like to add SoftwareSerial as a member to this class. So, in my Sample.h file I have the following declaration.
#include <SoftwareSerial.h>
class SomeClass
{
public:
SomeClass(SoftwareSerial serial);
public:
SoftwareSerial serial;
};
However, I cannot add SoftwareSerial as a data member. Can you please help me as I would like to use this as a property.
The other thought I've had is perhaps deriving a class by
class SomeClass : public SoftwareSerial
{
public:
SomeClass(SoftwareSerial serial);
};
But don't think this is an elegant solution. This doesn't work either.
Can someone help me out please?
Thanks in advance,
Richard