How can I listen two port while they have not been initiate at the same place

Dear Sir or Madam,

I am trying to make working a small GPS and GPRS/GSM module.

In my Arduino software, I created a file and I initiate the GPS communication through pin 6 and 7

 #define GPSTX 6 //(connect to RX of other device)
 #define GPSRX 7 //(connect to TX of other device) 
 
 SoftwareSerial uart_gps(GPSTX, GPSRX); //Create a fake serial port 0 and 1

I also found a library and that library is inlcude in to my ino file

#include "inetGSM.h"

I also can find this, in inetGSM.h

class GSM
{
  public:
    enum GSM_st_e { ERROR, IDLE, READY, ATTACHED, TCPSERVERWAIT, TCPCONNECTEDSERVER, TCPCONNECTEDCLIENT };
    byte comm_buf[COMM_BUF_LEN+1];  // communication buffer +1 for 0x00 termination
    void InitParam (byte group);
    #ifdef UNO
		SoftwareSerial _cell;
	#endif

and this,

#ifdef UNO
GSM::GSM():_cell(_GSM_RXPIN_,_GSM_TXPIN_),_tf(_cell, 10),_status(IDLE){
};

Listen()
In order to use two serial port, I have to listem uart_GPS.listen(), and them _cell.listen();

The problem, _cell.listen() return me a error, because he can not find _cell in it scope.
I tryed GSM::_cell.listen(), but it does not work.

Do you have an idea how can I run a listing function, while it has not bee initiated in a ino file?

Many thank for your help

Cheers

Post your whole program otherwise it will be impossible to help.

Ok, but it really a lot.

http://www.hello-web.net/temp/code.html

My wories are in bold/red and serach for _cell

But in order word, is how to access _cell, isn't?

class GSM
{
  public:
    enum GSM_st_e { ERROR, IDLE, READY, ATTACHED, TCPSERVERWAIT, TCPCONNECTEDSERVER, TCPCONNECTEDCLIENT };
    byte comm_buf[COMM_BUF_LEN+1];  // communication buffer +1 for 0x00 termination
    void InitParam (byte group);
    #ifdef UNO
		SoftwareSerial _cell;
	#endif
#ifdef UNO
GSM::GSM():_cell(_GSM_RXPIN_,_GSM_TXPIN_),_tf(_cell, 10),_status(IDLE){
};

I hope you can help

Many thank

Use the lib or SoftwareSerial but not both!

Mark

Use the lib or SoftwareSerial but not both!

You MIGHT be able to use both. But, not if all you post is snippets. Post ALL of your code is you really want help.