| | |
| | | private List<String> mAllDevicesList = new ArrayList<>();//搜索到的设备的备注名 |
| | | |
| | | private ProgressDialog mProgressDialog; |
| | | // private static String HDL_PATH_NAME = "/dev/ttyS2"; //串口设备路径名 |
| | | // private static String HDL_PATH_NAME = "/dev/ttyS2"; //串口设备路径名 |
| | | // private static int HDL_BAUDRATE = 115200; //波特率 |
| | | private Boolean bOpen = false; |
| | | private int remarkId = 0; |
| | |
| | | public void onClick(View v) { |
| | | /**全部重新搜索,清空原设备列表数据*/ |
| | | clearListView(); |
| | | HDLDeviceManager.clearAllDeviceList(); |
| | | HDLCommand.getHomeDevices(); |
| | | mProgressDialog.show(); |
| | | } |
| | |
| | | |
| | | for (int i = 0; i < mDevicesDataList.size(); i++) { |
| | | if (TextUtils.isEmpty(mDevicesDataList.get(i).getRemark())) { |
| | | mAllDevicesList.add("暂无备注"); |
| | | mAllDevicesList.add("暂无备注" + "-" + mDevicesDataList.get(i).getSourceSubnetID() + "-" + mDevicesDataList.get(i).getSourceDeviceID()); |
| | | } else { |
| | | mAllDevicesList.add(mDevicesDataList.get(i).getRemark()); |
| | | mAllDevicesList.add(mDevicesDataList.get(i).getRemark() + "-" + mDevicesDataList.get(i).getSourceSubnetID() + "-" + mDevicesDataList.get(i).getSourceDeviceID()); |
| | | } |
| | | } |
| | | mHDLMainListAdapter.notifyDataSetChanged(); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @SuppressWarnings("unused") |
| | | private void closePhone(Context context, String[] shutdown){ |
| | | private void closePhone(Context context, String[] shutdown) { |
| | | try { |
| | | Process process = Runtime.getRuntime().exec(shutdown); |
| | | Process process = Runtime.getRuntime().exec(shutdown); |
| | | } catch (IOException e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |