iBeacon is a technology introduced by Apple, which is based on Bluetooth 4.0. It uses GATT profiles to create a network of mobile/low energy devices that work in a producer/consumer fashion. An iBeacon is a transmitter which sends its UUID encoded in an advertisement message. That UUID may be associated with a product, place, item, food, anything... so, as the message reaches the receiver device, a host app installed on it may then search for that UUID on a remote server and interpret that information as a specific event.
This technology is mobile driven, so almost all players are focused on create solutions for iOS, Android, Windows Mobile, and other mobile OSs. It's simple and powerful, but we could use it for other purposes than mobility, don't you think? Well, here it is an example. Let's suppose I have an authorization process that runs on several places. Each place has its own rules and different prices for the same items. So if I authorize an item without knowing where it is, maybe I'll be losing money. That way, iBeacons can help us. It is a low cost solution and easy to implement/integrate. I can fix an iBeacon on a given point of the place I want to certificate and use a Bluetooth 4.0 USB Dongle in each of the desktop, used by the attendants. The application running on each Desktop will then look for a given iBeacon UUID, which must be associated with that place. Voilá! We've implemented a physical place certification mechanism.
In order to make a Bluetooth 4.0 dongle detects an iBeacon we need 3 elements: dongle driver, a Bluetooth 4.0 Stack and the final application. The harder part is to find a Stack. Windows 8 has a native BT4.0 Stack, iBeacon ready. However, if your desktop stations use an older version of Windows, here start the problems. The BT4.0 Stack is a piece of code that fits above the driver, it is used to manipulate the BT profiles, provided by the hardware/driver. Windows XP and Windows 7 32/64 don't have a native Stack for BT4.0. So I've decided to use BTStack to create my own solution. The application which controls the authorization process is written in Java. So, I've created a library using JNI. It contains only three operations.
Both startScanning are native (JNI) methods and eventHandler is an abstract method, called internally by the library after each event. Here it is an example of how to use the iBeacon scanner class:
I've uplodaded here two files, the source code I've created using BTStack and libusb to implement the project and iBeacon.jar, which contains the binary libraries for Windows 32/64 and Linux 64, besides the Java Native class and a demo class.
To use this solution, do not use the factory dongle driver. Please, install Zadig for Windows XP (5.1 MB) or Zadig for Windows Vista or later (4.9 MB). It will prepare you environment with the correct driver for BTStack.
after that, just execute:
java -jar iBeacon.jar 20
It will start the main method of the class util.iBeaconDemo and will stay capturing advertisement events for 20 seconds. Its output will be something like that:
That's it, use it in your project as you wish! :)