Package es.situm.sdk.location
Class AssetTrackingOptions.Builder
- java.lang.Object
-
- es.situm.sdk.location.AssetTrackingOptions.Builder
-
- Enclosing class:
- AssetTrackingOptions
public static class AssetTrackingOptions.Builder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
Builder(AssetTrackingOptions copy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AssetTrackingOptions.Builder
beaconFilters(java.util.List<BeaconFilter> beaconFilters)
Defines a whitelist of device UUIDs for BLE beacon scanning.AssetTrackingOptions
build()
AssetTrackingOptions.Builder
scanIterationsToUpload(int scanIterationsToUpload)
Configures how many scanning intervals are uploaded in a single operation.AssetTrackingOptions.Builder
scanningInterval(long scanningInterval)
Specifies the time interval in seconds during which BLE beacon readings are collected and aggregated into a single batch.AssetTrackingOptions.Builder
setEnabled(boolean enabled)
Enables or disables asset tracking for BLE beacons.
-
-
-
Constructor Detail
-
Builder
public Builder()
-
Builder
public Builder(@NonNull AssetTrackingOptions copy)
-
-
Method Detail
-
setEnabled
public AssetTrackingOptions.Builder setEnabled(boolean enabled)
Enables or disables asset tracking for BLE beacons. When enabled, the SDK continuously scans the environment for BLE beacons, recording readings in a structured manner. These readings are aggregated and uploaded to the Dashboard, where they are associated with the user's current position. This association enables the extrapolation of the absolute position of the scanned beacons, providing precise tracking capabilities.- Parameters:
enabled
- Set totrue
to enable asset tracking, orfalse
to disable it. The default value isfalse
.- Returns:
- The current instance of the Builder to allow method chaining.
-
scanningInterval
public AssetTrackingOptions.Builder scanningInterval(long scanningInterval)
Specifies the time interval in seconds during which BLE beacon readings are collected and aggregated into a single batch. For each scanning interval, the SDK ensures that each unique beacon is recorded only once, and the associated timestamp corresponds to the end of the interval. This efficient approach reduces resource usage by consolidating duplicate readings.The aggregated data is prepared for uploading to the Dashboard. To upload multiple intervals in a single operation, use
To restrict the scanning to specific UUIDs, usescanIterationsToUpload(int)
.beaconFilters(List)
.- Parameters:
scanningInterval
- The duration of each scanning interval, in seconds. The default value is300
s.- Returns:
- The current instance of the Builder to allow method chaining.
-
scanIterationsToUpload
public AssetTrackingOptions.Builder scanIterationsToUpload(int scanIterationsToUpload)
Configures how many scanning intervals are uploaded in a single operation. For instance, setting this value to 2 means that uploads will occur after every 2 scanning intervals.A value of 1 (default) ensures immediate uploads after each interval, making data available as soon as possible.
This parameter allows precise control over the data accumulation and upload strategy. Higher values can reduce data usage but will delay the availability of uploaded information.
- Parameters:
scanIterationsToUpload
- The number of scanning intervals to upload in a single operation. Must be a positive integer. The default value is1
.- Returns:
- The current instance of the Builder to allow method chaining.
-
beaconFilters
public AssetTrackingOptions.Builder beaconFilters(@Nullable java.util.List<BeaconFilter> beaconFilters)
Defines a whitelist of device UUIDs for BLE beacon scanning. Only beacons with UUIDs included in this list will be tracked. All other devices will be ignored during scanning. This feature is useful for filtering out irrelevant beacons and focusing on a specific set of devices.If an invalid UUID is passed, you will receive an status of
LocationStatus.BAD_ASSET_TRACKING_OPTIONS
atLocationListener.onStatusChanged(LocationStatus)
.- Parameters:
beaconFilters
- A list of accepted UUIDs. Beacons with UUIDs not in this list will be discarded. The list can be empty ornull
to disable filtering. By default no filters are applied.- Returns:
- The current instance of the Builder to allow method chaining.
-
build
public AssetTrackingOptions build()
-
-