Skip to content

DeviceRegistration

Identifies the physical device that fills a DeviceConfiguration role in a deployment.

A registration is sent to the DeploymentService with registerDevice when a device joins a study deployment. Treat this as an abstract base class. If a simple device registration is needed, use a DefaultDeviceRegistration.

Inheritance
Implementers
Annotations

Constructors

DeviceRegistration.fromJson

DeviceRegistration.fromJson(
  1. Map<String, dynamic> json
)

DeviceRegistration

DeviceRegistration({
  1. String? deviceId,
  2. String? deviceDisplayName,
  3. DateTime? registrationCreatedOn,
})

Properties

deviceDisplayName

String? deviceDisplayName
getter/setter pair

An optional concise textual representation for display purposes describing the key specifications of the device. E.g., device manufacturer, name, and operating system version.

deviceId

String deviceId
getter/setter pair

An ID for the device, used to disambiguate between devices of the same type, as provided by the device itself. It is up to specific types of devices to guarantee uniqueness across all devices of the same type. A random UUID (v4) if not specified.

fromJsonFunction

Function get fromJsonFunction
override

The function which can convert a JSON string to an object of this type.

jsonType

String get jsonType
override

Return the __type to be used for JSON serialization of this class. Default is runtimeType. Only specify this if you need another type.

registrationCreatedOn

DateTime registrationCreatedOn
getter/setter pair

The registration time in UTC. Defaults to the time of creation.

Methods

toJson

Map<String, dynamic> toJson()
override

Return a JSON encoding of this object.

toString

String toString()
override

A string representation of this object.

Some classes have a default textual representation, often paired with a static parse function (like int.parse). These classes will provide the textual representation as their string representation.

Other classes have no meaningful textual representation that a program will care about. Such classes will typically override toString to provide useful information when inspecting the object, mainly for debugging or logging.