Table of Contents

Class MimeContentBase

Namespace
Geotab.Checkmate.ObjectModel
Assembly
Geotab.Checkmate.ObjectModel.dll

The contents of a TextMessage containing data to give to a IOX Add-On over an RS232. It holds more data than SerialIoxContent and is not compatible with all Add-Ons. For more information regarding Add-On compatible please contact your reseller.

MimeContent is converted into bytes with a specific format. The first byte is the length of the MimeType (N). The next N bytes are the ASCII encoded bytes of the MimeType string. The next two bytes are the length of the Data (L). Finally, the next L bytes are the Data. Messages from MyGeotab will be delivered in this format and messages to MyGeotab must be in this format as well.

public abstract class MimeContentBase : TextMessageContentType
Inheritance
MimeContentBase
Derived
Inherited Members

Constructors

MimeContentBase(MessageContentType)

Initializes a new instance of the MimeContentBase class.

protected MimeContentBase(MessageContentType messageContentType)

Parameters

messageContentType MessageContentType

The message content type.

MimeContentBase(MessageContentType, string?, byte[]?, TimeSpan?, int?)

Initializes a new instance of the MimeContentBase class.

protected MimeContentBase(MessageContentType messageContentType, string? mimeType, byte[]? data, TimeSpan? binaryDataPacketDelay, int? channelNumber)

Parameters

messageContentType MessageContentType

The message content type.

mimeType string

Type of the MIME.

data byte[]

The data.

binaryDataPacketDelay TimeSpan?

The delay to use between sending binary data packets to the GO Device. If null there is no delay. The maximum delay is defined by MaxBinaryDataPacketDelay.

channelNumber int?

The channel number for the MIME.

Fields

MaxBinaryDataPacketDelay

The maximum amount of time that can be used as a delay between binary data packets.

public static readonly TimeSpan MaxBinaryDataPacketDelay

Field Value

TimeSpan

Properties

BinaryDataPacketDelay

Gets or sets the delay to use between sending binary data packets to the GO Device. If null there is no delay. The maximum delay is defined by MaxBinaryDataPacketDelay.

public virtual TimeSpan? BinaryDataPacketDelay { get; set; }

Property Value

TimeSpan?

The delay to use between sending binary data packets to the GO Device. If null there is no delay. The maximum delay is defined by MaxBinaryDataPacketDelay.

ChannelNumber

Gets or sets the channel number to send to an Add-On or that were received from an Add-On. Mandatory field.

public virtual int? ChannelNumber { get; set; }

Property Value

int?

Channel number int.

ComponentType

Gets the component type of the message.

public abstract int ComponentType { get; }

Property Value

int

Channel number int.

Data

Gets or sets the raw bytes to either send to an Add-On or that were received from an Add-On. Maximum 2GB can be sent in a single message.

public virtual byte[]? Data { get; set; }

Property Value

byte[]

Array of byte

MimeType

Gets or sets the media type of content contained in the data field. Free string, Maximum 255 characters.

public virtual string? MimeType { get; set; }

Property Value

string

string

Methods

CheckMimeType(string?)

Check that the new MimeType being set is short enough for one byte to encode the length.

protected static void CheckMimeType(string? newMimeType)

Parameters

newMimeType string

New value being set

Exceptions

ArgumentOutOfRangeException

When new value is too long

CreatePayload()

Create the encoded payload of the message.

protected byte[] CreatePayload()

Returns

byte[]

A byte Array.

PayloadSize()

The length of the message payload.

public int PayloadSize()

Returns

int

Payload size int.