Package de.serosystems.grx
Class GRX1090Client
java.lang.Object
de.serosystems.grx.GRX1090Client
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)
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
An iterator that allows closing the underlying channel -
Constructor Summary
ConstructorDescriptionGRX1090Client
(String host) Create a new client and connect to the given GRX1090 host using the default API ports.GRX1090Client
(String host, int receiverdPort, int monitordPort, int spectrumdPort) Create a new client and connect to the given host and gRPC ports. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
com.google.common.util.concurrent.ListenableFuture<ReceiverDProto.StateVectorList>
Retrieve currently tracked aircraft.com.google.common.util.concurrent.ListenableFuture<MonitorDProto.GNSSInformation>
Get information about the current GNSS status, including the device's location.Use this stub if you want to call methods from the monitord API that are not provided by this wrapper.com.google.common.util.concurrent.ListenableFuture<ReceiverDProto.GetRadioFrontEndStatusReply>
Get information about the status of the receiver's radio front-endUse this stub if you want to call methods from the receiverd API that are not provided by this wrapper.Use this stub if you want to call methods from the spectrumd API that are not provided by this wrapper.subscribeModeSDownlink
(Set<Integer> downlinkFormats, boolean iqSamples) Subscribe to the stream of Mode S messages with or without IQ data.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 aStreamObserver
The method returns aManagedChannel
which can be closed to stop the subscription.
-
Constructor Details
-
GRX1090Client
Create a new client and connect to the given host and gRPC ports. UseGRX1090Client(String)
to connect to the default port.- Parameters:
host
- hostname or IP address of the GRX1090 receiverreceiverdPort
- Port of the receiverd gRPC servicemonitordPort
- Port of the monitord gRPC servicespectrumdPort
- Port of the spectrumd gRPC service
-
GRX1090Client
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 aStreamObserver
The method returns aManagedChannel
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 aGRX1090Client.ChannelIterator
which allows retrieving messages in a blocking fashion. To unsubscribe, the Iterator'sclose()
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
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
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
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
-