Closed root-ansh closed 6 years ago
tried a few more times, its spawning the logs for everything, and not just my cell phone
Well, since you're using a "modified version" of the library I'm not sure what is happening... Can you test the Play Store demo app and tell me if everything is okay ?
You can use this kind of code on your Arduino :
#include <SoftwareSerial.h>
// Initializing communication ports
SoftwareSerial mySerial(11, 10); // TX/RX pins
void setup() {
Serial.begin(9600);
mySerial.begin(9600);
}
String getMessage(){
String msg = "";
char a;
while(mySerial.available()) {
a = mySerial.read();
msg+=String(a);
}
return msg;
}
void loop(){
// Check if a message has been received
String msg = getMessage();
if(msg!=""){
Serial.println(msg);
}
// Send a string when 'm' is sent through the Serial
if(Serial.available()){
if(Serial.read()=='m'){
mySerial.println("HC-06 IS REPLYING :-)");
}
}
delay(10);
}
although i have an hc 05 module, i will still look into its code. Can you tell me what ThreadHelper class is doing?
and yes,the current playstore's app is also listing my single device multiple times on start scanning .Can it be a problem of the mobile phone am using to run the app?
Can you tell me what ThreadHelper class is doing?
It's simply used to run the listener in the UI thread.
and yes,the current playstore's app is also listing my single device multiple times on start scanning .Can it be a problem of the mobile phone am using to run the app?
Can you do the test with the settings app of your phone ? Is it listing the device multiple times ?
yess , it seems that it is a device fault . i changed my device which has stopped multiple spawning.
don't know if this is a flaw on my app's side or the library side, but here are the logs:
all i have are 2 devices, one is a cellphone and other is an arduino. But it is spawning the logs again and again for the cellphone in the discoverylistener.(i am using a slightly modified version of your library)