Class LeafMqttToTmPacketConverter

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

public class LeafMqttToTmPacketConverter extends Object implements MqttToTmPacketConverter
MQTT packet converter that works with LeafSpace ground stations.

Messages are JSON objects with two fields: timestamp and payload.

timestamp is UTC in ISO 8601 format and is used to set the Earth Reception Time (ERT).

payload is a string with the binary data encoded as a sequence of octets in hexadecimal.

Example:

 {"timestamp": "2024-08-12T22:23:28.430897", "payload": "0x47 0x1c 0xa 0x2"}
 
  • Constructor Details

    • LeafMqttToTmPacketConverter

      public LeafMqttToTmPacketConverter()
  • 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