资源简介
通过USB与PLC设备进行通信,从而控制PLC设备。sdk是在前人的基础上进行定制封装,可重复利用。目前已在某洗车设备上进行使用。
代码片段和文件信息
/* Copyright 2011-2013 Google Inc.
* Copyright 2013 mike wakerly
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not write to the Free Software
* Foundation Inc. 51 Franklin Street Fifth Floor Boston MA 02110-1301
* USA.
*
* Project home page: https://github.com/mik3y/usb-serial-for-android
*/
package com.hoho.android.usbserial.examples;
import android.app.Activity;
import android.content.Context;
import android.hardware.usb.UsbDevice;
import android.hardware.usb.UsbManager;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.TwoLineListItem;
import com.hoho.android.usbserial.driver.UsbSerialDriver;
import com.hoho.android.usbserial.driver.UsbSerialPort;
import com.hoho.android.usbserial.driver.UsbSerialProber;
import com.hoho.android.usbserial.util.HexDump;
import java.util.ArrayList;
import java.util.List;
/**
* Shows a {@link ListView} of available USB devices.
*
* @author mike wakerly (opensource@hoho.com)
*/
public class DeviceListActivity extends Activity {
private final String TAG = DeviceListActivity.class.getSimpleName();
private UsbManager mUsbManager;
private ListView mListView;
private TextView mProgressBartitle;
private ProgressBar mProgressBar;
private static final int MESSAGE_REFRESH = 101;
private static final long REFRESH_TIMEOUT_MILLIS = 5000;
private final Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case MESSAGE_REFRESH:
refreshDeviceList();
mHandler.sendEmptyMessageDelayed(MESSAGE_REFRESH REFRESH_TIMEOUT_MILLIS);
break;
default:
super.handleMessage(msg);
break;
}
}
};
private List mEntries = new ArrayList();
private ArrayAdapter mAdapter;
@Override
public void onCreate(Bundle saved
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-01-11 17:35 USBToSerialPort\
目录 0 2019-01-11 09:06 USBToSerialPort\usb-serial-for-android-master\
文件 6148 2017-12-15 16:50 USBToSerialPort\usb-serial-for-android-master\.DS_Store
目录 0 2019-01-11 17:35 __MACOSX\
目录 0 2019-01-11 17:35 __MACOSX\USBToSerialPort\
目录 0 2019-01-11 17:35 __MACOSX\USBToSerialPort\usb-serial-for-android-master\
文件 120 2017-12-15 16:50 __MACOSX\USBToSerialPort\usb-serial-for-android-master\._.DS_Store
文件 962 2019-01-11 09:06 USBToSerialPort\usb-serial-for-android-master\usb-serial-for-android-master.iml
文件 420 2019-01-11 09:04 USBToSerialPort\usb-serial-for-android-master\local.properties
文件 5587 2016-09-11 13:32 USBToSerialPort\usb-serial-for-android-master\README.md
文件 212 2016-09-11 13:32 __MACOSX\USBToSerialPort\usb-serial-for-android-master\._README.md
目录 0 2016-09-11 13:32 USBToSerialPort\usb-serial-for-android-master\gradle\
目录 0 2019-01-11 09:03 USBToSerialPort\usb-serial-for-android-master\gradle\wrapper\
文件 49896 2016-09-11 13:32 USBToSerialPort\usb-serial-for-android-master\gradle\wrapper\gradle-wrapper.jar
目录 0 2019-01-11 17:35 __MACOSX\USBToSerialPort\usb-serial-for-android-master\gradle\
目录 0 2019-01-11 17:35 __MACOSX\USBToSerialPort\usb-serial-for-android-master\gradle\wrapper\
文件 212 2016-09-11 13:32 __MACOSX\USBToSerialPort\usb-serial-for-android-master\gradle\wrapper\._gradle-wrapper.jar
文件 230 2019-01-11 09:03 USBToSerialPort\usb-serial-for-android-master\gradle\wrapper\gradle-wrapper.properties
文件 212 2019-01-11 09:03 __MACOSX\USBToSerialPort\usb-serial-for-android-master\gradle\._wrapper
文件 212 2016-09-11 13:32 __MACOSX\USBToSerialPort\usb-serial-for-android-master\._gradle
目录 0 2016-09-11 13:32 USBToSerialPort\usb-serial-for-android-master\arduino\
文件 1348 2016-09-11 13:32 USBToSerialPort\usb-serial-for-android-master\arduino\serial_test.ino
目录 0 2019-01-11 17:35 __MACOSX\USBToSerialPort\usb-serial-for-android-master\arduino\
文件 212 2016-09-11 13:32 __MACOSX\USBToSerialPort\usb-serial-for-android-master\arduino\._serial_test.ino
文件 212 2016-09-11 13:32 __MACOSX\USBToSerialPort\usb-serial-for-android-master\._arduino
文件 5080 2016-09-11 13:32 USBToSerialPort\usb-serial-for-android-master\gradlew
文件 212 2016-09-11 13:32 __MACOSX\USBToSerialPort\usb-serial-for-android-master\._gradlew
文件 506 2016-09-11 13:32 USBToSerialPort\usb-serial-for-android-master\.gitignore
文件 212 2016-09-11 13:32 __MACOSX\USBToSerialPort\usb-serial-for-android-master\._.gitignore
文件 262 2019-01-11 09:05 USBToSerialPort\usb-serial-for-android-master\build.gradle
目录 0 2019-01-11 09:06 USBToSerialPort\usb-serial-for-android-master\.gradle\
............此处省略254个文件信息
- 上一篇:javaweb实验报告
- 下一篇:基于JAVA的简单的文件内容分加密解密窗口化设计
相关资源
- 西门子s7-200 Smart plc modbus tcp 通讯代码
- modbus的读写java实现
- modbus4j.jar 和 seroUtils.jar
- java与plc通讯
- 原生JAVA读写PLC
- modbus4j 2019-3最新jar包
- JAVA程序与PLC通信——学习使用
- java实现MODBUS通讯
- 安卓版Modbus通用通讯软件
- Modbus4j最新Maven工程源码+seroUtils
- modbus采集jar包
- Java_Modbus的操作()
- modbus4j-3.0.4-SNAPSHOT.jar
- modbus4j 相关jar包 3.0.5-SNAPSHOT.jar
- jamod和modbus4J
- Java应用程序的Modbus4j串口通讯
- modbus+seroutils+2.0.2+rxtx-2.1-7一套解决j
- modbus4jDemo
- Modbus读取写入模拟量寄存器详细demo
- Android通过串口操控Modbus设备
- modbusTCP协议java实现带注释
- s7-200 224xp plc发送高频脉冲控制步进电
- 读写modbus协议的java包
- JAVA程序与PLC之间的通信
- modbus4j全部jar包
- android Modbus Rtu 通讯
评论
共有 条评论