Class GRX1090Client

java.lang.Object
de.serosystems.grx.GRX1090Client

public class GRX1090Client extends Object
This class provides access to the GRX1090 API.

Users can retrieve GPS information, the internal receiver status, tracked aircraft and subscribe to the stream of Mode S messages.

Status Information

The GRX1090 is asynchronous due to its underlying RPC mechanisms. All methods for status information return ListenableFuture.

Streaming Mode S Messages

Mode S messages can be retrieved in a blocking fashion, using an Iterator, or, asynchronously with callbacks, implemented in a StreamObserver

Author:
Markus Fuchs (fuchs@sero-systems.de)
  • Constructor Details

    • GRX1090Client

      public GRX1090Client(String host, int receiverdPort, int monitordPort, int spectrumdPort)
      Create a new client and connect to the given host and gRPC ports. Use GRX1090Client(String) to connect to the default port.
      Parameters:
      host - hostname or IP address of the GRX1090 receiver
      receiverdPort - Port of the receiverd gRPC service
      monitordPort - Port of the monitord gRPC service
      spectrumdPort - Port of the spectrumd gRPC service
    • GRX1090Client

      public GRX1090Client(String host)
      Create a new client and connect to the given GRX1090 host using the default API ports.
      Parameters:
      host - hostname or IP address of the GRX1090 receiver
  • Method Details

    • subscribeModeSDownlink

      public io.grpc.ManagedChannel subscribeModeSDownlink(Set<Integer> downlinkFormats, boolean iqSamples, io.grpc.stub.StreamObserver<ReceiverDProto.ModeSDownlinkFrameWithStreamInfo> observer)
      Subscribe to the stream of Mode S messages using a StreamObserver The method returns a ManagedChannel which can be closed to stop the subscription.
      Parameters:
      downlinkFormats - Set of downlink formats to subscribe. The set must not be empty and contain at least one downlink format (0 <= DF < 33)
      iqSamples - true if IQ samples should also be requested. Note that this can produce significant amounts of data, and if the network capacity is exceeded data will be lost!
      observer - A StreamObserver with callbacks for new message arriving from the GRX1090 receiver
      Returns:
      underlying channel, which can be closed to unsubscribe
      Throws:
      IllegalArgumentException - on invalid downlink formats
    • subscribeModeSDownlink

      public GRX1090Client.ChannelIterator<ReceiverDProto.ModeSDownlinkFrameWithStreamInfo> subscribeModeSDownlink(Set<Integer> downlinkFormats, boolean iqSamples)
      Subscribe to the stream of Mode S messages with or without IQ data. The method returns a GRX1090Client.ChannelIterator which allows retrieving messages in a blocking fashion. To unsubscribe, the Iterator's close() method should be used.
      Parameters:
      downlinkFormats - Set of downlink formats to subscribe. The set must not be empty and contain at least one downlink format (0 <= DF < 33)
      iqSamples - true if IQ samples should also be requested. Note that this can produce significant amounts of data, and if the network capacity is exceeded in data loss!
      Returns:
      ChannelIterator to retrieve messages or quit subscription
      Throws:
      IllegalArgumentException - on invalid downlink formats
    • getAllTargets

      public com.google.common.util.concurrent.ListenableFuture<ReceiverDProto.StateVectorList> getAllTargets()
      Retrieve currently tracked aircraft.
      Returns:
      A Future with tracked aircraft
    • getGNSSInfo

      public com.google.common.util.concurrent.ListenableFuture<MonitorDProto.GNSSInformation> getGNSSInfo()
      Get information about the current GNSS status, including the device's location.
      Returns:
      a Future with the GNSS status.
    • getRadioStatus

      public com.google.common.util.concurrent.ListenableFuture<ReceiverDProto.GetRadioFrontEndStatusReply> getRadioStatus()
      Get information about the status of the receiver's radio front-end
      Returns:
      a Future with the receiver's radio front-end status
    • close

      public void close()
    • getMonitordAPI

      public MonitordGrpc.MonitordFutureStub getMonitordAPI()
      Use this stub if you want to call methods from the monitord API that are not provided by this wrapper.
      Returns:
      the underlying stub for the monitord API
    • getReceiverdAPI

      public ReceiverdGrpc.ReceiverdFutureStub getReceiverdAPI()
      Use this stub if you want to call methods from the receiverd API that are not provided by this wrapper.
      Returns:
      the underlying stub for the receiverd API
    • getSpectrumdAPI

      public SpectrumdGrpc.SpectrumdFutureStub getSpectrumdAPI()
      Use this stub if you want to call methods from the spectrumd API that are not provided by this wrapper.
      Returns:
      the underlying stub for the spectrumd API