Bluetooth

Hiya,

having polished off my single player function i have decided to continue with my project specification (part of my uni dissertation) and implement multiplayer bluetooth.

have managed to get the phones connected, loading into the game and placing the two players. moving a player on one phone moves its mirror on the other phone, cool right!

my implementation may work, but its not exactly robust. here s the situation.

i have a class called player, so i have a created a vector which contains 2 instances of the class player, one the server the other the client.

the keystates from one handset are fed to the other, but the Player moves to far (in the right direction), do you suppose that i also send the precsie location of the player instead, to ensure continuity as the game is constantaly alsive refreshing itself? would i be better feeding game logic rather than keystates?

also, when using a stream how does it scheduele the inputs and know the tag associated with a transfer for sending more than one variable?

also, any clues what a IOException error 10054 during TCP wirte means? or is it just when one phone has dies and cant communicate?

are there any bluewizards who could shed some light on this topic?

(i reccomend the book Bluetooth application programming, by Kumar et al, pretty helpfull stuff, got me from nothing to here in 3 days)

cheers guys, www.pistachiomonkey.com

well i think ive worked out where my implemenation is going wrong, i am using a RFCOMM method with streams, if use an OBEX method i can send small files of information (say in XML) about the mirrored player, thus being more relaible and informative,

any ideas?

cheers

Before you use OBEX, check that your target phones support it. E.g. Nokia’s phones with Bluetooth nowadays support the rest of JSR-82, but not the OBEX API.