JSR 82 Bluetooth
phoneME Advanced Dual Stack - JSR 82 with BlueCove
You can use the BlueCove implementation of JSR 82 to have bluetooth support for your midlets. Here are the instructions:
- Unpack bluecove_ce.dll and intelbth_ce.dll from bluecove-2.0.2.jar and copy them to the same directory where cvm.exe and cvmi.dll are located.
- Add the following lines to MIDPPermittedClasses.txt so that you can load the JSR 82 java classes from the javax package:
javax.obex.SessionNotifier
javax.obex.ServerRequestHandler
javax.obex.ResponseCodes
javax.obex.PasswordAuthentication
javax.obex.Operation
javax.obex.HeaderSet
javax.obex.ClientSession
javax.obex.Authenticator
javax.bluetooth.UUID
javax.bluetooth.ServiceRegistrationException
javax.bluetooth.ServiceRecord
javax.bluetooth.RemoteDevice
javax.bluetooth.LocalDevice
javax.bluetooth.L2CAPConnectionNotifier
javax.bluetooth.L2CAPConnection
javax.bluetooth.DiscoveryListener
javax.bluetooth.DiscoveryAgent
javax.bluetooth.DeviceClass
javax.bluetooth.DataElement
javax.bluetooth.BluetoothStateException
javax.bluetooth.BluetoothConnectionException - Append the BlueCove jar to the boot classpath. For example, to run the bctest BlueCove tester, create the bctest.lnk launch script:
255#"\phoneme\dual\bin\cvm.exe" -f "\bluecove\bctest.txt"
which calls the bctest.txt script with the following command line arguments:
-Xmx2m -Dmicroedition.profiles=MIDP-2.1 -Dsun.midp.library.name=midp "-Xbootclasspath/a=\bluecove\bluecove-2.0.2.jar"
"-Dsun.midp.home.path=\phoneme\dual\midp\midp_wince"
-Dcom.sun.midp.mainClass.name=com.sun.midp.main.CdcMIDletSuiteLoader sun.misc.MIDPLauncher -midppath
"\phoneme\dual\midp\midp_wince\classes" -suitepath "\bluecove\bctest.jar" -1
net.sf.bluecove.BlueCoveTestMIDlet - In case you are having runtime permission errors, you may need to change the java.policy file to grant the required privileges to load the required native libraries. Add the following lines:
grant {
...
permission java.lang.RuntimePermission "loadLibrary.intelbth_ce";
permission java.lang.RuntimePermission "loadLibrary.bluecove_ce";
}
