2using System.Collections.Generic;
3using System.Threading.Tasks;
19 private bool firstReport =
true;
49 this.firstReport =
false;
57 this.value = Content.
Data;
58 this.Timestamp = DateTime.UtcNow;
82 List<Field> Data =
new List<Field>()
88 if (!(this.value is
null) && this.value.Length <= 256)
91 Convert.ToBase64String(
this.value),
FieldType.Momentary,
FieldQoS.AutomaticReadout));
96 return Task.CompletedTask;
112 (n) => Task.FromResult<
string>(Convert.ToBase64String(
this.value)),
115 this.value = Convert.FromBase64String(v);
116 this.Topic.MqttClient.PUBLISH(this.Topic.FullTopic, this.QoS, this.Retain, this.value);
117 return Task.CompletedTask;
127 if (this.value is
null)
129 else if (this.value.Length == 1)
132 this.
Information(Output, this.value.Length.ToString() +
" bytes.");
Information about content received from the MQTT server.
MqttHeader Header
MQTT Header
Contains information about a language.
Task< string > GetStringAsync(Type Type, int Id, string Default)
Gets the string value of a string ID. If no such string exists, a string is created with the default ...
Abstract base class for control parameters.
String control parameter.
Represents an MQTT topic with base64-encoded binary data.
const string RegExString
Regular expression for BASE64-encoded data.
Represents an MQTT topic with binary data.
override Task StartReadout(ThingReference ThingReference, ISensorReadout Request, string Prefix, bool Last)
Starts a readout of the data.
override Task< string > GetTypeName(Language Language)
Type name representing data.
override Grade DefaultSupport
Default support.
BinaryData(MqttTopic Topic, byte[] Value)
Represents an MQTT topic with binary data.
override void SnifferOutput(ICommunicationLayer Output)
Outputs the parsed data to the sniffer.
override ControlParameter[] GetControlParameters()
TODO
override bool IsControllable
TODO
override Task< DataProcessingResult > DataReported(MqttTopic Topic, MqttContent Content)
Called when new data has been published.
override IMqttData CreateNew(MqttTopic Topic, MqttContent Content)
Creates a new instance of the data.
BinaryData()
Represents an MQTT topic with binary data.
Abstract base class for MQTT data encapsulations.
void Information(ICommunicationLayer Output, string Info)
Outputs information to sniffer.
MqttTopic Topic
Topic used
DateTime Timestamp
Timestamp of data reception.
string Append(string Prefix, string Name)
Appends a name to a topic name.
IMqttData FindDataType(MqttContent Content)
FInds best implementation to process binary data.
A Metering node representing an MQTT topic
Represents a 32-bit integer value.
Represents a string value.
Contains a reference to a thing
Interface for observable classes implementing communication protocols.
Interface for classes managing sensor data readouts.
Task ReportFields(bool Done, params Field[] Fields)
Report read fields to the client.
Interface for MQTT Data encapsulations
Task< DataProcessingResult > DataReported(MqttTopic Topic, MqttContent Content)
Called when new data has been published.
DataProcessingResult
Results from processing an incoming message.
FieldQoS
Field Quality of Service flags
FieldType
Field Type flags