Header Sep
Java Tips, Tricks & Code
 
我的评分 用户评价
登录票选本页

November 2005
Measure Bluetooth connection performance

[Back]

Here is a MIDlet that measures the Bluetooth connection performance between two Sony Ericsson Java Platform 5 (JP-5) mobile phones such as the K750 or K600.

Download the source code here>>

The MIDlet consists of two parts:

1. The Server
The server will register a service in the local Service database. The service that will be registered can be found in the BTParameter class and is named SPP_SERVICE_SRVCLASS_ID.

The role of the server is very simple: "Is there a Message in the in queue then echo it"

2. The Client
The client will start by doing an inquiry in-order to find other mobile phones. Once the client has a list of nearby phones it will start querying each found phone for its services and when a match is found it will be placed in a list so that the user may choose to connect to the matching server.

Once the client and the server has connected, the client will start pushing data to the server, only pausing when there is no more data to send or when the out-queue is full. See the diagram below:

The MIDlet also contains a reusable queue handling part. The queue operates on Messages according to the picture below:


The MIDlet is optimized for sending Bluetooth DH5 packets since this is the packet type used by all current Sony Ericsson phones (e.g. K750 and K600). More information about Bluetooth packet types can be found in Bluetooth specification 1.1. chapter 4.6 "Packet Summary">>

Please note:

  • Since the phone is an embedded system with limited CPU you will see a performance drop when using heavy graphics.
  • Bluetooth must be turned on in order for Bluetooth to work in the Java ME Platform.

 

 

我的评分 用户评价
登录票选本页