#include <SoftwareSerial.h>
SoftwareSerial gprsSerial(7, 8);

char incoming_char=0;
String command;
void setup()
{
Serial.begin(19200); // for serial monitor
gprsSerial.begin(19200); // for GSM shield
//gprsSerialpower(); // turn on shield
delay(20000); // give time to log on to network.

gprsSerial.print("AT+CMGF=1\r"); // set SMS mode to text
delay(100);
gprsSerial.print("AT+CNMI=2,2,0,0,0\r");
// blurt out contents of new SMS upon receipt to the GSM shield's serial out
delay(100);
}

void gprsSerialpower()
// software equivalent of pressing the GSM shield "power" button
{
digitalWrite(9, HIGH);
delay(1000);
digitalWrite(9, LOW);
delay(7000);
}

void loop()
{
// Now we simply display any text that the GSM shield sends out on the serial monitor
if(gprsSerial.available() >0)
{
incoming_char=gprsSerial.read(); //Get the character from the cellular serial port.
Serial.print(incoming_char); //Print the incoming character to the terminal.
 command=gprsSerial.readString();
  if (command == "test")
  {
    Serial.println("Hi Chris");
    
  }
}
}
