public class

VehicleMessage

extends Object
implements Parcelable Comparable<T>
java.lang.Object
   ↳ com.openxc.messages.VehicleMessage
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

The VehicleMessage is the most basic, root form of data going back and forth between the OpenXC library and a vehicle interface. The VI's data stream is message based, where each message is a subtype of a VehicleMessage. This base class implements Parcelable, so it can be sent over an AIDL interface, i.e. between the singleton VehicleService and the VehicleManager instance in each app's process.

Summary

Nested Classes
interface VehicleMessage.Listener  
Constants
String EXTRAS_KEY
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<VehicleMessage> CREATOR
Public Constructors
VehicleMessage()
VehicleMessage(Long timestamp)
Construct a new empty VehicleMessage.
VehicleMessage(Long timestamp, Map<StringObject> extras)
Construct a new VehicleMessage with the given extra data and an overridden timestamp.
VehicleMessage(Map<StringObject> extras)
Construct a new VehicleMessage with the given extra data.
Protected Constructors
VehicleMessage(Parcel in)
Public Methods
CanMessage asCanMessage()
CommandResponse asCommandResponse()
DiagnosticRequest asDiagnosticRequest()
DiagnosticResponse asDiagnosticResponse()
EventedSimpleVehicleMessage asEventedMessage()
KeyedMessage asKeyedMessage()
NamedVehicleMessage asNamedMessage()
SimpleVehicleMessage asSimpleMessage()
int compareTo(VehicleMessage other)
int describeContents()
boolean equals(Object obj)
Date getDate()
Map<StringObject> getExtras()
Long getTimestamp()
boolean hasExtras()
boolean isTimestamped()
void setExtras(Map<StringObject> extras)
void setTimestamp(Long timestamp)
Override the timestamp of the message.
void timestamp()
String toString()
void untimestamp()
Make the message's timestamp invalid so it won't end up in the serialized version.
void writeToParcel(Parcel out, int flags)
Protected Methods
void readFromParcel(Parcel in)
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable
From interface java.lang.Comparable

Constants

public static final String EXTRAS_KEY

Constant Value: "extras"

Fields

public static final Creator<VehicleMessage> CREATOR

Public Constructors

public VehicleMessage ()

public VehicleMessage (Long timestamp)

Construct a new empty VehicleMessage.

Parameters
timestamp timestamp as milliseconds since unix epoch

public VehicleMessage (Long timestamp, Map<StringObject> extras)

Construct a new VehicleMessage with the given extra data and an overridden timestamp.

public VehicleMessage (Map<StringObject> extras)

Construct a new VehicleMessage with the given extra data. The extras field can hold any arbitrary key/value pairs.

Parameters
extras A map of any extra data to attach to this message.

Protected Constructors

protected VehicleMessage (Parcel in)

Public Methods

public CanMessage asCanMessage ()

public CommandResponse asCommandResponse ()

public DiagnosticRequest asDiagnosticRequest ()

public DiagnosticResponse asDiagnosticResponse ()

public EventedSimpleVehicleMessage asEventedMessage ()

public KeyedMessage asKeyedMessage ()

public NamedVehicleMessage asNamedMessage ()

public SimpleVehicleMessage asSimpleMessage ()

public int compareTo (VehicleMessage other)

public int describeContents ()

public boolean equals (Object obj)

public Date getDate ()

public Map<StringObject> getExtras ()

public Long getTimestamp ()

Returns
  • the timestamp of the message in milliseconds since the UNIX epoch.

public boolean hasExtras ()

public boolean isTimestamped ()

Returns
  • true if the message has a valid timestamp.

public void setExtras (Map<StringObject> extras)

public void setTimestamp (Long timestamp)

Override the timestamp of the message.

Parameters
timestamp the timestamp to set for this message.

public void timestamp ()

public String toString ()

public void untimestamp ()

Make the message's timestamp invalid so it won't end up in the serialized version.

public void writeToParcel (Parcel out, int flags)

Protected Methods

protected void readFromParcel (Parcel in)