trouble with class (GSM library)

I am trying to use this GSM library for a GSM module (Siemens), although the library was developed for Telit modules, I think this is not a problem, beacuse both use AT commands.

Library = 404 Error

After importing the library I try to compile the examples. Both example, SMS and GPRS, return the same error when compiling.

Error = Serial3 was not declared in this scope.

Code follows (beginning of the SMS example from the library):
#include <gsmSMS.h> //You just need to import the gsmSMS.h file if you are just doing SMS message

//PIN DEFS****
#define turnOnPin 40 //used to turn on off Telit
//**************************

//FUNC DEFS*****

bool readDeleteMessages(); // Used to read any received messages and then deletes them
bool checkNetworkSendMessage(); // Used to check if your on the network and then sends SMS
void talkReply(); // Used to send commands directly to the Telit and trigger the above functions

//**************************

//make a object of Gsm class************
/First you have to make the gsmSMS object, the arguments are in order
GsmSMS (#1 Name of the serial port connected to GSM (your choice),#2 the address of millis function(just copy whats there) )/
gsmSMS myGsmSMS(Serial3,&millis,&Serial); //gsmSMS TELIT SMS
//
*****************************************************

void setup(){
Serial.begin(9600); // used for debugging
**Serial3.begin(9600); ** // used for talking to telit
Serial.println("hello"); // say hello to check serial line
.....

And here is the class in the file (library) gsmSMS.h

class gsmSMS : virtual public GSMbase
{

//FULL FUNC DESCRIPTION IN SOURCE\

private:
char* messageList;
public:
gsmSMS(Serial&, uint32_t(FP)(), Serial = NULL);
inline const char* const getMessageList(){return messageList;}
////////////////////////////INIT FUNC
virtual bool init(uint16_t); //INITS, CALLS BASE INIT
bool smsInit(); //called in init, for derived class
////////////////////////////SEND FUNC
bool sendNoSaveCMGS(const char*,const char*); //Send message no save
const char* const saveMessageCMGW(const char*,const char*); //Send to memory
bool sendSavedMessageCMSS(const char * const); //Send from memory
///////////////////////////LIST MESSAGE FUNC
const char* const getNumMesInMemCPMS(uint16_t); //Gets # mes
const char* const checkCMGDList(); //Gets a # list of all avail mes
///////////////////////////READ FUNCS
const char* const readMessageCMGR(const char* const); //Reads specified mes
const char* const readAllCMGL(const char* const, uint16_t _dataSize=300); //Reads all mes of type
///////////////////////////DELETE FUNCS
bool deletMessagesCMGD(const char* const); //Deletes mes

////OPTIONAL SEE BELOW************
//const char* const checkCSCA();
//bool setCSCA(const char* theNumber);
//****************************************

};

any help... why Serial3 is not defined?

Thanks in advance.

I suspect that code was written for an Arduino Mega (which has 4 hardware serial ports) and you are compiling it for a Uno or similar.

dc42:
I suspect that code was written for an Arduino Mega (which has 4 hardware serial ports) and you are compiling it for a Uno or similar.

Good point

I have just changed the board to Mega and now the error is:

no matching fucntion for call 'gsmSMS::gsmSMS(HardwareSerial&, long unsigned int ()(), HardwareSerial)'

Take a look in your copy of file gsmbase.h. Does it have the following around lines 39-42:

//typedef SerialPort Serial;      // change here to support your serial friend
				// Serial needs a read, write, flush, available functions  
typedef HardwareSerial Serial;      // change here to support your serial friend
				// Serial needs a read, write, flush, available functions

Thanks for your help. This is what I have:

class GSMbase{

protected:
//typedef SerialPort Serial; // change here to support your serial friend
// Serial needs a read, write, flush, available functions
typedef HardwareSerial Serial; // change here to support your serial friend
// Serial needs a read, write, flush, available functions

is that correct?

Yes, that's correct. Are you using Arduino 1.0? If so, I suggest changing the line "#include <WProgram.h>" in gsmbase.h to "#include <Arduino.h>".

Works... thank you.

Now I have to adapt it to Arduino Uno or nano....

probably I have to delete all the references to USB port communication...

hi

What code change you have done to make the code for arduino uno.