USBUART
A library for reading/wring data via USB-UART adapters
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Modules
EIA_TIA_232_Info.java
Go to the documentation of this file.
1 
5 /* This file is part of USBUART Library. http://usbuart.info/
6  *
7  * Copyright (C) 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.api;
24 
25 public class EIA_TIA_232_Info {
26  public enum stop_bits_t {
27  one,
28  _1_5,
29  two
30  };
31  public enum parity_t {
32  none,
33  odd,
34  even,
35  mark,
36  space
37  };
38  public enum flow_control_t {
39  none_,
40  rts_cts,
41  dtr_dsr,
42  xon_xoff
43  };
44 
45  EIA_TIA_232_Info(int br, char db, parity_t p, stop_bits_t sb, flow_control_t fc) {
46  baudrate = br;
47  databits = db;
48  parity = p;
49  stopbits = sb;
50  flowcontrol = fc;
51  }
52  public static final EIA_TIA_232_Info _115200_8N1n() {
53  return new EIA_TIA_232_Info(115200,(char)8,parity_t.none,stop_bits_t.one,flow_control_t.none_);
54  }
55 
56  public int baudrate;
57  public char databits;
58  public parity_t parity;
59  public stop_bits_t stopbits;
60  public flow_control_t flowcontrol;
61 }
enum usbuart::flow_control_enum flow_control_t
Flow control enum.
enum usbuart::stop_bits_enum stop_bits_t
Stop bits enum.
enum usbuart::parity_enum parity_t
Parity enum.