1 /*
2  * This file is part of Arduino.
3  *
4  * Arduino is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17  *
18  * As a special exception, you may use this file as part of a free software
19  * library without restriction.  Specifically, if other files instantiate
20  * templates or use macros or inline functions from this file, or you compile
21  * this file and link it with other files to produce an executable, this
22  * file does not by itself cause the resulting executable to be covered by
23  * the GNU General Public License.  This exception does not however
24  * invalidate any other reasons why the executable file might be covered by
25  * the GNU General Public License.
26  *
27  * Copyright 2013 Arduino LLC (http://www.arduino.cc/)
28  */
29 
30 package cc.arduino.packages;
31 
32 import processing.app.helpers.PreferencesMap;
33 
34 public class BoardPort {
35 
36   private String address;
37   private String protocol;
38   private String boardName;
39   private String vid;
40   private String pid;
41   private String iserial;
42   private String label;
43   private final PreferencesMap prefs;
44   private boolean online;
45 
BoardPort()46   public BoardPort() {
47     this.prefs = new PreferencesMap();
48   }
49 
getAddress()50   public String getAddress() {
51     return address;
52   }
53 
setAddress(String address)54   public void setAddress(String address) {
55     this.address = address;
56   }
57 
getProtocol()58   public String getProtocol() {
59     return protocol;
60   }
61 
setProtocol(String protocol)62   public void setProtocol(String protocol) {
63     this.protocol = protocol;
64   }
65 
getBoardName()66   public String getBoardName() {
67     return boardName;
68   }
69 
setBoardName(String boardName)70   public void setBoardName(String boardName) {
71     this.boardName = boardName;
72   }
73 
getPrefs()74   public PreferencesMap getPrefs() {
75     return prefs;
76   }
77 
setLabel(String label)78   public void setLabel(String label) {
79     this.label = label;
80   }
81 
getLabel()82   public String getLabel() {
83     return label;
84   }
85 
setOnlineStatus(boolean online)86   public void setOnlineStatus(boolean online) {
87     this.online = online;
88   }
89 
isOnline()90   public boolean isOnline() {
91     return online;
92   }
93 
setVIDPID(String vid, String pid)94   public void setVIDPID(String vid, String pid) {
95     this.vid = vid;
96     this.pid = pid;
97   }
98 
getVID()99   public String getVID() {
100     return vid;
101   }
102 
getPID()103   public String getPID() {
104     return pid;
105   }
106 
setISerial(String iserial)107   public void setISerial(String iserial) {
108     this.iserial = iserial;
109   }
getISerial()110   public String getISerial() {
111     return iserial;
112   }
113 
114   @Override
toString()115   public String toString() {
116     return this.address+"_"+this.vid+"_"+this.pid;
117   }
118 }
119