Data type comparison

ivars88:

char ON[3] = "On";      //char variable to compare received sms, including NULL character

char OFF[4] = "Off";  //char variable to compare received sms, including NULL character

You mean

const char * ON = "On" ;
const char * OFF = "Off" ;

That way you won't be creating 2 copies of each string I think - the string constant and
the array initialised from it.