|
|
|
|
|||
|
The Harald HomepageA Bluetooth stack in JavaHarald is a small Bluetooth stack for wireless communication between Java applications. Harald accesses the Bluetooth chip via the serial port and therefore requires the JavaComm package to be installed. The stack will operate on any system where Java runs. The package is free for any use and for distribution. Installation
Download the zip-file and unzip into a desired directory <dir>. Go to <dir>/source/ and type 'make'. There are a few demos included in the distribution and they are found under <dir>/source/demo. After doing 'make' there will also some limited documentation which is accessed from <dir>/doc/index.html.
The 'simple'-demo includes three short programs 'test1', 'test2' & 'test3', which show how to initiate the stack, create a link, open a channels and then pass arbitrary Java objects back and forth. The are two script-files 'slave' & 'master' which show how to invoke a test. To use them open two console windows, go to the 'simple'-directory and type 'slave' in one window and 'master' in the other and now hopefully you will have a small wireless system. The above example of course assumed that you had two Bluetooth cards attached to your machine, one at each serial port.
The 'Chat'-demo screen is a bit more complicated. Again open two console windows and type 'chat1' in the first one and 'chat2' in the second. You will now see the following screen. You now need to do the following:
An overview of the suggested usage of the class libraryThis section requires the reader to have some basic knowledge of the Bluetooth standard, found at www.bluetooth.com. The main class is Local which is connected to the Bluetooth card via a Driver class. The Local class is used to send and receive HCI (Host-Controller Interface) messages.
or read String s = (String) jchannel.readObject(); Pretty simple, huh? |
|||||
|
Address: Johan
Eker |
|||||
|
|
|||||