addSample method
Add a sample of data for a given topic
The data
supplied should match the type of the topic when it
was published.
timestamp
should not be specified
Implementation
void addSample(NT4Topic topic, dynamic data, [int? timestamp]) {
timestamp ??= _getServerTimeUS();
_lastAnnouncedValues[topic.name] = data;
_lastAnnouncedTimestamps[topic.name] = timestamp;
_wsSendBinary(
mp.serialize([topic.pubUID, timestamp, topic.getTypeId(), data]));
}