This might be a silly question but I have forgotten my C/C++ classes a long time ago. I am trying to create a library for my GPRS shield and I want to include the SoftwareSerial object inside the new object I will be creating. The header file would include I presume the declaration of the class member:
class SMS
{
public:
SMS();
void begin();
SoftwareSerial smsSerial;
private:
}
The constructor for SoftwareSerial have to be passed the RX and TX pins. And I want these to be parameters of a function, maybe begin:
SMS::SMS()
{
smsFlags = B00000000;
}
void SMS::begin(int rxPin, int txPin)
{
smsSerial = new SoftwareSerial(rxPin,txPin); //<---- Is this what I'm supposed to do?
}
Not sure if I should use "new" or not.