|
|
|
|
|
- Necessary version
- Bluetooth Low Energy
- Required permissions
BeaconDetectPrecise (Function) In french: BeaconDétectePrécis Used to find the Beacons near the device. // In a museum, we want to display on the visitor device the information // regarding the masterpiece he is looking at. Associate to each Beacon // the same UUID corresponding to the museum as well as Major and Minor numbers // allowing each Beacon to be uniquely identified. // A Beacon is placed next to each work of art in the museum. // The application must call the BeaconDetectPrecise function with a // BeaconGroup variable corresponding to the museum tags. // The callback procedure passed as parameter to the function will be called whenever // a new list of Beacons is detected. Then, all you have to do is find // the nearest Beacon to identify the work the visitor is looking at and to display // the corresponding information in the application.  // Museum UUID sUUID is string = "f4231ab6-5ef2-6c99-4229-af6c72e0446e" // Create a beaconGroup variable corresponding to the museum tags groupMuseum is beaconGroup groupMuseum.UUID = sUUID // Start the detection BeaconDetectPrecise(groupMuseum, ProcDetection) INTERNAL PROCEDURE ProcDetection(arrInfo is array of beaconDetectionInfo) nMinDistance is int NearestBeacon is beaconDetectionInfo FOR EACH Information OF arrInfo IF nMinDistance = 0 _OR_ Information.Distance < nMinDistance NearestBeacon = Information END END // Display information about the masterpiece associated with the tag DisplayMasterpieceInfo(NearestBeacon.Major, NearestBeacon.Minor) END
Syntax
<Result> = BeaconDetectPrecise(<Group of Beacons> , <WLanguage procedure>)
<Result>: Boolean - True if the detection was started,
- False otherwise. To get more details on the error, use ErrorInfo.
<Group of Beacons>: beaconGroup variable Name the of beaconGroup variable that describes the searched group of Beacons. <WLanguage procedure>: Procedure name Name of the WLanguage procedure ("callback") called when a new list of Beacons is detected. This procedure has the following format: PROCEDURE <Procedure Name>(<Array of Detection Info>) where <Array of detection info> is a beaconDetectionInfo variable that describes the information about the detected Beacons (identifiers, Major/Minor numbers, distance, etc.) Component: wd300android.aar
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|