Goal: Send error sms if unknown command is received
My device can accept 4 commands via SMS. The sms body is stored in _4G._buffer.
- Relay1 On
- Relay1 Off
- Relay2 On
- Relay2 Off
Using strcmp, if the text message contains any of those, I activate a digital input.
.
** ** if (strcmp(_4G._buffer, "Relay2 on") == 0 ) { digitalWrite(relay2, LOW); } else {}** **
I am now looking to implement a feature that will send a text message saying command not recognized if anything besides the commands above are received.
I try:
** **if (strcmp(_4G._buffer, "Relay1 on" | "Relay1 off" | "Relay2 on" | "Relay2 off") == 0) //if sms says any of these proper commands { //do nothing, as other lines of code will open/close the valve } else { smsSend("Command not reconized"); // send error SMS }** **
And get this compile error:
exit status 1
invalid operands of types 'const char [10]' and 'const char [11]' to binary 'operator|'
I am unsure where I am making the mistake. Any help would be greatly appreciated.
Thanks