Class DefaultMqttToTmPacketConverter

java.lang.Object
org.yamcs.mqtt.DefaultMqttToTmPacketConverter
All Implemented Interfaces:
MqttToTmPacketConverter

public class DefaultMqttToTmPacketConverter extends Object implements MqttToTmPacketConverter
Default MQTT packet converter - it uses the message payload as the TM packet: one mqtt message = one tm packet

It sets the

  • Constructor Details

    • DefaultMqttToTmPacketConverter

      public DefaultMqttToTmPacketConverter()
  • Method Details

    • init

      public void init(String yamcsInstance, String linkName, YConfiguration config)
      Description copied from interface: MqttToTmPacketConverter
      Called at initialisation; the config may be empty but won't be null.
      Specified by:
      init in interface MqttToTmPacketConverter
    • convert

      public List<TmPacket> convert(org.eclipse.paho.client.mqttv3.MqttMessage message)
      Description copied from interface: MqttToTmPacketConverter
      Converts an incoming MQTT message to an iterable collection of TmPacket objects.

      The implementation is responsible for setting the reception time and the data part of each TmPacket. Other fields in the TmPacket are optional and can be left unpopulated.

      The returned Iterable may yield no elements if the message cannot be converted.

      Specified by:
      convert in interface MqttToTmPacketConverter
      Parameters:
      message - the MQTT message to be converted
      Returns:
      an Iterable of TmPacket objects, possibly empty