赞
踩
/*
* Copyright (C) 2012 Mathias Jeppsson
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* [url]http://www.apache.org/licenses/LICENSE-2.0[/url]
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.primavera.arduino.listener;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.hardware.usb.UsbConstants;
import android.hardware.usb.UsbDevice;
import android.hardware.usb.UsbDeviceConnection;
import android.hardware.usb.UsbEndpoint;
import android.hardware.usb.UsbInterface;
import android.hardware.usb.UsbManager;
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
import android.os.Message;
import android.util.Log;
import android.widget.Toast;
public class ArduinoCommunicatorService extends Service {
private final static String TAG = "ArduinoCommunicatorService";
private final static boolean DEBUG = false;
private boolean mIsRunning = false;
private SenderThread mSenderThread;
private volatile UsbDevice mUsbDevice = null;
private volatile UsbDeviceConnection mUsbConnection = null;
private volatile UsbEndpoint mInUsbEndpoint = null;
private volatile UsbEndpoint mOutUsbEndpoint = null;
final static String DATA_RECEIVED_INTENT = "primavera.arduino
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。