79,10 → 79,13 |
private static void readConfiguration(String portIdentifier, String fileName) throws IOException { |
IMUConfiguration cs = readConfiguration(portIdentifier); |
if (cs != null) { |
FileWriter fw = new FileWriter(fileName); |
fw.write(cs.toXML()); |
fw.close(); |
if (fileName != null) { |
FileWriter fw = new FileWriter(fileName); |
fw.write(cs.toXML()); |
fw.close(); |
} |
} |
System.out.println(cs.toXML()); |
} |
|
private static WriteIMUConfigurationRequestFrame parseXMLIMUConfiguration(InputStream input) throws IOException { |
187,12 → 190,12 |
public static void main(String[] args) throws IOException { |
if (!"r".equals(args[0]) && !"w".equals(args[0])) help(); |
if ("w".equals(args[0]) && (args.length!=2)) help(); |
if ("r".equals(args[0]) && (args.length!=2)) help(); |
if ("r".equals(args[0]) && (args.length>2)) help(); |
|
String portIdentifier = null; |
|
if ("r".equals(args[0])) { |
readConfiguration(portIdentifier, args[1]); |
readConfiguration(portIdentifier, args.length<2 ? null : args[1]); |
} else { |
writeConfiguration(portIdentifier, args[1]); |
} |