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.8+34f1bbd8dc6b32752cfce829cbed66e15113d7ba
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