if (partner == null) {
LCD.drawString("partner tidak ketemu", 0, 4);
LCD.refresh();
return false;
}
BTConnection btc = Bluetooth.connect(partner);
if (btc == null) {
LCD.drawString("tidak bisa nyambung", 0, 5);
LCD.refresh();
return false;
}
LCD.drawString("Mulai mengirim", 0, 6);
LCD.refresh();
DataOutputStream dos = btc.openDataOutputStream();
for (int i = 0; i < pesan.length(); i++) {
char a = pesan.charAt(i);
LCD.drawString("Yang dikirim " + a, 0, 2);
dos.writeChar(a);
// dos.writeInt(a);
dos.flush();
}
dos.writeChar('e');
dos.flush();
dos.close();
LCD.drawString("Selesai mengirim", 0, 7);
btc.close();
return true;
}