Hello,
I'm stuck on a really annoying problem.
In my program, I am able to compare a data read from the HM10 when it is myself who emits this one from other device.
Using this method:
String data = HM10.readStringUntil('\n');
if (data.equals("test")) { //Works
}
However in this case I am trying to compare a data coming from the HM10 when it is itself which transmits it. (Following at the command "AT + NOTI?")
The HM10 sends me either "OK + CONN" or "OK + LOST". (if you need more information on this command in HM-10 DataSheet)
Using the same method and although the data is all strings and that these are similar visually on my serial.
The equals() method does not work.
Do you have any idea why this is not working?
Thank you very much in advance for your help.
My code below and my serial next:
while (HM10.available()){
String data = HM10.readStringUntil('\n');
Serial.println("Reception data: "+data);
if (data.equals("OK+LOST"))
{
Serial.print("All IS OK");
}
}
ps: The other lines in the serial are correct and correspond to other part of the code which has no influence on my problem.