本文整理汇总了Java中com.openxc.VehicleManager类的典型用法代码示例。如果您正苦于以下问题:Java VehicleManager类的具体用法?Java VehicleManager怎么用?Java VehicleManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VehicleManager类属于com.openxc包,在下文中一共展示了VehicleManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onServiceConnected
import com.openxc.VehicleManager; //导入依赖的package包/类
public void onServiceConnected(ComponentName className, IBinder service) {
Log.i(TAG, "Bound to VehicleManager");
// When the VehicleManager starts up, we store a reference to it
// here in "mVehicleManager" so we can call functions on it
// elsewhere in our code.
mVehicleManager = ((VehicleManager.VehicleBinder) service)
.getService();
// We want to receive updates whenever the EngineSpeed changes. We
// have an EngineSpeed.Listener (see above, mSpeedListener) and here
// we request that the VehicleManager call its receive() method
// whenever the EngineSpeed changes
mVehicleManager.addListener(EngineSpeed.class, mSpeedListener);
mVehicleManager.addListener(VehicleSpeed.class, mVehicleSpeedListener);
//mVehicleManager.addListener(Longitude.class,longitudeListener);
//mVehicleManager.addListener(Latitude.class,latitudeListener);
setConnectionState(openXcState, true);
}
示例2: setUserVisibleHint
import com.openxc.VehicleManager; //导入依赖的package包/类
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
if (isVisibleToUser) {
getActivity().bindService(
new Intent(getActivity(), VehicleManager.class),
mConnection, Context.BIND_AUTO_CREATE);
} else {
if(mVehicleManager != null) {
Log.i(TAG, "Unbinding from vehicle service");
mVehicleManager.removeListener(CanMessage.class, mListener);
getActivity().unbindService(mConnection);
mVehicleManager = null;
}
}
}
示例3: onReceive
import com.openxc.VehicleManager; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
BluetoothDevice bluetoothDevice = (BluetoothDevice)
intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
if(isVehicleInterface(bluetoothDevice)) {
if(intent.getAction().compareTo(
BluetoothDevice.ACTION_ACL_CONNECTED) == 0){
Log.d(TAG, "A Bluetooth OpenXC VI connected: " + bluetoothDevice.getName());
context.startService(new Intent(context, VehicleManager.class));
context.startService(new Intent(context,
PreferenceManagerService.class));
} else {
Log.d(TAG, "A Bluetooth OpenXC VI disconnected: " + bluetoothDevice.getName());
}
}
}
示例4: setUserVisibleHint
import com.openxc.VehicleManager; //导入依赖的package包/类
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
if (isVisibleToUser) {
getActivity().bindService(
new Intent(getActivity(), VehicleManager.class),
mConnection, Context.BIND_AUTO_CREATE);
} else {
if(mVehicleManager != null) {
Log.i(TAG, "Unbinding from vehicle service");
mVehicleManager.removeListener(SimpleVehicleMessage.class, mListener);
getActivity().unbindService(mConnection);
mVehicleManager = null;
}
}
}
示例5: onCreate
import com.openxc.VehicleManager; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
Log.i(TAG, "Service starting");
bindService(new Intent(this, VehicleManager.class),
mConnection, Context.BIND_AUTO_CREATE);
mPreferenceManagers = new ArrayList<VehiclePreferenceManager>();
mBluetoothPreferenceManager = new BluetoothPreferenceManager(this);
mPreferenceManagers.add(mBluetoothPreferenceManager);
mPreferenceManagers.add(new FileRecordingPreferenceManager(this));
mPreferenceManagers.add(new GpsOverwritePreferenceManager(this));
mPreferenceManagers.add(new NativeGpsPreferenceManager(this));
mPreferenceManagers.add(new UploadingPreferenceManager(this));
mPreferenceManagers.add(new NetworkPreferenceManager(this));
mPreferenceManagers.add(new TraceSourcePreferenceManager(this));
mPreferenceManagers.add(new UsbPreferenceManager(this));
mPreferenceManagers.add(new VehicleInterfacePreferenceManager(this));
}
示例6: onServiceConnected
import com.openxc.VehicleManager; //导入依赖的package包/类
public void
onServiceConnected(ComponentName className, IBinder service) {
Log.i(TAG, "Bound to VehicleManager");
mVehicleManager = ((VehicleManager.VehicleBinder) service)
.getService();
mIsBound = true;
Integer gridPosition = getIntent().getExtras().getInt("pos");
Class<? extends Measurement> measurementType = GridManager
.getClass(gridPosition);
mUpdateGraphTask = new GraphDataRetrieveTask(mVehicleManager,
GrapherActivity.this, dataSeries, measurementType);
mTimer = new Timer();
mTimer.schedule(mUpdateGraphTask, 100, 1000);
}
示例7: RNOpenXcModule
import com.openxc.VehicleManager; //导入依赖的package包/类
public RNOpenXcModule(ReactApplicationContext reactContext, Activity activity) {
super(reactContext);
this.activity = activity;
if(mVehicleManager == null) {
Intent intent = new Intent(activity, VehicleManager.class);
activity.bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
}
}
示例8: onServiceConnected
import com.openxc.VehicleManager; //导入依赖的package包/类
public void onServiceConnected(ComponentName className,
IBinder service) {
Log.i(TAG, "Bound to VehicleManager");
mVehicleManager = ((VehicleManager.VehicleBinder) service)
.getService();
mVehicleManager.addListener(EngineSpeed.class, mSpeedListener);
mVehicleManager.addListener(IgnitionStatus.class, mIgnitionListener);
mVehicleManager.addListener(BrakePedalStatus.class, mBrakePedalListener);
}
示例9: onResume
import com.openxc.VehicleManager; //导入依赖的package包/类
@Override
protected void onResume() {
super.onResume();
// When the activity starts up or returns from the background,
// re-connect to the VehicleManager so we can receive updates.
if (mVehicleManager == null) {
Intent intent = new Intent(this, VehicleManager.class);
bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
}
}
示例10: onServiceConnected
import com.openxc.VehicleManager; //导入依赖的package包/类
public void onServiceConnected(ComponentName className,
IBinder service) {
Log.i(TAG, "Bound to VehicleManager");
mVehicleManager = ((VehicleManager.VehicleBinder)service
).getService();
mVehicleManager.addListener(CanMessage.class, mListener);
}
示例11: PipelineStatusUpdateTask
import com.openxc.VehicleManager; //导入依赖的package包/类
public PipelineStatusUpdateTask(VehicleManager vehicleService,
Activity activity, View fileConnView,
View networkConnView, View bluetoothConnView, View usbConnView,
View noneConnView) {
mVehicleManager = vehicleService;
mActivity = activity;
mFileConnView = fileConnView;
mNetworkConnView = networkConnView;
mBluetoothConnView = bluetoothConnView;
mUsbConnView = usbConnView;
mNoneConnView = noneConnView;
}
示例12: onServiceConnected
import com.openxc.VehicleManager; //导入依赖的package包/类
public void onServiceConnected(ComponentName className,
IBinder service) {
Log.i(TAG, "Bound to VehicleManager");
mVehicleManager = ((VehicleManager.VehicleBinder)service
).getService();
mVehicleManager.addListener(SimpleVehicleMessage.class, mListener);
}
示例13: onServiceConnected
import com.openxc.VehicleManager; //导入依赖的package包/类
public void onServiceConnected(ComponentName className,
IBinder service) {
Log.i(TAG, "Bound to VehicleManager");
mVehicleManager = ((VehicleManager.VehicleBinder)service
).getService();
mVehicleManager.addListener(DiagnosticResponse.class, mListener);
}
示例14: onResume
import com.openxc.VehicleManager; //导入依赖的package包/类
@Override
public void onResume() {
super.onResume();
getActivity().bindService(
new Intent(getActivity(), VehicleManager.class),
mConnection, Context.BIND_AUTO_CREATE);
}
示例15: onServiceConnected
import com.openxc.VehicleManager; //导入依赖的package包/类
public void onServiceConnected(ComponentName className,
IBinder service) {
Log.i(TAG, "Bound to VehicleManager");
mVehicleManager = ((VehicleManager.VehicleBinder)service
).getService();
try {
mVehicleManager.addOnVehicleInterfaceConnectedListener(
mConnectionListener);
} catch(VehicleServiceException e) {
Log.e(TAG, "Unable to register VI connection listener", e);
}
if(mVehicleManager.isViConnected()) {
updateViInfo();
}
new Thread(new Runnable() {
public void run() {
mVehicleManager.waitUntilBound();
if(getActivity() != null) {
getActivity().runOnUiThread(new Runnable() {
public void run() {
mServiceNotRunningWarningView.setVisibility(View.GONE);
}
});
}
}
}).start();
mUpdateMessageCountTask = new MessageCountTask(mVehicleManager,
getActivity(), mMessageCountView);
mUpdatePipelineStatusTask = new PipelineStatusUpdateTask(
mVehicleManager, getActivity(),
mFileConnIV, mNetworkConnIV, mBluetoothConnIV, mUsbConnIV,
mNoneConnView);
mTimer = new Timer();
mTimer.schedule(mUpdateMessageCountTask, 100, 1000);
mTimer.schedule(mUpdatePipelineStatusTask, 100, 1000);
}