feat: everything up to bluetooth scanning

This commit is contained in:
2025-03-26 21:01:42 +01:00
parent be964fab25
commit f4022dd249
21 changed files with 2496 additions and 132 deletions

View File

@ -0,0 +1,47 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'bluetooth_device_model.freezed.dart';
part 'bluetooth_device_model.g.dart';
/// Enum representing the type of Bluetooth device
enum DeviceType {
/// Universal Shifters device
universalShifters,
/// Other unspecified device types
other,
}
/// Model representing a Bluetooth device
@freezed
abstract class BluetoothDeviceModel with _$BluetoothDeviceModel {
const factory BluetoothDeviceModel({
/// Unique identifier for the device
required String id,
/// Name of the device as advertised
String? name,
/// MAC address of the device
required String address,
/// Signal strength indicator (RSSI)
int? rssi,
/// Type of the device
@Default(DeviceType.other) DeviceType type,
/// Whether the device is currently connected
@Default(false) bool isConnected,
/// Additional device information
Map<String, dynamic>? manufacturerData,
/// Service UUIDs advertised by the device
List<String>? serviceUuids,
}) = _BluetoothDeviceModel;
/// Create a BluetoothDeviceModel from JSON
factory BluetoothDeviceModel.fromJson(Map<String, dynamic> json) =>
_$BluetoothDeviceModelFromJson(json);
}