Okay, struggling a little.
after getting to grips with using serial and being able to submit Telelphone numbers in the format
SMS1, SMS2 etc and saving to EEPROM I am able to do this for as many as I can store.
however, I now want to send an SMS command read the number and store it.
Currently I can read the SMS command that's sent in and store it to the same address allocation, whether be number for SMS1 or SMS2, SMS etc etc
command gets sents as SMS107xxxxxxxxx
we find SMS and the process it
I could if out each scenario,
ie
if(mySerial.find("SMS1")){
and
if(mySerial.find("SMS1")){
etc
but must be a smarter way?
as you can see, want to use i to provide the int to calculate where to store the data, although it will be i-1, if I take the value 1 from the SMS1, 2 if SMS2 etc
current code for the recieved message processing is:-
void RecieveMessage(){
mySerial.println("AT+CMGF=1\r");
mySerial.println("AT+CNMI=2,2,0,0,0\r"); // AT Command to recieve a live SMS
while(1){if(mySerial.find("SMS")){
no1 = mySerial.readString();
Serial.println(no1);
Serial.print("Saving variable string to address: ");
Serial.println(i*11);
myString = no1.substring(1);
Serial.println(myString);
myString.toCharArray(myStringChar, BUFSIZE); //convert string to char array
strcpy(buf, myStringChar);
eeprom_write_string((i*11), buf);
Serial.print("Reading string from address : ");
Serial.println(i*11);
eeprom_read_string((i*11), buf, BUFSIZE);
Serial.println(buf);
}}
Any guidance apprciated even if it is to look up a tutorial or reference material so i can try and understand.