Bluecove + Creme

3 views
Skip to first unread message

Aidan Gordon

unread,
Jan 16, 2009, 5:39:25 PM1/16/09
to bluecove-users
Hi there,
I'm trying to use bluecove on a TDS Ranger running WinCE 5.0 over the
CrE-ME jvm.

When trying to run the following code, I get the message
"before
UnsatisfiedLinkError:isNativeCodeLoaded
BlueCove version 2.1.0 on winsock"

I assume the problem is probably due to the .dll? Do I need to
recompile the c code for the target platform and redistribute the
newly compiled dll?

Thanks,
Aidan


Sample Code Used:

package com.bcferries.handheld.zebraprint.printer;

import java.io.IOException;
import java.util.Vector;
import javax.bluetooth.*;

/**
* Minimal Device Discovery example.
*/
public class RemoteDeviceDiscovery {

public static final Vector/*<RemoteDevice>*/ devicesDiscovered =
new Vector();

public static void main(String[] args) throws IOException,
InterruptedException {

final Object inquiryCompletedEvent = new Object();

devicesDiscovered.clear();

DiscoveryListener listener = new DiscoveryListener() {

public void deviceDiscovered(RemoteDevice btDevice,
DeviceClass cod) {
System.out.println("Device " +
btDevice.getBluetoothAddress() + " found");
devicesDiscovered.addElement(btDevice);
try {
System.out.println(" name " +
btDevice.getFriendlyName(false));
} catch (IOException cantGetDeviceName) {
cantGetDeviceName.printStackTrace();
}
}

public void inquiryCompleted(int discType) {
System.out.println("Device Inquiry completed!");
synchronized(inquiryCompletedEvent){
inquiryCompletedEvent.notifyAll();
}
}

public void serviceSearchCompleted(int transID, int
respCode) {
}

public void servicesDiscovered(int transID, ServiceRecord
[] servRecord) {
}
};

synchronized(inquiryCompletedEvent) {
System.out.println("before");
boolean started = LocalDevice.getLocalDevice
().getDiscoveryAgent().startInquiry(DiscoveryAgent.GIAC, listener);
System.out.println("after");
if (started) {
System.out.println("wait for device inquiry to
complete...");
inquiryCompletedEvent.wait();
System.out.println(devicesDiscovered.size() + " device
(s) found");
}
}
}

}

Vlad Skarzhevskyy

unread,
Jan 16, 2009, 6:00:43 PM1/16/09
to bluecov...@googlegroups.com
This is specific of CrE-ME,

There code UtilsJavaSE:
static final boolean canCallNotLoadedNativeMethod = !ibmJ9midp;

Probably we need to add CrE-ME detection to code.


The problem probably in this code BlueCoveImpl:

try {
if (UtilsJavaSE.canCallNotLoadedNativeMethod) {
return stack.isNativeCodeLoaded();
}
} catch (Error e) {}

The CrE-ME do not allow us to catch UnsatisfiedLinkError
--
Vlad

Aidan Gordon

unread,
Jan 16, 2009, 8:04:36 PM1/16/09
to bluecov...@googlegroups.com
Ok, so I'm confused then.
 
Does this mean it's not possible to use with Creme?  Or does it mean I need to make a change to the bluecove implementation to accomodate creme?

Thanks,
Aidan

Vlad Skarzhevskyy

unread,
Jan 17, 2009, 2:39:51 PM1/17/09
to bluecov...@googlegroups.com
Changes in BlueCove java code required for it to work on CrE-ME.
I don't have a CrE-ME installed on my PDA to test this changes.
--
Vlad
Reply all
Reply to author
Forward
0 new messages