private void init() throws X10FlashException, FileNotFoundException, IOException { cmd.send(Command.CMD09, Command.VAL2, false); cmd.send(Command.CMD10, Command.VALNULL, false); sendLoader(); cmd.send(Command.CMD01, Command.VALNULL, false); loaderident = cmd.getLastReplyString(); MyLogger.getLogger().info(loaderident); cmd.send(Command.CMD09, Command.VAL2, false); }
public void dumpProperties() throws IOException, X10FlashException { TextFile tazone = new TextFile("./tazone.ta", "ISO8859-1"); tazone.open(false); TextFile tazoneS = new TextFile("./tazoneString.ta", "ISO8859-1"); tazoneS.open(false); try { MyLogger.getLogger().info("Start Dumping properties"); MyLogger.initProgress(4920); for (int i = 0; i < 4920; i++) { MyLogger.getLogger() .debug((new StringBuilder("%%% read property id=")).append(i).toString()); cmd.send(Command.CMD12, BytesUtil.getBytesWord(i, 4), false); String reply = cmd.getLastReplyHex(); String replyS = cmd.getLastReplyString(); reply = reply.replace("[", ""); reply = reply.replace("]", ""); reply = reply.replace(",", ""); if (cmd.getLastReplyLength() > 0) { tazone.writeln( HexDump.toHex(i) + " " + HexDump.toHex(cmd.getLastReplyLength()) + " " + reply.trim()); tazoneS.writeln( HexDump.toHex(i) + " " + HexDump.toHex(cmd.getLastReplyLength()) + " " + replyS.trim()); } } MyLogger.initProgress(0); tazone.close(); tazoneS.close(); MyLogger.getLogger().info("Dumping properties finished."); DeviceChangedListener.pause(false); closeDevice(); } catch (Exception ioe) { tazone.close(); tazoneS.close(); MyLogger.initProgress(0); MyLogger.getLogger().error(ioe.getMessage()); MyLogger.getLogger().error("Error dumping properties. Aborted"); DeviceChangedListener.pause(false); closeDevice(); } }