I have been searching all over the net trying to find some example code to see how to listen for sms and read it. I am new to at commands so I am trying to see some examples. My intentions is to listen for sms and read to content. If the message contained the word: forward, I want it to run a function. Any ideas or sample code? I am using the Seeedstudio gprs shield 1.0
Okay I found a library but I do not know how to use it. The library is found here: GitHub - Seeed-Studio/Seeeduino_GPRS: Seeeduino GPRS Library
Here is my current code:
/*
GPRS Connect TCP
This sketch is used to test seeeduino GPRS's send SMS func.
to make it work, you should insert SIM card to Seeeduino GPRS
and replace the phoneNumber,enjoy it!
create on 2013/12/5, version: 0.1
by lawliet.zou(lawliet.zou@gmail.com)
*/
#include <gprs.h>
#include <SoftwareSerial.h>
GPRS gprsTest(8,7,9,9600,"1818XXXXXXXXX");//TX,RX,PWR,BaudRate,PhoneNumber
void setup() {
Serial.begin(9600);
gprsTest.preInit();
delay(1000);
while(0 != gprsTest.init()) {
delay(1000);
Serial.print("init error\r\n");
}
}
void loop() {
//nothing to do
gprsTest.readSMS();
}
My problem is I am not sure of what to put in the parameters for the readSMS function.
In the header file it is
int readSMS(int messageIndex, char *message, int length);
Also am I going to need to delete the messages after words?