To run BlueCove you need WinXP Service Pack 2 with a XP compatable blue tooth adapter which is Bluetooth version 1.0 with Cambridge Radio Ltd or Belkin 1.0 , difficult to find now all BT 2.0
Next you need the de.avetana obex package zip package source code
and the package MicroEmulator
* Copyright (C) 2001 Bartek Teodorczyk <barteo@it.pl>
under GNU.
Some Google-ing on these name will find the packages.
Under Netbeans 4.1 IDE build the BlueCove library project which is basis of BT under J2SE the "dist" directory contains the library BlueCove.jar this is added to the de.avetana project libraries now built as library de.avetana.jar
/* These lines are changes needed to use OBEX
String connectionURL = null;
String connSPPmodURL = null;
* from de.avetana.OBEXConnector.open("btgoep://remoteAddress:channel")
connSPPmodURL = "btgoep:"+ connectionURL.substring(6);
connection = OBEXConnector.open(connSPPmodURL);
client.updateStatus("Connection obtained");
ClientSession cs = (ClientSession)connection;
HeaderSet hs = cs.createHeaderSet();
cs.connect(hs);
client.updateStatus("OBEX session created");
The higlighted code is the client code. This is code copied from the Mobile project using Netbeans 4.1 and it runs on my Nokia 6230i
UUID[] uuidSet = {new UUID("1106", true)}; OBEXFile transfer
/* the Server and client service attributes */
public static int[] attribSet = {0x0100, 0x0001, 0x0002, 0x0003, 0x0004};
To pick up multiple phones.
cs.connect(hs);
client.updateStatus("OBEX session created");
public newConn extends Thread{
public void run(){
InputStream is = new FileInputStream(file);
byte filebytes[] = new byte[is.available()];
is.read(filebytes);
is.close();
hs = cs.createHeaderSet();
hs.setHeader(HeaderSet.NAME, file.getName());
hs.setHeader(HeaderSet.TYPE, "text/plain");
hs.setHeader(HeaderSet.LENGTH, new Long(filebytes.length));
Operation putOperation = cs.put(hs);
client.updateStatus("Pushing file: " + file.getName());
client.updateStatus("Total file size: " + filebytes.length + " bytes");
OutputStream outputStream = putOperation.openOutputStream();
outputStream.write(filebytes);
client.updateStatus("File push complete");
outputStream.close();
}
}
every time a new connection is found call newConn().start;
for a new connection an now you have a multi connection server