public void onServiceConnected(ComponentName className, IBinder service) { Log.i(TAG, "Bound to VehicleManager"); mVehicleManager = ((VehicleManager.VehicleBinder)service ).getService(); mVehicleManager.addListener(SimpleVehicleMessage.class, mListener); mVehicleManager.addListener(EventedSimpleVehicleMessage.class, mListener); }
/** * Register to receive a callback when a message with the given key is * received. * * @param key The key you want to receive updates. * @param listener An listener instance to receive the callback. */ public void addListener(MessageKey key, VehicleMessage.Listener listener) { addListener(ExactKeyMatcher.buildExactMatcher(key), listener); }
public void onServiceConnected(ComponentName className, IBinder service) { Log.i(TAG, "Bound to VehicleManager"); mVehicleManager = ((VehicleManager.VehicleBinder)service ).getService(); mVehicleManager.addListener(CanMessage.class, mListener); }
public void onServiceConnected(ComponentName className, IBinder service) { Log.i(TAG, "Bound to VehicleManager"); mVehicleManager = ((VehicleManager.VehicleBinder)service ).getService(); mVehicleManager.addListener(DiagnosticResponse.class, mListener); }
/** * Register to receive a callback when a message with same key as the given * KeyedMessage is received. * * @param keyedMessage A message with the key you want to receive updates * for - the response to a command typically has the same key as the * request, so you can use the outgoing message's KeyedMessage to * register to receive a response. * @param listener An listener instance to receive the callback. */ public void addListener(KeyedMessage keyedMessage, VehicleMessage.Listener listener) { addListener(keyedMessage.getKey(), listener); }
Log.d(TAG, "Enabled overwriting native GPS with OpenXC GPS"); mVehicleManager.addListener(Latitude.class, this); mVehicleManager.addListener(Longitude.class, this); mVehicleManager.addListener(VehicleSpeed.class, this);