public class TestVehicleInterface extends java.lang.Object implements VehicleInterface
Constructor and Description |
---|
TestVehicleInterface(android.content.Context context,
java.lang.String resource) |
Modifier and Type | Method and Description |
---|---|
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(java.lang.String resource)
Change the resource used by the instance to connect to the interface,
restarting any necessary services.
|
void |
stop()
Release any acquired resources and either stop sending measurements (if a
source) or stop expecting to receive them (if a sink).
|
public TestVehicleInterface(android.content.Context context, java.lang.String resource)
public boolean setResource(java.lang.String resource) throws DataSourceException
VehicleInterface
setResource
in interface VehicleInterface
resource
- The new resource to use for the interface.DataSourceException
public void setCallback(SourceCallback callback)
VehicleDataSource
setCallback
in interface VehicleDataSource
public boolean isConnected()
VehicleInterface
isConnected
in interface VehicleInterface
isConnected
in interface VehicleDataSource
public void stop()
VehicleDataSource
stop
in interface VehicleDataSink
stop
in interface VehicleDataSource
public void receive(VehicleMessage measurement) throws DataSinkException
VehicleDataSink
receive
in interface VehicleDataSink
measurement
- The new measurement.DataSinkException
public void onPipelineActivated()
onPipelineActivated
in interface DataPipeline.Operator
public void onPipelineDeactivated()
onPipelineDeactivated
in interface DataPipeline.Operator