|
|
|
|
|
- Overview
- Principle
- Implementation
- Necessary version
A "beacon" is a hardware transmitter that can "dialog" on a small perimeter with smartphones or tablets via a Bluetooth connection. The technology used is the one of BTLE (Bluetooth Low Energy). The Beacon can for example indicate the proximity of an art masterpiece in a museum; the application can display the explanation text, or it can start a video or an audio file. On the commercial side, a Beacon can trigger a message regarding a bargain on a nearby product. A Beacon can also inform a user that he is not far away from a store that sells a product he is looking for. An application asks the phone to be warned when one or more Beacons are found nearby. This application can be closed immediately, therefore it consumes no battery. When the phone detects a Beacon, it restarts the application and transmits the Beacon information. Furthermore, the phone warns the application when it exits from the emission area of Beacon. Several WLanguage functions and 2 specific types can be used to manage Beacons. Depending on the use mode of your application, you have the ability to use one of the following methods: - Method 1: Automated detection of Beacon tags
This method consists in detecting groups of Beacons in the background with BeaconDetectBackground. A specific action is performed when a group of Beacons is detected. Example:
sUUID is string = "f4231ab6-5ef2-6c99-4229-af6c72e0446e"
groupeSalle1 is beaconGroup
groupeSalle1.UUID = sUUID
groupeSalle1.Major = 1
groupeSalle2 is beaconGroup
groupeSalle2.UUID = sUUID
groupeSalle2.Major = 2
groupeSalle3 is beaconGroup
groupeSalle3.UUID = sUUID
groupeSalle3.Major = 3
groupeSalle4 is beaconGroup
groupeSalle4.UUID = sUUID
groupeSalle4.Major = 4
tabGroupeBeacon is array of beaconGroup = [groupeSalle1, ...
groupeSalle2, groupeSalle3, groupeSalle4]
BeaconDetectBackground(tabGroupeBeacon, ProcDétection)
PROCEDURE ProcDétection(Groupe is beaconGroup, nType is int)
IF nType = bdbLeave THEN
RETURN
END
IF nType = bdbEnter THEN
SWITCH Groupe.Major
CASE 1
CASE 2
...
END
END
- Method 2: Precise detection of Beacon tags
This method consists in using the precise detection (BeaconDetectPrecise) to get the nearest Beacon and perform a specific operation. Example:
sUUID is string = "f4231ab6-5ef2-6c99-4229-af6c72e0446e"
groupeMusée is beaconGroup
groupeMusée.UUID = sUUID
BeaconDetectPrecise(groupeMusée, ProcDétection)
INTERNAL PROCEDURE ProcDétection(tabInfo is array of beaconDetectionInfo)
nDistanceMin is int
BaliseLaPlusProche is beaconDetectionInfo
FOR EACH Information OF tabInfo
IF nDistanceMin = 0 _OR_ Information.Distance < nDistanceMin
BaliseLaPlusProche = Information
END
END
AfficheInfoOeuvre(BaliseLaPlusProche.Major, BaliseLaPlusProche.Minor)
END
Necessary version
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|