SMS command processing

Okay.

haven't got smart way of handling the telephone numbers as yet when I send them in via a text message.

  1. send in the SMS as SMS107xxxxxxxx and SMS207xxxxxxxx etc etc
  2. the system see the text come in and searchs for SMS while(1){if(mySerial.find("SMS")){
  3. then This is read to String no1 and passed to the function NumberProcessing
  4. this then based on the starts with 1,2 etc uses an if statement to process and store it in EEPROM
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();
       NumberProcess();
    }}

and

  Serial.println(no1);
  if(no1.startsWith("1")){
  Serial.print("Saving variable string to address: ");
  Serial.println(0);
  myString = no1;
  Serial.println(myString);
  myString.toCharArray(myStringChar, BUFSIZE); //convert string to char array
  strcpy(buf, myStringChar);
  eeprom_write_string((0), buf); 
  Serial.print("Reading string from address : ");
  Serial.println(0);
  eeprom_read_string((0), buf, BUFSIZE);
  Serial.println(buf);}
else{ if(no1.startsWith("2")){
  Serial.print("Saving variable string to address: ");
  Serial.println(11);
  myString = no1;
  Serial.println(myString);
  myString.toCharArray(myStringChar, BUFSIZE); //convert string to char array
  strcpy(buf, myStringChar);
  eeprom_write_string((11), buf); 
  Serial.print("Reading string from address : ");
  Serial.println(11);
  eeprom_read_string((11), buf, BUFSIZE);
  Serial.println(buf);}
 }}

There will be other messages being received to determine the strings stored, this can be processed in a similar way, but don't think its smart.

at least 2 messages for pins activated and deactivated (2 lots of data for each Pin), cant see there ever being more than 10 pins (20 messages), but with this method I could only done 9 pins.

However 1 number may be stored, or upto 9 this way, as starts with 10 would end up with the SMS1 and SMS10 being confused, as SMS107xxxxx starts 10. Can't see me ver needing 9 number in the project but its a fair point.