public class

TestVehicleInterface

extends Object
implements VehicleInterface
java.lang.Object
   ↳ com.openxc.interfaces.TestVehicleInterface

Summary

Public Constructors
TestVehicleInterface(Context context, String resource)
Public Methods
boolean isConnected()
Return true if the interface is actively connected to the vehicle.
void onPipelineActivated()
void onPipelineDeactivated()
void receive(VehicleMessage measurement)
Receive a data point with a name, a value and a event value.
void setCallback(SourceCallback callback)
Set the callback for receiving raw measurements as they are received.
boolean setResource(String resource)
Change the resource used by the instance to connect to the interface, restarting any neccessary services.
void stop()
Release any acquired resources and either stop sending measurements (if a source) or stop expecting to receive them (if a sink).
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.openxc.DataPipeline.Operator
From interface com.openxc.interfaces.VehicleInterface
From interface com.openxc.sinks.VehicleDataSink
From interface com.openxc.sources.VehicleDataSource

Public Constructors

public TestVehicleInterface (Context context, String resource)

Public Methods

public boolean isConnected ()

Return true if the interface is actively connected to the vehicle.

public void onPipelineActivated ()

public void onPipelineDeactivated ()

public void receive (VehicleMessage measurement)

Receive a data point with a name, a value and a event value. The implementation of this method should not block, lest the vehicle data source get behind in processing data from a source potentially external to the system.

Parameters
measurement The new measurement.

public void setCallback (SourceCallback callback)

Set the callback for receiving raw measurements as they are received. Vehicle data sources only need to support a single callback, and in fact should not support more than one - all vehicle measurements should be directed to a single, central collector.

public boolean setResource (String resource)

Change the resource used by the instance to connect to the interface, restarting any neccessary services.

Parameters
resource The new resource to use for the interface.
Returns
  • true if the resource was different and the interface was restarted.

public void stop ()

Release any acquired resources and either stop sending measurements (if a source) or stop expecting to receive them (if a sink).