Problem with programming GPS and GPRS shield to work together

Hello,
I'v recently ordered GPRS and GPS shield for my arduino UNO board.
I use them for building simple gps tracking device which would take position and send it to my web application periodically.

However, I've tested both of those shields seperately to see if they work with my arduino uno as I expected. And they really do.
I get GPS coordinates (parsed with TinyGPS) and I managed to send simple sms message to my phone with GPRS shield.

But the problem was when I combined all shields at the same time.
I believe that the problem is in my software serial baud rate. GPRS shield that I use requires 19200 baud rate while GPS works at 9600.
As I'm new to arduino I'm probably doing some stupid mistake because I've never worked with more software serials opened at same time.

So, here is my code. When I upload it to my board I'm able to receive and see gps coordinates at 9600 but I'm not able to send sms message. I hope you can tell me where the problem is and what's the best way to fix it.

Thank you very much

#include <SoftwareSerial.h>
#include <TinyGPS.h>

// Create an instance of the TinyGPS object
TinyGPS gps;

void getgps(TinyGPS &gps);


SoftwareSerial mySerial(7, 8);
void setup()
{
 mySerial.begin(19200);               // the GPRS baud rate   
 Serial.begin(9600);     
 delay(500);
}
void loop()
{
  byte a;

  if (Serial.available()) {
   a = Serial.read();
   
   if (gps.encode(a)) {
     getgps(gps);
   }
   
   if (a=='send') {
     SendTextMessage();
   }
  }

 if (mySerial.available()) {
   Serial.write(mySerial.read());
 }
}

void getgps(TinyGPS &gps) {
  long latitude, longitude;
  gps.get_position(&latitude, &longitude);
  Serial.print("Lat: ");
  Serial.println(latitude);  
  Serial.print("Lon: ");
  Serial.println(longitude);
}

void SendTextMessage()
{
 mySerial.print("AT+CMGF=1\r");    //Because we want to send the SMS in text mode
 delay(100);
 mySerial.println("AT + CMGS = \"+385xxxxxxxxx\"");//send sms message, be careful need to add a country code before the cellphone number
 delay(100);
 mySerial.println("A test message!");//the content of the message
 delay(100);
 mySerial.println((char)26);//the ASCII code of the ctrl+z is 26
 delay(100);
 mySerial.println();
}

Serial only works to one device.

If the gps and the gprs both use serial communications, then you need two actual or virtual serial interfaces to communicate with them.

You need to check whether this is possible with software serial, and then you have to worry about pin conflicts if you are stacking the boards.

if (a=='send') {

You actual problem may also be, that this is rubbish.

A character literal ( something in single quotes ), is a single character. Not four characters.

if (mySerial.available()) {
Serial.write(mySerial.read());
}

And what is this bit supposed to be doing ? If you also want to copy stuff to the serial monitor on your PC, then you need THREE actual or virtual serial interfaces.

michinyon:

if (mySerial.available()) {
Serial.write(mySerial.read());
}

And what is this bit supposed to be doing ? If you also want to copy stuff to the serial monitor on your PC, then you need THREE actual or virtual serial interfaces.

That part of code is not necessary, I forgot to remove it (I used it while testing some other stuff).

michinyon:

if (a=='send') {

You actual problem may also be, that this is rubbish.

A character literal ( something in single quotes ), is a single character. Not four characters.

Well thank you for pointing that out to me. I've never programmed in C++ before, I'm Python programmer where there is no difference between single and double quotes.

I will try to change that and let you know if that was a problem.