You are trying to compare a single character to an array of them (a string). You will need a more sophisticated method for reading chars into an array try searching for SOP or start of packet in the forums to find an example.
Alternatively, make your sketch respond to commands that are a single character, like this:
#define SOP '<'
#define EOP '>'
bool started = false;
bool ended = false;
char inData[80];
byte index;
void setup()
{
Serial.begin(57600);
// Other stuff...
}
void loop()
{
// Read all serial data available, as fast as possible
while(Serial.available() > 0)
{
char inChar = Serial.read();
if(inChar == SOP)
{
index = 0;
inData[index] = '\0';
started = true;
ended = false;
}
else if(inChar == EOP)
{
ended = true;
break;
}
else
{
if(index < 79)
{
inData[index] = inChar;
index++;
inData[index] = '\0';
}
}
}
// We are here either because all pending serial
// data has been read OR because an end of
// packet marker arrived. Which is it?
if(started && ended)
{
// The end of packet marker arrived. Process the packet
// Reset for the next packet
started = false;
ended = false;
index = 0;
inData[index] = '\0';
}
}
#include <SoftwareSerial.h>
#define SOP '<'
#define EOP '>'
SoftwareSerial blue(2, 3);
bool started = false;
bool ended = false;
char inData[80];
byte index;
void setup()
{
blue.begin(57600);
// Other stuff...
}
void loop()
{
// Read all blue data available, as fast as possible
while(blue.available() > 0)
{
char inChar = blue.read();
if(inChar == SOP)
{
blue.print("start");
index = 0;
inData[index] = '\0';
started = true;
ended = false;
}
else if(inChar == EOP)
{
blue.println("end");
ended = true;
break;
}
else
{
if(index < 79)
{
blue.println("get char");
inData[index] = inChar;
index++;
inData[index] = '\0';
}
}
}
// We are here either because all pending blue
// data has been read OR because an end of
// packet marker arrived. Which is it?
if(started && ended)
{
// The end of packet marker arrived. Process the packet
blue.println(inData);
blue.println("data read");
// Reset for the next packet
started = false;
ended = false;
index = 0;
inData[index] = '\0';
}
}