App.java 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package net.hkzlab.dupal;
  2. import net.hkzlab.devices.PAL16R6Specs;
  3. import net.hkzlab.devices.PALSpecs;
  4. import net.hkzlab.dupal.boardio.DuPALAnalyzer;
  5. import net.hkzlab.dupal.boardio.DuPALManager;
  6. public class App {
  7. public static void main(String[] args) throws Exception {
  8. DuPALManager dpm = new DuPALManager("/dev/ttyUSB0");
  9. PALSpecs pspecs = new PAL16R6Specs();
  10. DuPALAnalyzer dpan = new DuPALAnalyzer(dpm, pspecs);
  11. dpan.startAnalisys();
  12. /*
  13. try {
  14. System.out.println(dpm.enterRemoteMode());
  15. for(int idx = 0; idx <= 0xFFFF; idx++) {
  16. dpm.writeCommand(DuPALProto.buildWRITECommand(idx));
  17. int addr = DuPALProto.handleWRITEResponse(dpm.readResponse());
  18. if(addr >= 0) {
  19. System.out.println("idx -> " + idx + " written -> " + addr);
  20. } else {
  21. System.out.println("Write error!");
  22. break;
  23. }
  24. dpm.writeCommand(DuPALProto.buildREADCommand());
  25. System.out.println("Read ... " + DuPALProto.handleREADResponse(dpm.readResponse()));
  26. }
  27. } finally {
  28. dpm.cleanup();
  29. }
  30. */
  31. //SubState ss = new SubState("TEST", new byte[] {-1, 0, -1, 0, -1, -1});
  32. //System.out.println(ss.toString());
  33. //System.out.println(ss.hashCode());
  34. //MacroState ms = new MacroState("TEST", new boolean[] {true, true, false, true}, 3);
  35. //System.out.println(ms.toString());
  36. //System.out.println(ms.hashCode());
  37. }
  38. }