USBUART
A library for reading/wring data via USB-UART adapters
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Modules
IService.java
Go to the documentation of this file.
1 
5 /* This file is part of USBUART Library. http://usbuart.info/
6  *
7  * Copyright © 2016 Eugene Hutorny <eugene@hutorny.in.ua>
8  *
9  * The USBUART Library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public License v2
11  * as published by the Free Software Foundation;
12  *
13  * The USBUART Library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with the USBUART Library; if not, see
20  * <http://www.gnu.org/licenses/gpl-2.0.html>.
21  */
22 
23 package info.usbuart.service;
24 
25 import android.hardware.usb.UsbDevice;
26 import android.os.IInterface;
27 import android.system.ErrnoException;
29 import info.usbuart.api.UsbUartContext;
30 
31 import java.util.Collection;
32 
33 public interface IService extends IInterface {
34  static final String ACTION_USB_PERMISSION = "info.usbuart.testapp.USB_PERMISSION";
35  void attached(UsbDevice device);
36  Collection<UsbDevice> getList();
37  String[] getFifo(String deviceName, int intrface, EIA_TIA_232_Info settings) throws ErrnoException, UsbUartContext.Error;
38  void setOptions(Options options);
39  void addBusListener(BusListener listener);
40  void removeBusListener(BusListener listener);
41  interface BusListener {
42  /* return true to get device open immediately */
43  boolean attached(UsbDevice device);
44  void detached(UsbDevice device);
45  }
46 }
Configuration options for USBUART service.
Definition: Options.java:33