Page 2 of 2

Posted: Tue Jul 31, 2007 6:28 am
by CoBB
I tried that too quite a few times, but I can’t get them to pair in any way. Could you post your bluetooth config files?

Posted: Thu Aug 02, 2007 11:37 am
by CoBB
Good news! :D I got it working at last, and I needed two things to get there: reboot the computer (haven't done that for a month, and I don't really know what difference it makes) and install bluez-gnome (to run bluetooth-applet). Finally I got the PIN window instead of the error, and immediately tested some functions of nxjbrowse with success.

Now I noticed another problem: I tried to do a rapid test with BTSend/BTReceive, and the PC seems to be stuck at the dis.readInt() call. After adding extra messages to display on both sides I can see that they run their flush() successfully, but the echoed data apparently doesn't reach BTSend (perhaps only on a higher level).

Edit: I implemented a simple echo application in C which should behave the same way as BTReceive except for not multiplying the number by -1, and it turns out that I can't send individual bytes without waiting about 5 ms between each. At the same time, I don't see anything in the Java stream handling code that suggests the need for such a delay. Is this a limitation of bt_send()? Here's the loop after accepting the connection:

Code: Select all

  while (!(buttons_get() & 0x08)) {
    U8 buf[128];
    int i;

    memset(buf, 0, 128);

    display_goto_xy(0, 0);
    display_unsigned((buf[2] << 24) + (buf[3] << 16) + (buf[4] << 8) + buf[5], 0);

    while (!(buttons_get() & 0x01));

    for (i = 0; i < buf[0]; i++) {
      bt_send(buf + i + 2, 1);

    while (buttons_get() & 0x01);