public boolean openDevice(boolean simulate) { if (simulate) return true; boolean found = false; try { USBFlash.open(); phoneident = new String(USBFlash.getLastReply()); cmd = new Command(_bundle.simulate()); cmd.send(Command.CMD01, Command.VALNULL, false); loaderident = new String(USBFlash.getLastReply()); found = true; } catch (Exception e) { found = false; } return found; }
private void sendTA(InputStream in, String name) throws FileNotFoundException, IOException, X10FlashException { try { TaFile ta = new TaFile(in); MyLogger.getLogger().info("Flashing " + name); Vector<TaEntry> entries = ta.entries(); for (int i = 0; i < entries.size(); i++) { MyLogger.getLogger().info("TA value : " + HexDump.toHex(entries.get(i).getWordbyte())); if (!_bundle.simulate()) { cmd.send(Command.CMD13, entries.get(i).getWordbyte(), false); } } } catch (TaParseException tae) { MyLogger.getLogger().error("Error parsing TA file. Skipping"); } }
public boolean openDevice() { return openDevice(_bundle.simulate()); }