Rev 1613 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1613 | Rev 1690 | ||
---|---|---|---|
Line 77... | Line 77... | ||
77 | } |
77 | } |
Line 78... | Line 78... | ||
78 | 78 | ||
79 | private static void readConfiguration(String portIdentifier, String fileName) throws IOException { |
79 | private static void readConfiguration(String portIdentifier, String fileName) throws IOException { |
80 | IMUConfiguration cs = readConfiguration(portIdentifier); |
80 | IMUConfiguration cs = readConfiguration(portIdentifier); |
- | 81 | if (cs != null) { |
|
81 | if (cs != null) { |
82 | if (fileName != null) { |
82 | FileWriter fw = new FileWriter(fileName); |
83 | FileWriter fw = new FileWriter(fileName); |
83 | fw.write(cs.toXML()); |
84 | fw.write(cs.toXML()); |
- | 85 | fw.close(); |
|
84 | fw.close(); |
86 | } |
- | 87 | } |
|
85 | } |
88 | System.out.println(cs.toXML()); |
Line 86... | Line 89... | ||
86 | } |
89 | } |
87 | 90 | ||
88 | private static WriteIMUConfigurationRequestFrame parseXMLIMUConfiguration(InputStream input) throws IOException { |
91 | private static WriteIMUConfigurationRequestFrame parseXMLIMUConfiguration(InputStream input) throws IOException { |
Line 185... | Line 188... | ||
185 | } |
188 | } |
Line 186... | Line 189... | ||
186 | 189 | ||
187 | public static void main(String[] args) throws IOException { |
190 | public static void main(String[] args) throws IOException { |
188 | if (!"r".equals(args[0]) && !"w".equals(args[0])) help(); |
191 | if (!"r".equals(args[0]) && !"w".equals(args[0])) help(); |
189 | if ("w".equals(args[0]) && (args.length!=2)) help(); |
192 | if ("w".equals(args[0]) && (args.length!=2)) help(); |
Line 190... | Line 193... | ||
190 | if ("r".equals(args[0]) && (args.length!=2)) help(); |
193 | if ("r".equals(args[0]) && (args.length>2)) help(); |
Line 191... | Line 194... | ||
191 | 194 | ||
192 | String portIdentifier = null; |
195 | String portIdentifier = null; |
193 | 196 | ||
194 | if ("r".equals(args[0])) { |
197 | if ("r".equals(args[0])) { |
195 | readConfiguration(portIdentifier, args[1]); |
198 | readConfiguration(portIdentifier, args.length<2 ? null : args[1]); |
196 | } else { |
199 | } else { |
197 | writeConfiguration(portIdentifier, args[1]); |
200 | writeConfiguration(portIdentifier, args[1]); |