Device class abstract

Available extensions
Annotations
  • @freezed

Constructors

Device({required String id, required String name, required String ident, String? flespiToken, String? modelId, Model? model, String? protocolId, InboundProtocol? protocol, Map<String, dynamic>? additionalFields, String? qrCode, String? linkQr, List<DeviceCommand>? commands, List<Access>? access, DeviceTelemetry? telemetry, String? visionProfileId, VisionProfile? visionProfile, PhoneNumber? phone, ModbusConfig? modbus, bool? isSuspended, HwModel? hwModel, String? hwModelId, String? macAddress, Map<String, dynamic>? configParams, @DurationConverter() Duration? visionCaptureThreshold, List<Device>? peripherals, String? localIpAddress})
const
factory
Device.fromJson(Map<String, dynamic> json)
factory

Properties

access List<Access>?
The access of the device.
no setterinherited
additionalFields Map<String, dynamic>?
The additionalFields of the device, only will return something when is imported from compatible source.
no setterinherited
commands List<DeviceCommand>?
The commands of the device.
no setterinherited
configParams Map<String, dynamic>?
configParams is the configuration parameters received from the device, this information is used to configure the device.
no setterinherited
copyWith → $DeviceCopyWith<Device>
Create a copy of Device with the given fields replaced by the non-null parameter values.
no setterinherited
flespiToken String?
The flespiToken of the device.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hwModel HwModel?
hwModel is the hardware model of the device.
no setterinherited
hwModelId String?
hwModelId is the hardware model ID of the device.
no setterinherited
id String
no setterinherited
ident String
The ident of the device. Generally, for GPS devices means the IMEI, for other devices means the MAC address or randomly string.
no setterinherited
isSuspended bool?
isSuspended if the asset is suspended.
no setterinherited
linkQr String?
The linkQr of the device, means the QR code generated for auto-config of the Layrz Link app device.
no setterinherited
localIpAddress String?
localIpAddress is the local IP address of the device, used for local communication.
no setterinherited
macAddress String?
macAddress is the MAC address of the device.
no setterinherited
modbus ModbusConfig?
modbus is the configuration of the modbus device.
no setterinherited
model Model?
The model of the device.
no setterinherited
modelId String?
The modelId of the device.
no setterinherited
name String
The name of the device.
no setterinherited
peripherals List<Device>?
peripherals is the list of peripherals of the device. Only used when protocol.operationMode is OperationMode.peripheral.
no setterinherited
phone PhoneNumber?
Is the phone number information linked to this device, can be null.
no setterinherited
protocol InboundProtocol?
The protocol of the device.
no setterinherited
protocolId String?
The protocolId of the device. Only the ID
no setterinherited
qrCode String?
The qrCode of the device.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
telemetry DeviceTelemetry?
Device last message, read the documentation of LastLocation for more information.
no setterinherited
visionCaptureThreshold Duration?
visionCaptureThreshold is the vision capture threshold of the device. This value is the threshold of the indicator displayed on Layrz Vision app.
no setterinherited
visionProfile VisionProfile?
The visionProfile of the device.
no setterinherited
visionProfileId String?
The visionProfileId of the device. Only the ID
no setterinherited

Methods

map<TResult extends Object?>(TResult $default(_Device value)) → TResult

Available on Device, provided by the DevicePatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(_Device value)?) → TResult?

Available on Device, provided by the DevicePatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(_Device value)?, {required TResult orElse()}) → TResult

Available on Device, provided by the DevicePatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>(TResult $default(String id, String name, String ident, String? flespiToken, String? modelId, Model? model, String? protocolId, InboundProtocol? protocol, Map<String, dynamic>? additionalFields, String? qrCode, String? linkQr, List<DeviceCommand>? commands, List<Access>? access, DeviceTelemetry? telemetry, String? visionProfileId, VisionProfile? visionProfile, PhoneNumber? phone, ModbusConfig? modbus, bool? isSuspended, HwModel? hwModel, String? hwModelId, String? macAddress, Map<String, dynamic>? configParams, Duration? visionCaptureThreshold, List<Device>? peripherals, String? localIpAddress)?, {required TResult orElse()}) → TResult

Available on Device, provided by the DevicePatterns extension

A variant of when that fallback to an orElse callback.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes this Device to a JSON map.
inherited
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>(TResult $default(String id, String name, String ident, String? flespiToken, String? modelId, Model? model, String? protocolId, InboundProtocol? protocol, Map<String, dynamic>? additionalFields, String? qrCode, String? linkQr, List<DeviceCommand>? commands, List<Access>? access, DeviceTelemetry? telemetry, String? visionProfileId, VisionProfile? visionProfile, PhoneNumber? phone, ModbusConfig? modbus, bool? isSuspended, HwModel? hwModel, String? hwModelId, String? macAddress, Map<String, dynamic>? configParams, Duration? visionCaptureThreshold, List<Device>? peripherals, String? localIpAddress)) → TResult

Available on Device, provided by the DevicePatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>(TResult? $default(String id, String name, String ident, String? flespiToken, String? modelId, Model? model, String? protocolId, InboundProtocol? protocol, Map<String, dynamic>? additionalFields, String? qrCode, String? linkQr, List<DeviceCommand>? commands, List<Access>? access, DeviceTelemetry? telemetry, String? visionProfileId, VisionProfile? visionProfile, PhoneNumber? phone, ModbusConfig? modbus, bool? isSuspended, HwModel? hwModel, String? hwModelId, String? macAddress, Map<String, dynamic>? configParams, Duration? visionCaptureThreshold, List<Device>? peripherals, String? localIpAddress)?) → TResult?

Available on Device, provided by the DevicePatterns extension

A variant of when that fallback to returning null

Operators

operator ==(Object other) bool
The equality operator.
inherited