Beacon management

Pair a beacon to a vehicle

The following function allows you to create a logical pairing between a beacon and a vehicle. The results of data analysis containing a beacon will be assigned to the vehicle to which the beacon has been paired with.

fun addBeaconToVehicle(
    beacon: Beacon,
    vehicle: Vehicle,
    listener: VehicleAddBeaconQueryListener
)
NameTypeDescription

beacon

The beacon data you want to pair to the vehicle

vehicle

The vehicle you wish to pair with a beacon

All fields are required. If you don't know the uniqueId of your beacons, just add an empty field.

Check the VehicleBeaconStatus value to ensure your beacon is correctly paired:

ValueDescription

SUCCESS

The beacon has been successfully paired to the specified vehicle. The vehicle data in the local database is automatically updated.

ERROR

An error occurred when trying to pair the beacon to the vehicle, for example if the user has no network during when the method is called.

UNKNOWN_VEHICLE

An error occurred: the specified vehicle does not belong to the user.

UNAVAILABLE_BEACON

The provided beacon is currently paired to another vehicle. You must unpair the beacon to that vehicle before in order to pair it to your desired vehicle.

Replace the beacon of a vehicle

If a beacon is already paired with a vehicle, it can be replaced. The following function is used to change the beacon paired with a vehicle:

fun changeBeaconToVehicle(
    beacon: Beacon,
    vehicle: Vehicle,
    listener: VehicleChangeBeaconQueryListener
)

This method have the following parameters:

NameTypeDescription

beacon

The new beacon data you want to pair to the vehicle.

vehicle

The vehicle you wish to change the beacon

All fields are required. If you don't know the uniqueId of your beacons, just add an empty field.

Check the VehicleBeaconStatus value to ensure your beacon is correctly changed:

ValueDescription

SUCCESS

The beacon has been successfully replaced for the specified vehicle. The vehicles data in the local database are automatically updated.

ERROR

An error occurred when trying to replace the beacon of the vehicle.

UNKNOWN_VEHICLE

An error occurred: the specified vehicle does not belong to the user.

UNAVAILABLE_BEACON

The provided beacon is currently paired to another vehicle. You must unpair the beacon to that vehicle before in order to pair it to your desired vehicle.

Unpair the beacon from a vehicle

The following function can be used to delete the pairing between a beacon and a vehicle:

fun removeBeaconToVehicle(
    vehicle: Vehicle,
    listener: VehicleRemoveBeaconQueryListener
)

This method have the following parameter:

NameTypeDescription

vehicle

The vehicle you want to unpair the beacon.

Check the VehicleBeaconRemoveStatus value to ensure your beacon is correctly unpaired:

ValueDescription

SUCCESS

The beacon has been successfully removed from the specified vehicle. The vehicle data in the local database is automatically updated.

ERROR

An error occurred when trying to remove the beacon of the vehicle.

UNKNOWN_VEHICLE

An error occurred: the specified vehicle does not belong to the user.

Last updated