connection bluetooth

  ... the Multiplayer Extension for AndEngine.

Re: connection bluetooth

Postby Nicolas Gramlich » Mon Mar 07, 2011 3:37 am

I need to see the code.

Do you have a call to "registerMessage" somewhere :?:

Btw: I just noticed that I have only one device with Android >= 2.1 at hands, so I cannot test the Bluetooth "mode".

Does anyone know if I can connect to a "localhost" with Bluetooth? I mean with normal sockets I can just connect to "myself" using "127.0.0.1"/"localhost". (Which is very handy when the server device is also a client device).

Best Regards,
Nicolas
Nicolas Gramlich
Site Admin
 
Posts: 1734
Joined: Mon Jun 07, 2010 6:20 pm
Location: Schriesheim, Germany

Re: connection bluetooth

Postby Romeo Ordos » Mon Mar 07, 2011 9:44 am

I think there is no way to connect bluetooth to itself. I have tried to connect to my MAC and same UUID but received "Service not found" error. Google Search doesn't know also.
I have 3 devices with >= 2.1, so I'll test it today.
Romeo Ordos
 
Posts: 26
Joined: Thu Feb 10, 2011 5:06 pm
Location: Donetsk, Ukraine

Re: connection bluetooth

Postby Romeo Ordos » Wed Mar 09, 2011 12:43 pm

Hello, Nicolas!
I have tested Bluetooth mode, but the server didn't even started for me.

I used this code for server:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. BluetoothSocketServer<ClientConnector<BluetoothSocketConnection>> bServer = new BluetoothSocketServer<ClientConnector<BluetoothSocketConnection>>(Constants.UUID)
  2. {
  3.  @Override
  4.  protected ClientConnector<BluetoothSocketConnection> newClientConnector(BluetoothSocketConnection pBluetoothSocketConnection) throws IOException
  5.  {
  6.   return new ClientConnector<BluetoothSocketConnection>(pBluetoothSocketConnection);
  7.  }
  8. };
  9. bServer.start();
  10.  
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


As I know it must show "Server started on port: UUID" in device's Logcat output. But it doesn't. I can't connect to this server from another devices also.
Romeo Ordos
 
Posts: 26
Joined: Thu Feb 10, 2011 5:06 pm
Location: Donetsk, Ukraine

Re: connection bluetooth

Postby Nicolas Gramlich » Wed Mar 09, 2011 12:52 pm

Hi,
Romeo Ordos wrote:As I know it must show "Server started on port: UUID" in device's Logcat output. But it doesn't. I can't connect to this server from another devices also.


Hm... is the server device discoverable?

Best Regards,
Nicolas
Nicolas Gramlich
Site Admin
 
Posts: 1734
Joined: Mon Jun 07, 2010 6:20 pm
Location: Schriesheim, Germany

Re: connection bluetooth

Postby Romeo Ordos » Wed Mar 09, 2011 1:00 pm

Ofcourse it is :)
But even if not, server must start and show that message without discoverable mode.
Romeo Ordos
 
Posts: 26
Joined: Thu Feb 10, 2011 5:06 pm
Location: Donetsk, Ukraine

Re: connection bluetooth

Postby cslwkah » Wed Mar 09, 2011 3:25 pm

hey, any one can confirm if the current multiplayer extension support bluetooth?

I want to know if it is ready to use, or still solving some bugs before I give a deep try.

Thanks.
cslwkah
 
Posts: 88
Joined: Sat Jan 22, 2011 1:38 pm
Location: HK

Re: connection bluetooth

Postby Nicolas Gramlich » Wed Mar 09, 2011 6:52 pm

Romeo Ordos wrote:Ofcourse it is :)
But even if not, server must start and show that message without discoverable mode.


Yeah :(
Need a second device, otherwise my guessing is not time-efficient enough :/
Probably this weekend I'll steal the Nexus of my girlfriend :)
Nicolas Gramlich
Site Admin
 
Posts: 1734
Joined: Mon Jun 07, 2010 6:20 pm
Location: Schriesheim, Germany

Re: connection bluetooth

Postby Nicolas Gramlich » Wed Mar 09, 2011 6:54 pm

cslwkah wrote:hey, any one can confirm if the current multiplayer extension support bluetooth?

I want to know if it is ready to use, or still solving some bugs before I give a deep try.

Still solving a few bugs, as I currently have only one device in range. :(

Best Regards,
Nicolas
Nicolas Gramlich
Site Admin
 
Posts: 1734
Joined: Mon Jun 07, 2010 6:20 pm
Location: Schriesheim, Germany

Re: connection bluetooth

Postby Romeo Ordos » Wed Mar 09, 2011 8:13 pm

Still solving a few bugs, as I currently have only one device in range.


If you need some help in testing or debuging you can contact me. Because I'm very interested in multiplayer plugin at this moment.
Romeo Ordos
 
Posts: 26
Joined: Thu Feb 10, 2011 5:06 pm
Location: Donetsk, Ukraine

Re: connection bluetooth

Postby Romeo Ordos » Tue Mar 22, 2011 9:43 pm

Nicolas please help. I have updated multiplayer to latest revision today. And I still have problems with message receiving on server side:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. this.server = new SocketServer<SocketConnectionClientConnector>(port)
  2. {
  3.  @Override
  4.  protected SocketConnectionClientConnector newClientConnector(final SocketConnection pSocketConnection) throws IOException
  5.  {
  6.   SocketConnectionClientConnector connector = new SocketConnectionClientConnector(pSocketConnection);
  7.   connector.registerClientMessageHandler((short) 0, new IClientMessageHandler<SocketConnection>()
  8.   {
  9.    @Override
  10.    public void onHandleMessage(final ClientConnector<SocketConnection> pClientConnector, final IClientMessage pClientMessage) throws IOException
  11.     {
  12.      System.out.println("Hello Received");
  13.     }
  14.  });
  15.  return connector;
  16.  }
  17. };
  18. this.server.start();
  19.  
Parsed in 0.033 seconds, using GeSHi 1.0.8.4


But I see next output when I'm sending new message with flag "0":
java.lang.IllegalArgumentException: No message found for pFlag='0'.
Romeo Ordos
 
Posts: 26
Joined: Thu Feb 10, 2011 5:06 pm
Location: Donetsk, Ukraine

PreviousNext

Return to Multiplayer

Who is online

Users browsing this forum: No registered users and 1 guest