When selecting the Extended mode, the sample allows you to select the kind of Beacon device to scan: iBeacon, AltBeacon, and Eddystone. The Extended mode allows scanning all different kind of beacon devices simultaneously.
You can find the ExtendedBeaconScanner sample project at:
- Start | Programs | Embarcadero RAD Studio Berlin | Samples and then navigate to:
Object Pascal\Multi-Device Samples\Device Sensors and Services\Bluetooth\Beacons\ExtendedBeaconScanner
- Subversion Repository for Delphi: http://sourceforge.net/p/radstudiodemos/code/HEAD/tree/branches/RADStudio_Berlin/Object%20Pascal/Multi-Device%20Samples/Device%20Sensors%20and%20Services/Bluetooth/Beacons/ExtendedBeaconScanner
Using the Extended scan mode, the application is able to discover non-registered beacons.
The demo also works with the Standard, Alternative, and Eddyston modes to discover registered beacons.
How to Use the Sample
- Navigate to the location given above and open AllBeaconsScanner.dproj.
- Press F9 or choose Run > Run.
- Select the scan mode: Standard, Alternative, Eddyston, or Extended.
- When selecting Extended as the scan mode, select the kind of beacon to scan: iBeacon, AltBeacon, and Eddystone.
- Select Device Inf. to show information about the discovered devices in the TListView.
- Click SCAN to start scanning for devices.
This application uses a TBeacon component:
- The Mode property is used to define the scan mode. The value that comes by default is extended.
- The ModeExtended property indicates which kind of beacons to monitor. The values that comes by default are: [iBeacons, AltBeacons, Eddystones].
GetScanningModeCheckedfunction checks the Scan mode selected in the Scan mode panel of the application. Modes are mutually exclusive.
GetKindOfBeaconsCheckedfunction checks the kind of beacon selected in the Extended mode panel of the application. The Extended mode allows you to scan for several kinds of beacons at the same time.
The SCAN button calls the StartScan method to start monitoring beacons.
STOP SCANNING Button
The STOP SCANNING button calls the StopScan method to stop monitoring beacons.
When Device Inf is selected, the TListView is filled with the information of the discovered devices.
The OnTimer event triggers the
Timer1Timer procedure after the defined time interval.
Timer1Timer procedure checks the BeaconList and gets information about the devices.