Util.cpp
bool Util::compareSenderWithAdmin(char *adminPhone) {
#if DEBUG
  Serial.print(F(" Start compare with admin phone: "));
#endif
  while (modem->read() != ',')delay(1);
  modem->read(); // read first '"' char
  uint8_t i = 0;
  char ch;
  while (modem->available() > 0 && i < 12) {
    ch = modem->read();
#if DEBUG
    Serial.write(ch);
#endif
    if ( adminPhone[i] != ch) return false;
    i++;
  }
  // drop chars while not end string
  while (modem->available() > 0 && modem->read() != '\n')delay(1);
  return true;
}
/*
  get sender number from sms adn call function for compare
  with admin number and read all symbols to new line symbols(include)
  return success if equals
*/
get sender number from sms adn call function for compare
with admin number and read all symbols to new line symbols(include)
return success if equals
get sender number from sms adn call function for compare with admin number and read all symbols to new line symbols ( include ) return success if equals
bool Util::compareSenderWithAdmin(char *adminPhone) {
#if DEBUG
  Serial.print(F(" Start compare with admin phone: "));
#endif
  while (modem->read() != ',')delay(1);
  modem->read(); 
  uint8_t i = 0;
  char ch;
  while (modem->available() > 0 && i < 12) {
    ch = modem->read();
#if DEBUG
    Serial.write(ch);
#endif
    if ( adminPhone[i] != ch) return false;
    i++;
  }
  while (modem->available() > 0 && modem->read() != '\n')delay(1);
  return true;
}
bool Util :: compareSenderWithAdmin ( char * adminPhone ) { #if DEBUG Serial . print ( F ( " " ) ) ; #endif while ( modem -> read ( ) != ' ' ) delay ( 1 ) ; modem -> read ( ) ; uint8_t i = 0 ; char ch ; while ( modem -> available ( ) > 0 && i < 12 ) { ch = modem -> read ( ) ; #if DEBUG Serial . write ( ch ) ; #endif if ( adminPhone [ i ] != ch ) return false ; i ++ ; } while ( modem -> available ( ) > 0 && modem -> read ( ) != ' \n ' ) delay ( 1 ) ; return true ; }
get sender number from sms adn call function for compare
with admin number and read all symbols to new line symbols(include)
return success if equals
get sender number from sms adn call function for compare with admin number and read all symbols to new line symbols ( include ) return success if equals
// read first '"' char // drop chars while not end string