Files
OpenMotion/lib/models/scooter_device.dart
T
2026-09-21 18:03:21 -04:00

31 lines
902 B
Dart

/// A scooter candidate discovered during a BLE scan.
///
/// [id] is the platform peripheral identifier (a MAC address on Android, an
/// opaque UUID on iOS). It is only valid for connecting on this device and
/// must NOT be used as the scooter's persistent identity. Once a vendor
/// protocol exposes a serial number or UID, use that instead.
class ScooterDevice {
final String id;
final String name;
final int rssi;
/// Lowercase 128-bit service UUIDs found in the advertisement.
final Set<String> advertisedServiceUuids;
const ScooterDevice({
required this.id,
required this.name,
required this.rssi,
this.advertisedServiceUuids = const {},
});
@override
bool operator ==(Object other) => other is ScooterDevice && other.id == id;
@override
int get hashCode => id.hashCode;
@override
String toString() => 'ScooterDevice($id, "$name", $rssi dBm)';
}