beacon_distance

Creator: coderz1093

Last updated:

0 purchases

beacon_distance Image
beacon_distance Images

Languages

Categories

Add to Cart

Description:

beacon distance

Beacon distance #
Beacon Distance is a simple yet powerful application designed to measure and monitor distances using beacon technology.
Installation #

Add the latest version of package to your pubspec.yaml (and rundart pub get):

dependencies:
beacon_distance: ^0.0.1
copied to clipboard

Import the package and use it in your Flutter App.

import 'package:beacon_distance/beacon_util.dart';
copied to clipboard
This Flutter function, calculateDistance, is designed to estimate the distance between a Bluetooth device and its transmitter based on the received signal strength indicator (RSSI) and the transmission power (txPower).
Parameters #
txPower: Transmission power in decibels (dB) at 1 meter from the Bluetooth device.
rssi: Received Signal Strength Indicator, representing the signal strength received by the device.
Return Value #
The function returns the estimated distance between the Bluetooth device and its transmitter. If the distance cannot be determined, the function returns -1.0.
Usage #
void main() {
// Example usage
int txPower = -10; // Replace with the actual transmission power value
double rssi = -55.5; // Replace with the actual received signal strength

double distance = calculateDistance(txPower, rssi);

if (distance == -1.0) {
print("Unable to determine distance.");
} else {
print("Estimated distance: $distance meters.");
}
}
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.