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
stringThe 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
DecodeStringToObject<T>(string)
Decodes a message from an MQTT string and returns the type
public T DecodeStringToObject<T>(string json)
Parameters
json
stringThe 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
Returns
- string
The MQTT string