I saw that beta 4 support brick to brick comms so figured i would mess around with it. below is a short version of the code. they seam to connect but i think im missing something when sending. I should get a 1 to appear on the recever brick but i don't what am i missing?
Also i noticed a beeping from the bricks when they are on now. the same sound you get when they are in upload mode. it seams to get louder when using bluetooth comms. is this normal?
Brick one (sender)
BTRemoteDevice btrd = Bluetooth.getKnownDevice("NXT");
BTConnection btc = Bluetooth.connect(btrd);
InputStream is = btc.openInputStream();
OutputStream os = btc.openOutputStream();
DataInputStream dis = new DataInputStream(is);
DataOutputStream dos = new DataOutputStream(os);
dos.write(15);
dos.flush();
Brick two(receiver)
BTConnection btc = Bluetooth.waitForConnection();
InputStream is = btc.openInputStream();
OutputStream os = btc.openOutputStream();
DataInputStream dis = new DataInputStream(is);
DataOutputStream dos = new DataOutputStream(os);
while(true){
LCD.clear();
LCD.drawInt(dis.available(), 4, 0, 0);
LCD.refresh();
Thread.sleep(100);
}
