Initial version
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
/// 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)';
|
||||
}
|
||||
Reference in New Issue
Block a user