ravey72
Posts: 14
Joined: Wed Nov 30, 2005 11:49 pm
Location: United Kingdom

Blue Tooth Comms between .NET and J2ME

Thu Dec 01, 2005 12:02 pm

Hi

I'm evaluating whether I can use SerialTools/BlueTools for sending data between a C#.NET app on my desktop PC and a J2ME app running on my mobile phone.

(I have a USB Bluetooth dongle connected to my desktop).

I have run the example program Serial Service and selected one of the COM Ports. Then I have started a test J2ME app on my mobile phone that discovers the SerialPort bluetooth service on my desktop and sends a short text, "Test Text", via the SerialPort found.

The Serial Service .NET should listen for this text and display the text in a MessageBox. However the Serial Servie app throws a general exception in method SerialService.HandleClient()
during the port.Read(0, 10000) processing.

It appears that the Serial Service does detect that there is incoming data, but is not able to read it.

Any ideas on what might be happening?

I would like to send data back and forth between my .NET app and J2ME app, via bluetooth. Are you able to advise whether the use of the SerialTools/BlueTools library is a good method to achieve this, or do you have any other recommendations?

Many Thanks
Ravinder

Andreas2
Posts: 108
Joined: Sun Feb 13, 2005 3:19 pm

RE: Blue Tooth Comms between .NET and J2ME

Thu Dec 01, 2005 3:41 pm

Hi!

What is the type of the exception begin thrown? Is there a message associated with the exception? You can find these like this:

Code: Select all

try
{
   port.Read(...);
} catch (Exception e)
{
   Type    type    = e.GetType();
   String  message = e.Message;

   System.Windows.Forms.MessageBox.Show("Type: " + type + ", message: " + message);
}
Regards,
Andreas Nilsson
Franson Support

Return to “BlueTools”