Table of Contents

Class MqttMessageSerializer

Namespace
NominalSystems.External
Assembly
NominalSystems.External.dll

Message encoder system that converts a particular message into a MQTT message

public class MqttMessageSerializer
Inheritance
MqttMessageSerializer

Constructors

MqttMessageSerializer()

public MqttMessageSerializer()

Methods

DecodeFromString<T>(string)

Decodes a message from an MQTT string and returns the type

public T DecodeFromString<T>(string json)

Parameters

json string

The MQTT JSON string

Returns

T

A new struct value

Type Parameters

T

DecodeStringToMessage(string, Message)

Decodes a string to a message and updates the payload

public void DecodeStringToMessage(string json, Message msg)

Parameters

json string

The message string data

msg Message

The message reference

DecodeStringToObject<T>(string)

Decodes a message from an MQTT string and returns the type

public T DecodeStringToObject<T>(string json)

Parameters

json string

The MQTT JSON string

Returns

T

A reference to the data object

Type Parameters

T

EncodeToString(object, double)

Encodes a new message to a string and returns that string that is of the correct MQTT Message type

public string EncodeToString(object value, double time = 0)

Parameters

value object

The new value of the struct

time double

[s] The current time of the simulation

Returns

string

The MQTT string