USBUART
A library for reading/wring data via USB-UART adapters
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Modules
Options.java
Go to the documentation of this file.
1 
5 /*
6  * This file is part of USBUART Library. http://usbuart.info/
7  *
8  * Copyright © 2016 Eugene Hutorny <eugene@hutorny.in.ua>
9  *
10  * The USBUART Library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public License v2
12  * as published by the Free Software Foundation;
13  *
14  * The USBUART Library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17  * See the GNU Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public License
20  * along with the USBUART Library; if not, see
21  * <http://www.gnu.org/licenses/gpl-2.0.html>.
22  */
23 
24 
25 package info.usbuart.service;
26 
28 import static android.system.OsConstants.*;
29 
33 public class Options {
34  public final static int S_IRWUG = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP;
35  public final static int S_IRWALL = S_IRWUG | S_IROTH | S_IWOTH;
36  public final static int S_IRWXUG = S_IRWXU | S_IRWXG;
37  public final static int S_IRWXALL = S_IRWXUG | S_IRWXO;
38  public enum FifoNaming {
39  VIDPID,
40  BusIDDevID,
41  Static
42  }
43 
45  this(protocol, FifoNaming.VIDPID, S_IRWUG, S_IRWXUG, false);
46  }
47  public Options(EIA_TIA_232_Info protocol, FifoNaming naming) {
48  this(protocol, naming, S_IRWUG, S_IRWXUG, false);
49  }
50 
51  public Options(EIA_TIA_232_Info protocol, FifoNaming naming, boolean shared) {
52  this(protocol, naming, shared ? S_IRWALL : S_IRWUG, shared ? S_IRWXALL : S_IRWXUG, false);
53  }
54 
55  public Options(EIA_TIA_232_Info protocol, FifoNaming naming, boolean shared, boolean autoOpen) {
56  this(protocol, naming, shared ? S_IRWALL : S_IRWUG, shared ? S_IRWXALL : S_IRWXUG, autoOpen);
57  }
58 
59  public Options(EIA_TIA_232_Info protocol, FifoNaming naming, int fmod, int dmod, boolean autoOpen) {
60  this.protocol = protocol;
61  this.naming = naming;
62  f_mod = fmod;
63  d_mod = dmod;
64  this.autoOpen = autoOpen;
65  }
66 
68  public final FifoNaming naming;
70  public final EIA_TIA_232_Info protocol;
72  public final int f_mod;
74  public final int d_mod;
76  public final boolean autoOpen;
77 }
final EIA_TIA_232_Info protocol
protocol/line settings
Definition: Options.java:70
final int d_mod
directory access mode
Definition: Options.java:74
final FifoNaming naming
diectory naming convention
Definition: Options.java:68
final boolean autoOpen
if set to true, service automatically opens device and creates fifos when device is attached ...
Definition: Options.java:76
Configuration options for USBUART service.
Definition: Options.java:33
final int f_mod
fifo access mode
Definition: Options.java:72