ModelFactoryGenerateDeviceMessage Method

Generates a new DeviceMessageDto for a device, usually created when the device receiver receives a message.

Definition

Namespace: MobileTrack.Common.Extensions
Assembly: MobileTrack.Common (in MobileTrack.Common.dll) Version: 0.7+1dadc87dcf0a0f837e19a3ce2deb7c1cd85375d1
public static DeviceMessageDto GenerateDeviceMessage(
	DeviceDto? device,
	string? identification,
	Guid lifeCycleId,
	DeviceRequestType eventCode,
	DateTimeOffset when
)

Parameters

device  DeviceDto
Device that send the message
identification  String
OBJ ID of the device
lifeCycleId  Guid
The Life-Cycle ID of the current device receiver instance.
eventCode  DeviceRequestType
Event code (or alarm, or handshake, or positioning)
when  DateTimeOffset
When the message was received by the device receiver. This parameter is type DateTime without offset, as the device receiver is based on Utc

Return Value

DeviceMessageDto
Generated message

Exceptions

ArgumentExceptionThrown if lifeCycleId is Empty.

See Also