I'm sorry, my expected output in my previous post has both my inputs as well. Forgot to differentiate while posting. So the expected output is this.
LLL
OK
===
OK
LLL
OK
AT+INQ
OK
+INQ:00:1C:A4:14:7D:AA,"Sony Ericsson"
D4:C1:FC:3A:56:7C,"C1-01"
DONE
OK
The red ones are the Input commands that I send to the Bluetooth module.So I have to use Serial.write in this case, as I need to send the commands to my module. Please correct me if I'm wrong.
I'm am not well versed with coding, so kindly bear with my doubts.
while(Serial.available() > 0)
{
char inChar = Serial.read();
if(inChar == SOP)
{
index = 0;
inData[index] = '\0';
started = true;
ended = false;
}
In this it reads the SOP and when it is done it deletes that from the receive buffer right?
inData[index] = '\0';
This is the one that deletes the stuff from receive buffer right?