new to the nxt interface. First of all I would like to thank you for your work
and for this api that has been proved quite useful to me.
Anyway to the point. I have written a fuzzy contoller for the nxt and i am developing
some other ai applications such as some unsupervised neural algorithms and stuff
which I intend to run partially on the brick and partially on the computer.
My Java experience isn't that great i would say, so I have some questions.
First of all, here is the code i implemented for the connectivity, which is linked to the user interface
in other classes that i believe are irrelevant now.
public class ConnectionHandler {
protected static NXTComm nxtComm = null;
private NXTInfo[] nxtInfo = null;
public ConnectionHandler() {
}
public int connectBt(String s) throws NXTCommException {
nxtComm = NXTCommFactory.createNXTComm(NXTCommFactory.BLUETOOTH);
nxtInfo = nxtComm.search(s, NXTCommFactory.BLUETOOTH);
if (nxtInfo.length == 0)
return -2;
else {
nxtComm.open(nxtInfo[0]);
return 0;
}
}
public int connectUsb(String s) throws NXTCommException {
nxtComm = NXTCommFactory.createNXTComm(NXTCommFactory.USB);
nxtInfo = nxtComm.search(s, NXTCommFactory.USB);
if(nxtInfo.length == 0)
return -2;
else if(nxtInfo == null)
return -2;
else {
nxtComm.open(nxtInfo[0]);
return 0;
}
}
As you can see I use the NXTCommFactory to open my BT and USB connections. Thing is, as I understand
the usb connection uses the jfantom.dll library. When I run the program from eclipse or netbeans it seems
to be working perfectly, as it is running depending on the machine variables. What I want though, is make a self-dependent portable
jar file or at most with a supplied /lib folder.
My question is what do I have to do so the library is loaded correctly when running a jar application?
Thank you for your time
