Hello,
I'm a french student in electronic and i have a problem with my arduino code. I'm trying to read a sms with arduino. I have a SIM900 from Efcom. I used this library GitHub - per/gsmshield: Arduino library for EFCom GPRS/GSM Shield
Here my code :
#include "SIM900.h"
#include "sms.h"
#include "GSM.h"
#include <SoftwareSerial.h>
int numdata;
boolean started=false; // flag started false
char smsbuffer[160];
char n[20];
SMSGSM sms;
void setup()
{
//Init of serial port
Serial.begin(9600);
Serial.println("Test du shield GSM...");
//Config GSM
if (gsm.begin(2400))
{
Serial.println("ETAT=READY");
started=true; // get flag true => shield ready
}
else Serial.println("ETAT=IDLE");
//-------------- SEND A SMS -------------------------------
if(started)
{
if (sms.SendSMS("+336*******0", "Arduino test "))
Serial.println("SMS sent");
}
}
void loop()
{
GSM gsm;
if(started)
{
char pos ;
char phone_num[20]; // array for the phone number string
char sms_text[100];
pos = sms.IsSMSPresent(SMS_UNREAD);
if (pos) {
// read new SMS
gsm.GetSMS(pos, phone_num, sms_text, 100);
// now we have phone number string in phone_num
Serial.println(phone_num);
// and SMS text in sms_text
Serial.println(sms_text);
}
}
}
And my problem because of this line : gsm.GetSMS(pos, phone_num, sms_text, 100);
I get this error : 'class GSM' has no member named 'GetSMS' and i do not know why. Someone could help me ??
Many thanks !