Files
flutterApp/lib/features/v2/local_camera/domain/entities/onvif_camera.dart

36 lines
893 B
Dart
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/// 局域网内通过 ONVIF WS-Discovery 发现的摄像头信息。
class OnvifCamera {
final String ip;
final int port;
final String xAddr; // ONVIF device_service 地址
final String manufacturer;
final String model;
const OnvifCamera({
required this.ip,
required this.port,
required this.xAddr,
this.manufacturer = '',
this.model = '',
});
/// 列表展示:IP · 型号
String get displayName {
final m = model.isNotEmpty
? model
: (manufacturer.isNotEmpty ? manufacturer : '未知型号');
return '$ip · $m';
}
OnvifCamera copyWith({String? manufacturer, String? model}) => OnvifCamera(
ip: ip,
port: port,
xAddr: xAddr,
manufacturer: manufacturer ?? this.manufacturer,
model: model ?? this.model,
);
@override
String toString() => 'OnvifCamera($ip:$port, model=$model, xAddr=$xAddr)';
}