Sunday, May 6, 2012

BlueCove JSR-82 Emulator module

BlueCove JSR-82 Emulator module

bluecove-emu is additional module for BlueCove to simulate Bluetooth stack.
bluecove-emu is a pure Java implementation of JSR-82 without Bluetooth hardware. Fully tested using TCK JSR-82 TCK test results
bluecove-emu requires Java 5 Standard Edition and uses RMI for inter process communication.
N.B. This is experimental module and have no monitoring GUI. Another module bluecove-emu-gui is in developement. Help us make it .

Usage

Start local bluetooth air simulator server
java -cp bluecove-2.1.0.jar;bluecove-emu-2.1.0.jar com.intel.bluetooth.emu.EmuServer
Start jsr-82 application that connects to air simulator server
java -Dbluecove.stack=emulator -cp bluecove-2.1.0.jar;bluecove-emu-2.1.0.jar;yourApp.jar org.your.app.Main
Start MIDP jsr-82 application that connects to air simulator server
java -Dbluecove.stack=emulator -cp microemulator.jar;bluecove-2.1.0.jar;bluecove-emu-2.1.0.jar org.microemu.app.Main btApp.jad

Emulator in Unit tests

Emulator has been designed to be used during unit test to help in automation of tests for JSR-82 applications.
For unit tests air simulator server can be started as in process server. EmulatorTestsHelper.startInProcessServer()
Documentation for BlueCove API that enables the use of Multiple Adapters and Bluetooth Stacks in parallel in the same JVM can be found here .
Complete JUnit test example can be found here ExampleTest

Configuration options

System properties:
  • `bluecove.stack=emulator` force BlueCove to use Emulator instead of real Bluetooth stack
  • `bluecove.deviceID=1` bluecove supports multiple local devices, this will force it to select second one.
  • `bluecove.deviceAddress=btaddr` select local devices by Bluetooth address
  • `bluecove.emu.rmiRegistryHost=localhost` air simulator server can be on remote computer
  • `bluecove.emu.rmiRegistryPort=8090` air simulator server listen on different port. Use 0 on the client to enable in process server (no rmi)
  • `bluecove.emu.rmiRegistry=true` air simulator server and RMI registry can be started inside client JVM
Emulator Configuration properties:
This is the resource file 'bluecove.emulator.properties' loaded by air simulator server. Defines devices address and names assignment. It also can define LocalDevice properties returned to the client application.

 Link:  http://bluecove.org/bluecove-emu/

No comments:

Post a Comment