Hi,
I’m trying to send some data to the Blueduino from a JAVA application on a Raspbian image.
The code I’m using JAVA side is:
Runtime.getRuntime().exec("sudo gatttool -i hci0 -b AA:BB:CC:DD:EE:FF:GG --char-write-req -a 0x0029 -n myValue");
The code on the Blueduino is:
#define BAUD_RATE 9600
void setup() {
Serial.begin(BAUD_RATE);
Serial1.begin(BAUD_RATE);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
Serial.println("Hello!");
}
void loop() {
if (Serial1.available() > 0) {
Serial.print(char(Serial1.read()));
}
}
I do receive the data I’m sending but I also “receive” those two more lines:
OK+CONN
bonded
myValue
Is there a way to get read of OK+CONN
and bonded
to just receive the data?
Thanks a lot