Something went wrong. Try again.
Completely reimplimented in zig (eventually)
Something went wrong. Try again.
Java
at main
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723package com.microchip.mplab.ipelib.device;
import com.microchip.crownking.edc.Programming;import com.microchip.crownking.mplabinfo.DeviceSupport.ToolSupport;import com.microchip.crownking.mplabinfo.FamilyDefinitions.Family;import com.microchip.crownking.mplabinfo.FamilyDefinitions.SubFamily;import com.microchip.mplab.comm.MPLABCommEvent;import com.microchip.mplab.comm.MPLABCommProviderInterface;import com.microchip.mplab.comm.MPLABCommStringDescriptor;import com.microchip.mplab.comm.MPLABCommTool;import com.microchip.mplab.crownkingx.xPIC;import com.microchip.mplab.ipelib.common.SharedData;import com.microchip.mplab.ipelib.tools.IPENotifier;import com.microchip.mplab.ipelib.toolsupport.ToolSupportProvider;import com.microchip.mplab.libs.packmanagerservice.interfaces.MPLABPackContext;import com.microchip.mplab.libs.packmanagerservice.packmanagerservicefactory.PackManagerService;import com.microchip.mplab.libs.toolpacksupport.interfaces.ToolPackRelease;import com.microchip.mplab.logger.MPLABLogger;import com.microchip.mplab.mdbcore.MessageMediator.Message;import com.microchip.mplab.mdbcore.assemblies.Assembly;import com.microchip.mplab.mdbcore.assemblies.AssemblyFactory;import com.microchip.mplab.mdbcore.checksum.Checksum;import com.microchip.mplab.mdbcore.checksum.common.BufferChecksumHelper.MemoryRegion;import com.microchip.mplab.mdbcore.common.debug.CommonUtils;import com.microchip.mplab.mdbcore.common.debug.CommonEnumerations.coordinatedResetOperation;import com.microchip.mplab.mdbcore.debugger.DebugException;import com.microchip.mplab.mdbcore.debugger.Debugger;import com.microchip.mplab.mdbcore.debugger.MCDebugger;import com.microchip.mplab.mdbcore.debugger.MDBDebugTool;import com.microchip.mplab.mdbcore.debugger.SDCardInterface;import com.microchip.mplab.mdbcore.debugger.Debugger.CONNECTION_TYPE;import com.microchip.mplab.mdbcore.debugger.Debugger.PROGRAM_OPERATION;import com.microchip.mplab.mdbcore.debugger.MDBDebugTool.MEMTYPE;import com.microchip.mplab.mdbcore.pa.service.commands.FirmwareInfo;import com.microchip.mplab.mdbcore.platformtool.PlatformTool;import com.microchip.mplab.mdbcore.platformtool.PlatformToolBrowser;import com.microchip.mplab.mdbcore.platformtool.PlatformToolMeta;import com.microchip.mplab.mdbcore.platformtool.PlatformToolMetaManager;import com.microchip.mplab.mdbcore.platformtool.util.PlatformMPLABCommStringParser;import com.microchip.mplab.mdbcore.pm5.service.commands.responses.Pm5Versions;import com.microchip.mplab.mdbcore.pm5.service.utils.ServiceQueries;import com.microchip.mplab.mdbcore.pm5.service.utils.ServiceQueryException;import com.microchip.mplab.mdbcore.sqtpenv.SQTPEnvironment;import com.microchip.mplab.mdbcore.sqtpenv.SQTPEnvironment.SQTPError;import com.microchip.mplab.mdbcore.sqtpenv.pm3EnvExtractor.EnvStructure;import com.microchip.mplab.util.observers.Observer;import java.io.File;import java.util.ArrayList;import java.util.HashMap;import java.util.LinkedHashMap;import java.util.List;import java.util.Map;import java.util.Optional;import java.util.logging.Level;import org.openide.util.Lookup;import org.openide.util.Utilities;import org.openide.util.Lookup.Result;
public class ToolsLookup implements Observer { PlatformToolBrowser browser = null; ArrayList toolsList = new ArrayList(); ArrayList Serial_toolsList = new ArrayList(); private SharedData sharedData; List<PlatformTool> connectedTools; private String s = ""; private AssemblyFactory af; private Assembly session = null; public boolean toolChanged = false; private IPENotifier ipeNotify = null; private boolean hold_tool_scan = false; private HashMap<String, ToolsLookup.ToolDetails> mytoolsmap; private boolean isPM3ToolOnly = false; private String deviceToCheck; private static int pm3Count = 0; private MPLABCommProviderInterface comm = null; private boolean holdInReset = true; private ServiceQueries pm5Services = null;
public ToolsLookup(boolean noDoScan) { this.ipeNotify = IPENotifier.getIPENotifierController(); this.browser = new PlatformToolBrowser(this); this.sharedData = SharedData.getSingletonObject(); this.mytoolsmap = new LinkedHashMap<>(); this.isPM3ToolOnly = true; }
public ToolsLookup() { this.ipeNotify = IPENotifier.getIPENotifierController(); this.browser = new PlatformToolBrowser(this); this.sharedData = SharedData.getSingletonObject(); this.mytoolsmap = new HashMap<>();
try { boolean var1 = this.doScan(); } catch (Exception var2) { } }
public void UpdateToolList() { this.doScan(); this.ipeNotify.setToolList(this.toolsList, ""); }
public boolean Pm3hasSDCard() { Debugger mdb = this.sharedData.getDebugger(); boolean retVal = false; if (!this.sharedData.getAssemblySession().GetToolName().contains("PM3")) { return false; } else { try { if (mdb != null) { this.s = ""; this.hold_tool_scan = true; mdb.Connect(CONNECTION_TYPE.PROGRAMMER); retVal = this.sharedData.getSDCardInterface().PM3hasSDCard(); } else { retVal = false; } } catch (Exception var4) { this.s = var4.toString(); retVal = false; }
this.hold_tool_scan = false; return retVal; } }
public boolean FormatPM3SDCard() { Debugger mdb = this.sharedData.getDebugger(); boolean retVal = false;
try { if (mdb != null) { this.s = ""; this.hold_tool_scan = true; mdb.Connect(CONNECTION_TYPE.PROGRAMMER); retVal = this.sharedData.getSDCardInterface().FormatPM3SDCard(); } else { retVal = false; } } catch (Exception var4) { this.s = var4.toString(); retVal = false; }
this.hold_tool_scan = false; return retVal; }
public EnvStructure getEnvStructure() { EnvStructure retVal = null;
try { this.s = ""; this.hold_tool_scan = true; retVal = ((SQTPEnvironment)this.sharedData.getAssemblySession().lookup(SQTPEnvironment.class)).getEnvStructure(); } catch (Exception var3) { this.s = var3.toString(); retVal = null; }
this.hold_tool_scan = false; return retVal; }
public String GetPM3EnvironmentFromPM3SDCard(String path, boolean b) { Debugger mdb = this.sharedData.getDebugger(); String retVal = "";
try { if (mdb != null) { this.s = ""; this.hold_tool_scan = true; mdb.Connect(CONNECTION_TYPE.PROGRAMMER); retVal = this.sharedData.getSDCardInterface().GetPM3EnvironmentFromPM3SDCard(path, b); } else { retVal = ""; } } catch (Exception var6) { this.s = var6.toString(); retVal = ""; }
this.hold_tool_scan = false; return retVal; }
public boolean transferImageToPM3() { if (this.isGreaterThan1MB()) { IPENotifier.getIPENotifierController().setMessageNotification("Transferring image is not supported for this device."); return false; } else { Debugger mdb = this.sharedData.getDebugger(); boolean retVal = false; if (!this.sharedData.getAssemblySession().GetToolName().contains("PM3")) { return false; } else { try { if (mdb != null) { this.s = ""; mdb.Connect(CONNECTION_TYPE.PROGRAMMER); retVal = this.sharedData.getSDCardInterface().TransferToPM3(); } else { retVal = false; } } catch (Exception var4) { this.s = var4.toString(); retVal = false; }
return retVal; } } }
private boolean isGreaterThan1MB() { boolean isGreaterthan1MB = false; xPIC picdevicedb = this.session.GetDevice(); if (picdevicedb != null && (picdevicedb.getFamily() == Family.SEE || picdevicedb.getFamily() == Family.SST)) { if (((Long)picdevicedb.getEEDataRange().second + 1L - (Long)picdevicedb.getEEDataRange().first) / 1048576L > 1L) { isGreaterthan1MB = true; } } else if (picdevicedb.getSubFamily() == SubFamily.PIC32 && ((Long)picdevicedb.getCodeRange().second + 1L - (Long)picdevicedb.getCodeRange().first) / 1048576L > 1L) { isGreaterthan1MB = true; }
return isGreaterthan1MB; }
public boolean transferImageFromPM3() { if (this.isGreaterThan1MB()) { IPENotifier.getIPENotifierController().setMessageNotification("\nTransferring image is not supported for this device.\n"); return false; } else { Debugger mdb = this.sharedData.getDebugger(); boolean retVal = false; if (!this.sharedData.getAssemblySession().GetToolName().contains("PM3")) { return false; } else { try { if (mdb != null) { this.s = ""; mdb.Connect(CONNECTION_TYPE.PROGRAMMER); retVal = this.sharedData.getSDCardInterface().TransferToPC(); } else { retVal = false; } } catch (Exception var4) { this.s = var4.toString(); retVal = false; }
return retVal; } } }
public ArrayList getSerialToolsList() { return this.Serial_toolsList; }
public String getDeviceID() { Debugger mdb = this.sharedData.getDebugger(); String t = "";
try { t = mdb.GetDeviceIDInfo(); } catch (DebugException var4) { }
return t; }
public List getConnectedTools() { return this.connectedTools; }
public static <T> ArrayList<T> removeDuplicates(ArrayList<T> list) { ArrayList<T> newList = new ArrayList<>();
for (T element : list) { if (!newList.contains(element)) { newList.add(element); } }
return newList; }
private boolean doScan() { String smallName = null; if (this.browser == null) { return false; } else { this.toolsList.clear(); pm3Count = 0; this.browser.scan(); this.connectedTools = this.browser.getExistingTools(); Map<Integer, Boolean> toolAvailability = this.browser.getToolAvailability();
for (PlatformTool t : this.connectedTools) { String platformToolID = t.getID(); String platformToolClassName = PlatformToolMetaManager.getTool(platformToolID).getClassName(); String platformToolFlavor = PlatformToolMetaManager.getTool(platformToolID).getFlavor(); List<ToolSupport> ts = null; ts = PlatformToolMetaManager.getTool(platformToolID).getToolSupportForDevice(this.deviceToCheck); String sNo = PlatformMPLABCommStringParser.getSerialNumber(t.getToolDescriptor()); if (sNo.contains("null") && t.getToolDescriptor().contains("<ipa>")) { sNo = this.getIPAddressFromDescription(t.getToolDescriptor()); }
String toolDesc = t.getToolDescriptor(); ToolSupportProvider toolserprovider = ToolSupportProvider.getSingletonObject(); toolserprovider.setToolSerialNumber(sNo); int totals = 0; boolean supported = true; if (sNo != null) { totals++;
for (PlatformToolMeta meta : PlatformToolMetaManager.getAllTools()) { supported = true; if (t.getID().equalsIgnoreCase(meta.getID())) { smallName = t.getName(); if (smallName.equalsIgnoreCase("pm3")) { pm3Count++; } break; }
supported = false; }
if (supported) { if (toolAvailability != null && toolAvailability.containsKey(t.getIndex()) && !toolAvailability.get(t.getIndex()) && Utilities.isWindows()) { smallName = "Incompatible driver -" + smallName; }
String toDisplay = smallName + " S.No : " + sNo; if (smallName.contains("PM5") && this.isIPAddress(sNo)) { toDisplay = smallName + " IP:" + sNo; }
if (smallName.contains("PM3") && pm3Count > 1) { this.ipeNotify.setMessageNotification("Warning: More than one PM3 is connected\n"); }
this.toolsList.add(toDisplay); this.toolsList = removeDuplicates(this.toolsList); ToolsLookup.ToolDetails toolDetails = new ToolsLookup.ToolDetails(); toolDetails.toolClass = platformToolClassName; toolDetails.toolFlavour = platformToolFlavor; toolDetails.toolSN = toolDesc; toolDetails.ts = ts; toolDetails.toolID = platformToolID; toolDetails.toolName = smallName; this.mytoolsmap.put(toDisplay, toolDetails); } } }
return true; } }
public void initAttachTool() { this.comm = (MPLABCommProviderInterface)Lookup.getDefault().lookup(MPLABCommProviderInterface.class); if (this.comm != null) { this.comm.Attach(this, null); } }
public String getToolIDFromMapInfo(String toolAsShown) { String retID = null; ToolsLookup.ToolDetails td = this.mytoolsmap.get(toolAsShown); if (td != null) { retID = td.toolID; }
return retID; }
public List<ToolSupport> getSupport(String toolAsShown, String dev) { this.deviceToCheck = dev; this.doScan(); return this.mytoolsmap.get(toolAsShown).ts; }
public String[] doScan_matlab() { String smallName = null; PlatformToolBrowser browser = new PlatformToolBrowser(this); if (browser != null) { this.toolsList.clear(); browser.scan(); this.connectedTools = browser.getExistingTools(); String[] tList = new String[this.connectedTools.size()]; int ind = 0;
for (PlatformTool t : this.connectedTools) { String platformToolID = t.getID(); String platformToolClassName = PlatformToolMetaManager.getTool(platformToolID).getClassName(); String platformToolFlavor = PlatformToolMetaManager.getTool(platformToolID).getFlavor(); String sNo = PlatformMPLABCommStringParser.getSerialNumber(t.getToolDescriptor()); String toolDesc = t.getToolDescriptor(); int totals = 0; boolean supported = true; if (sNo != null) { totals++; supported = true; if (t.getID().equals("RealICEPlatformTool")) { smallName = "Real ICE"; } else if (t.getID().equals("PICkit3PlatformTool")) { smallName = "PICkit3"; } else if (t.getID().equals("ICD3PlatformTool")) { smallName = "ICD 3"; } else if (t.getID().equals("PM3PlatformTool")) { smallName = "PM3"; } else if (t.getID().equals("PK3OBPlatformTool")) { smallName = "PKOB"; } else if (t.getID().equals("PKOBSKDEPlatformTool")) { smallName = "PKOB SKDE"; } else if (t.getID().equals("pk4hybrid")) { smallName = "PICkit4"; } else { supported = false; }
if (supported) { String toDisplay = smallName + " S.No : " + sNo; tList[ind] = toDisplay; ind++; this.toolsList.add(toDisplay); ToolsLookup.ToolDetails toolDetails = new ToolsLookup.ToolDetails(); toolDetails.toolClass = platformToolClassName; toolDetails.toolFlavour = platformToolFlavor; toolDetails.toolSN = toolDesc; toolDetails.toolID = platformToolID; this.mytoolsmap.put(toDisplay, toolDetails); } } }
return tList; } else { return null; } }
public boolean readMemory() throws DebugException { int retDebugBit = 0; boolean retVal = false; Debugger mdb = this.sharedData.getDebugger(); if (!this.sharedData.getAssemblySession().GetPluginBoardName().equals("")) { mdb.Disconnect(); }
try { if (mdb == null) { return false; }
this.s = ""; this.hold_tool_scan = true; mdb.Connect(CONNECTION_TYPE.PROGRAMMER); retDebugBit = mdb.UploadRawDebugImage(); if (retDebugBit != 0) { if (!this.sharedData.getUIMode()) { System.out.println("IPE:Warning: Debug bit is set on target image. This may not run correctly in production.\n"); } else { this.ipeNotify.setMessageNotification("Warning: Debug bit is set on target image. This may not run correctly in production.\n"); } }
retVal = true; } catch (Exception var7) { this.s = var7.toString(); if (var7 instanceof DebugException && ((DebugException)var7).Code() == 11) { if (!this.sharedData.getUIMode()) { throw (DebugException)var7; }
com.microchip.mplab.mdbcore.MessageMediator.MessageMediator mm = (com.microchip.mplab.mdbcore.MessageMediator.MessageMediator)Lookup.getDefault() .lookup(com.microchip.mplab.mdbcore.MessageMediator.MessageMediator.class); Message msg = new Message(var7.getMessage(), "Partition mode mismatch", null, 35); mm.handleMessage(msg, 12); }
retVal = false; }
this.hold_tool_scan = false; return retVal; }
public boolean eraseMemory() { boolean retVal = false; Debugger mdb = this.sharedData.getDebugger(); if (!this.sharedData.getAssemblySession().GetPluginBoardName().equals("")) { mdb.Disconnect(); }
try { if (mdb != null) { this.s = ""; this.hold_tool_scan = true; mdb.Connect(CONNECTION_TYPE.PROGRAMMER); mdb.Erase(); retVal = true; } else { retVal = false; } } catch (Exception var4) { this.s = var4.toString(); retVal = false; }
this.hold_tool_scan = false; return retVal; }
public boolean WriteMemory() { boolean retVal = false; Debugger mdb = this.sharedData.getDebugger(); if (!this.sharedData.getAssemblySession().GetPluginBoardName().equals("")) { mdb.Disconnect(); }
try { if (mdb == null) { return retVal; }
this.s = ""; this.hold_tool_scan = true; if (this.isCoordinatedResetAndProgramOpRequired()) { CECOTPSupport cecObject = new CECOTPSupport(mdb, this.session); retVal = cecObject.processCECOTPMemory(false); } else { mdb.Connect(CONNECTION_TYPE.PROGRAMMER); mdb.Program(PROGRAM_OPERATION.AUTO_SELECT); retVal = true; } } catch (Exception var4) { this.s = var4.toString(); retVal = false; }
this.hold_tool_scan = false; return retVal; }
public boolean verifyMemory() { boolean result = false; Debugger mdb = this.sharedData.getDebugger(); if (!this.sharedData.getAssemblySession().GetPluginBoardName().equals("")) { mdb.Disconnect(); }
try { if (mdb == null) { return false; }
this.s = ""; this.hold_tool_scan = true; if (this.isCoordinatedResetAndProgramOpRequired() && this.sharedData.getOTPForCECDevice()) { CECOTPSupport cecObject = new CECOTPSupport(mdb, this.session); result = cecObject.processCECOTPMemory(true); } else { mdb.Connect(CONNECTION_TYPE.PROGRAMMER); result = mdb.Verify(); } } catch (Exception var4) { this.s = var4.toString(); this.ipeNotify.setMessageNotification("IPE:Verify Failed"); result = false; }
this.hold_tool_scan = false; return result; }
public String getErrorString() { return this.s; }
public boolean blankCheck() { boolean result = false; Debugger mdb = this.sharedData.getDebugger(); if (!this.sharedData.getAssemblySession().GetPluginBoardName().equals("")) { mdb.Disconnect(); }
try { if (mdb == null) { return false; }
this.s = ""; this.hold_tool_scan = true; mdb.Connect(CONNECTION_TYPE.PROGRAMMER); result = mdb.BlankCheck(); } catch (Exception var4) { this.s = var4.toString(); this.ipeNotify.setMessageNotification("IPE:Blank Check Failed"); result = false; }
this.hold_tool_scan = false; return result; }
public boolean justConnect() { Debugger mdb = this.sharedData.getDebugger();
try { if (mdb == null) { return false; }
this.s = ""; this.hold_tool_scan = true; mdb.Connect(CONNECTION_TYPE.PROGRAMMER); } catch (Exception var3) { this.s = var3.toString(); return false; }
this.hold_tool_scan = false; return true; }
public boolean createAssemblySession(String deviceName) { this.af = (AssemblyFactory)Lookup.getDefault().lookup(AssemblyFactory.class);
try { this.session = this.af.Create(deviceName); } catch (Exception var3) { return false; }
if (this.session != null) { this.session.SetHeader(""); this.session.SetPluginBoard(""); if (this.session != null) { this.sharedData = SharedData.getSingletonObject(); this.sharedData.setAssembly(this.session); }
if (this.af != null) { this.sharedData = SharedData.getSingletonObject(); this.sharedData.setassemblyFactory(this.af); }
return true; } else { return false; } }
public boolean createAssemblySession(String deviceSelected, String packName, String packVersion, String packVendor, ToolPackRelease toolPackRelease) { this.af = (AssemblyFactory)Lookup.getDefault().lookup(AssemblyFactory.class);
try { MPLABPackContext pack = new MPLABPackContext(packName, packVersion, packVendor); this.session = this.af.Create(deviceSelected, PackManagerService.getDeviceProvider().getDevice(deviceSelected, pack), toolPackRelease); } catch (Exception var7) { return false; }
if (this.session != null) { this.session.SetHeader(""); this.session.SetPluginBoard(""); this.sharedData = SharedData.getSingletonObject(); this.sharedData.setAssembly(this.session); if (this.af != null) { this.sharedData.setassemblyFactory(this.af); return true; } else { return false; } } else { return false; } }
public void Update(Object test) { MPLABCommEvent event = (MPLABCommEvent)test; MPLABCommTool tool = event.Tool; int index = event.ListIndex; MPLABCommStringDescriptor dev = (MPLABCommStringDescriptor)tool.GetDescriptor(-2, 0, 0); this.comm = (MPLABCommProviderInterface)Lookup.getDefault().lookup(MPLABCommProviderInterface.class); String friendlyName = this.comm.GetFriendlyName(index); PlatformTool t = this.getToolInfoFromToolString(dev.content, index, friendlyName); if (event.EventType == 1) { try { if (!this.hold_tool_scan) { boolean retVal = this.doScan(); retVal = this.ipeNotify.setToolList(this.toolsList, ""); } } catch (Exception var12) { } } else if (event.EventType == 0) { if (t != null && t.getName().contains("PM3") && pm3Count > 0) { pm3Count--; }
try { String smallName = ""; if (!this.hold_tool_scan) { this.doScan();
for (PlatformToolMeta meta : PlatformToolMetaManager.getAllTools()) { if (t.getID().equalsIgnoreCase(meta.getID())) { smallName = t.getName(); break; } }
String sNo = PlatformMPLABCommStringParser.getSerialNumber(t.getToolDescriptor()); this.ipeNotify.setToolList(this.toolsList, smallName + " S.No : " + sNo); } } catch (Exception var13) { } } }
private PlatformTool getToolInfoFromToolString(String toolString, int index, String friendlyName) { String[] fields = PlatformMPLABCommStringParser.splitFields(toolString); String vid = PlatformMPLABCommStringParser.getVid(fields); String pid = PlatformMPLABCommStringParser.getPid(fields); String serialNumber = PlatformMPLABCommStringParser.getSerialNumber(toolString); String toolID = null; String toolName = null; String product = null; PlatformToolMeta platformTool; if (vid != null && !vid.isEmpty() && pid != null && !pid.isEmpty()) { platformTool = PlatformToolMetaManager.getToolWithVIDPID(vid + pid); } else { platformTool = PlatformToolMetaManager.getToolWithManAndProd( PlatformMPLABCommStringParser.getManufacturerString(toolString), PlatformMPLABCommStringParser.getProductIDString(toolString) ); }
if (platformTool != null) { toolID = platformTool.getID(); toolName = platformTool.getName(); product = platformTool.getProduct(); }
PlatformTool res = null; if (toolName != null) { res = new PlatformTool(toolID, toolName, index, toolString, friendlyName, vid + pid, product); }
return res; }
public boolean connectNonROHSPM3(Debugger mdb) { boolean retVal = false; if (mdb != null) { this.af .ChangeTool( this.session, "PM3PlatformTool", "com.microchip.mplab.mdbcore.PM3.PgmToolManager", "programmer", ":=MPLABComm-USB-Microchip:=<vid>04D8:=<pid>A001:=<rev>0004:=<man>?:=<prod>?:=<sn>?:=<drv>x:=<xpt>b:=end" );
try { mdb.Connect(CONNECTION_TYPE.PROGRAMMER); retVal = true; } catch (DebugException var4) { retVal = false; } }
return retVal; }
private String getPM3SerialNoInformation() { MPLABCommProviderInterface commProviderInterface = null; if (commProviderInterface == null) { commProviderInterface = (MPLABCommProviderInterface)Lookup.getDefault().lookup(MPLABCommProviderInterface.class); }
if (commProviderInterface != null) { Map<Integer, String> toolMap = commProviderInterface.GetCurrentToolList();
for (int i : toolMap.keySet()) { String dev = toolMap.get(i); if (commProviderInterface.GetToolState(i, 0) == 1 && dev.contains("A001")) { return dev; } } }
return null; }
public Boolean getPM3SerialInformation() { boolean retval = false; if (Boolean.parseBoolean(this.session.GetToolProperties().getProperty("com.port", "false"))) { this.Serial_toolsList.clear(); MPLABCommProviderInterface commProviderInterface = null; if (commProviderInterface == null) { commProviderInterface = (MPLABCommProviderInterface)Lookup.getDefault().lookup(MPLABCommProviderInterface.class); }
if (commProviderInterface != null) { Map<Integer, String> toolMap = commProviderInterface.GetCurrentToolList(null, "MPLABComm-USB(04D8),MPLABComm-SERIALPORT-Range(1-100)", null, null);
for (int i : toolMap.keySet()) { String dev = toolMap.get(i); if (commProviderInterface.GetToolState(i, 0) == 1 && dev.contains("SERIAL")) { int ind = dev.indexOf("COM"); int ind1 = dev.indexOf(":=end"); String port = dev.substring(ind, ind1); this.Serial_toolsList.add(this.Serial_toolsList.size(), "PM3 " + port); ToolsLookup.ToolDetails td = new ToolsLookup.ToolDetails(); td.toolID = "PM3PlatformTool"; td.toolClass = "com.microchip.mplab.mdbcore.PM3.PgmToolManager"; td.toolFlavour = "programmer"; td.toolSN = dev; this.mytoolsmap.put("PM3 " + port, td); retval = true; } } }
return retval; } else { this.doScan(); this.ipeNotify.setToolList(this.toolsList, ""); return true; } }
private String getIPAddressFromDescription(String description) { String prod = "?"; int si = description.indexOf(":=<ipa>"); if (si != -1) { String ssn = description.substring(si + 7); int ei = ssn.indexOf(":="); prod = ssn.substring(0, ei); }
return prod; }
public boolean createDebuggerSession(String toolCboxitem) { boolean retVal = false;
try { if (toolCboxitem != null && !this.isPM3ToolOnly) { ToolsLookup.ToolDetails toolInfo = this.mytoolsmap.get(toolCboxitem); if (toolInfo != null) { if (toolInfo.toolSN.contains("<ipa>")) { String ip = this.getIPAddressFromDescription(toolInfo.toolSN); this.session.GetToolProperties().setProperty("pm5.ethernet.ipaddress", ip); }
this.af.ChangeTool(this.session, toolInfo.toolID, toolInfo.toolClass, toolInfo.toolFlavour, toolInfo.toolSN); retVal = true; } }
if (this.isPM3ToolOnly) { String retString = this.getPM3SerialNoInformation(); if (retString != null) { this.af.ChangeTool(this.session, "PM3PlatformTool", "com.microchip.mplab.mdbcore.PM3.PgmToolManager", "programmer", retString); retVal = true; } }
if (!this.sharedData.getUIMode()) { this.sharedData.getassemblyFactory().SetToolProperties(this.session, this.sharedData.getCoreParameters()); }
Debugger mdb = (Debugger)this.session.getLookup().lookup(Debugger.class); this.sharedData.setDebugger(mdb); SDCardInterface sdc = (SDCardInterface)this.session.getLookup().lookup(SDCardInterface.class); this.sharedData.setSDCard(sdc); } catch (Exception var5) { var5.printStackTrace(); retVal = false; }
return retVal; }
public boolean Connect() { boolean retVal = false; Debugger mdb = this.sharedData.getDebugger(); if (mdb != null) { try { this.hold_tool_scan = true; mdb.Connect(CONNECTION_TYPE.PROGRAMMER); retVal = true; } catch (DebugException var4) { retVal = false; }
this.sharedData.setDebugger(mdb); }
this.hold_tool_scan = false; return retVal; }
public boolean disconnectTarget() { boolean result = false;
try { Debugger mdb = this.sharedData.getDebugger(); if (mdb != null) { mdb.Disconnect(); this.sharedData.setDebugger(mdb); }
return result; } catch (Exception var3) { this.s = var3.toString(); return false; } }
public void releaseFromReset() throws DebugException { Debugger mdb = this.sharedData.getDebugger(); if (mdb != null) { this.holdInReset = false; mdb.ReleaseFromReset(); } }
public void holdInReset() throws DebugException { Debugger mdb = this.sharedData.getDebugger(); if (mdb != null) { this.holdInReset = true; mdb.HoldInReset(); } }
public boolean connectAsPTG() { Debugger mdb = this.sharedData.getDebugger(); if (mdb != null) { mdb.Disconnect();
try { this.hold_tool_scan = true; mdb.Connect(CONNECTION_TYPE.PROGRAMMER_TO_GO); if (this.holdInReset) { mdb.HoldInReset(); }
mdb.Program(PROGRAM_OPERATION.PROGRAMMER_TO_GO); return true; } catch (DebugException var3) { return false; } } else { this.hold_tool_scan = false; return false; } }
public ArrayList getActiveToolList() { boolean retVal = this.doScan(); return retVal ? this.toolsList : null; }
public ArrayList getCurrentAvailableToolList() { return this.toolsList; }
public long getCRC32(File f) { Checksum ckSum = (Checksum)this.sharedData.getAssemblySession().lookup(Checksum.class); long ret = -1L;
try { ret = ckSum.getCRC32FileChecksum(f); } catch (Exception var6) { ret = -1L; }
return ret; }
public long getChecksum() { Checksum ckSum = (Checksum)this.sharedData.getAssemblySession().lookup(Checksum.class); long ret = -1L;
try { ret = ckSum.getChecksum(false); } catch (Exception var5) { ret = -1L; }
return ret; }
public long getUnprotectedCsum() { Checksum ckSum = (Checksum)this.sharedData.getAssemblySession().lookup(Checksum.class); long ret = -1L;
try { ret = ckSum.getUnprotectedChecksum(); } catch (Exception var5) { ret = -1L; }
return ret; }
public long getEEChecksum() { Checksum ckSum = (Checksum)this.sharedData.getAssemblySession().lookup(Checksum.class); long ret = -1L;
try { ret = ckSum.getEEPROMonlyChecksum(); } catch (Exception var5) { ret = -1L; }
return ret; }
public long getFlashdataChecksum() { Checksum ckSum = (Checksum)this.sharedData.getAssemblySession().lookup(Checksum.class); long ret = -1L;
try { ret = ckSum.getFlashDataonlyChecksum(); } catch (Exception var5) { ret = -1L; }
return ret; }
public boolean hasChecksum() { boolean bHasChecksum = true; xPIC picdevicedb = this.session.GetDevice();
try { if (picdevicedb instanceof xPIC) { Programming program = picdevicedb.getProgramming(); if (program != null) { bHasChecksum = program.getAsBooleanElse("haschecksum", true); if (picdevicedb.getFamily() == Family.ARM32BIT || picdevicedb.getFamily() == Family.AVR || !bHasChecksum) { bHasChecksum = false; } } } } catch (Exception var4) { MPLABLogger.mplog.log(Level.INFO, var4.getMessage()); }
return bHasChecksum; }
public Map<MemoryRegion, Long> getBufferChecksum() { Map<MemoryRegion, Long> res = null;
try { Checksum ckSum = (Checksum)this.sharedData.getAssemblySession().lookup(Checksum.class); res = ckSum.getBufferChecksum(); } catch (Exception var3) { res = null; }
return res; }
public boolean setSQTPEnvironment() { boolean retVal = false; SQTPEnvironment SQTPEnv = (SQTPEnvironment)this.sharedData.getAssemblySession().lookup(SQTPEnvironment.class); if (SQTPEnv != null) { this.sharedData.setSQTPEnvironment(SQTPEnv); retVal = SQTPEnv.intializeEnvironment(); } else { retVal = false; }
return retVal; }
public boolean loadEnvironment(String path) { boolean retVal = false; SQTPEnvironment SQTPEnv = this.sharedData.getSQTPEnvironment(); if (SQTPEnv != null) { System.out.print("IPE:Loading Environment..."); retVal = SQTPEnv.LoadPM3File(path); } else { retVal = false; }
return retVal; }
public boolean deleteEnvironment(String path) { boolean retVal = false; SQTPEnvironment SQTPEnv = this.sharedData.getSQTPEnvironment(); if (SQTPEnv != null) { retVal = SQTPEnv.deleteEnvironment(path); } else { retVal = false; }
return retVal; }
public boolean viewEnviroment(String path) { boolean retVal = false; SQTPEnvironment SQTPEnv = this.sharedData.getSQTPEnvironment(); if (SQTPEnv != null) { retVal = SQTPEnv.viewEnvironment(path); } else { retVal = false; }
return retVal; }
public boolean copyEnviroment(String srcPath, String dstPath, String srcEnvString, String dstEnvString) { boolean retVal = false; SQTPEnvironment SQTPEnv = this.sharedData.getSQTPEnvironment(); if (SQTPEnv != null) { retVal = SQTPEnv.copyEnvironment(srcPath, dstPath, srcEnvString, dstEnvString); } else { retVal = false; }
return retVal; }
public boolean saveEnvironment(String envPath, String envName, boolean isPM3File, String sqtpFile, String miscFile, String envDesc) { boolean retVal = false; SQTPEnvironment SQTPEnv = this.sharedData.getSQTPEnvironment(); if (SQTPEnv != null) { retVal = SQTPEnv.saveEnvironment(envPath, envName, isPM3File, sqtpFile, miscFile, envDesc); } else { retVal = false; }
if (!retVal) { this.disconnectTarget(); }
return retVal; }
public SQTPError setSQTPSequence(String numPath) { SQTPError error = null; SQTPEnvironment SQTPEnv = this.sharedData.getSQTPEnvironment(); if (SQTPEnv != null) { error = SQTPEnv.LoadSQTPValue(numPath); } else { error = SQTPError.OTHER_ERROR; }
return error; }
public void UnloadSQTPFile() { SQTPError error = null; SQTPEnvironment SQTPEnv = this.sharedData.getSQTPEnvironment(); if (SQTPEnv != null) { SQTPEnv.UnloadSQTPFile(); } }
public SQTPError loadNextSQTPSequence(String numPath) { SQTPError error = null; SQTPEnvironment SQTPEnv = this.sharedData.getSQTPEnvironment(); if (numPath.contains("MPLAB PM3 Card")) { SDCardInterface sdcard = this.sharedData.getSDCardInterface(); String num = numPath.replace("\\", "/"); num = num.replace("MPLAB PM3 Card/", ""); sdcard.UpdatePm3SQTPFile(num); }
if (SQTPEnv != null) { error = SQTPEnv.LoadSQTPValue(numPath); if (error == SQTPError.SUCCESS) { error = SQTPEnv.LoadNextSQTPValue(); error = SQTPEnv.LoadSQTPValue(numPath); Long address = SQTPEnv.getAddressValue(); String memType = SQTPEnv.getmemType(); String nextSqtpSequence = SQTPEnv.getNextSqtpValuetobeLoaded(); if (error != SQTPError.FILE_EXHAUSTED) { String msg = "Next SQTP: (Data = 0x" + nextSqtpSequence + " , Address = 0x" + Long.toHexString(address) + " Region = " + memType + ")"; IPENotifier.getIPENotifierController().setMessageNotification(msg + "\n"); } } } else { error = SQTPError.OTHER_ERROR; }
return error; }
public int getPM3Checksum() { int retVal = -1; SDCardInterface si = this.sharedData.getSDCardInterface(); if (si != null) { retVal = si.GetDeviceChecksum(); }
return retVal; }
public int getPM3DeviceID() { int retVal = -1; SDCardInterface si = this.sharedData.getSDCardInterface(); if (si != null) { retVal = si.GetDeviceId(); }
return retVal; }
public boolean DownloadOS(String path) { boolean retVal = false; SDCardInterface si = this.sharedData.getSDCardInterface(); if (si != null) { retVal = si.DownloadOS(path); }
return retVal; }
public boolean DownloadBIOS(String path) { boolean retVal = false; SDCardInterface si = this.sharedData.getSDCardInterface(); if (si != null) { retVal = si.DownloadBIOS(path); }
return retVal; }
public boolean DownloadDB(String path) { boolean retVal = false; SDCardInterface si = this.sharedData.getSDCardInterface(); if (si != null) { retVal = si.DownloadDB(path); }
return retVal; }
public int getPM3DeviceIDRevision() { int retVal = -1; SDCardInterface si = this.sharedData.getSDCardInterface(); if (si != null) { retVal = si.GetDeviceIdRevision(); }
return retVal; }
public int getPM3ErrorCode() { int retVal = -1; SDCardInterface si = this.sharedData.getSDCardInterface(); if (si != null) { retVal = si.GetErrorCode(); }
return retVal; }
public void setPM3toSafeMode(boolean safeModeFlag) { boolean retVal = false; SDCardInterface si = this.sharedData.getSDCardInterface(); if (si != null) { si.setSafeMode(safeModeFlag); } }
public boolean SaveOStoPM3Card() { boolean retVal = false; SDCardInterface si = this.sharedData.getSDCardInterface(); if (si != null) { retVal = si.SaveOStoPM3Card(); }
return retVal; }
public boolean WriteAVR_ARMFuses(Optional start, Optional end) { boolean retVal = false; Debugger mdb = this.sharedData.getDebugger(); if (!this.sharedData.getAssemblySession().GetPluginBoardName().equals("")) { mdb.Disconnect(); }
try { if (mdb == null) { return retVal; }
this.s = ""; this.hold_tool_scan = true; if (mdb instanceof MCDebugger) { if (this.sharedData.getAssemblySession().GetDevice().getFamily() == Family.AVR) { ((MCDebugger)mdb).ProgramAVR_ARMFuses(MEMTYPE.CONFIG_MEMORY, Optional.empty(), Optional.empty()); } else { ((MCDebugger)mdb).ProgramAVR_ARMFuses(MEMTYPE.CONFIG_MEMORY, start, end); } }
retVal = true; } catch (Exception var6) { this.s = var6.toString(); retVal = false; }
this.hold_tool_scan = false; return retVal; }
public boolean readAVR_SAMFuses(Optional start, Optional end) { boolean retVal = false; Debugger mdb = this.sharedData.getDebugger();
try { if (mdb == null) { return retVal; }
this.s = ""; this.hold_tool_scan = true; if (mdb instanceof MCDebugger) { retVal = ((MCDebugger)mdb).ReadTargetMemoryExplicit(MEMTYPE.CONFIG_MEMORY, start, end); } } catch (Exception var6) { this.s = var6.toString(); retVal = false; }
this.hold_tool_scan = false; return retVal; }
public Map<String, ToolsLookup.ToolDetails> getToolsMap() { return this.mytoolsmap; }
public boolean isCoordinatedResetAndProgramOpRequired() { boolean retVal = false; if (this.session != null && CommonUtils.coordinatedResetAndProgramOpRequired(this.session.GetDevice(), false) == coordinatedResetOperation.eProgramAlwaysInitializeEntryAddressOnReset) { retVal = true; }
return retVal; }
private void preparePM5InterfaceObject() { if (this.pm5Services == null) { try { Result<MDBDebugTool> res = SharedData.getSingletonObject().getAssemblySession().getLookup().lookupResult(MDBDebugTool.class);
for (Class<? extends MDBDebugTool> cls : res.allClasses()) { if (cls.getName().compareTo(this.sharedData.getAssemblySession().GetToolClass()) == 0) { MDBDebugTool dbgtool = null; dbgtool = (MDBDebugTool)this.sharedData.getAssemblySession().getLookup().lookup(cls); if (dbgtool != null) { try { this.pm5Services = (ServiceQueries)dbgtool; } catch (Exception var6) { MPLABLogger.mplog.log(Level.INFO, var6.getMessage()); } } } } } catch (Exception var7) { MPLABLogger.mplog.log(Level.INFO, var7.toString()); } } }
public List<String> listAdapters() throws ServiceQueryException { this.preparePM5InterfaceObject(); List<String> results = new ArrayList<>(); if (this.pm5Services != null) { try { results = this.pm5Services.listUnits(""); } catch (ServiceQueryException var3) { MPLABLogger.mplog.log(Level.INFO, var3.getMessage()); throw new ServiceQueryException(var3.getErrorMessage()); } }
return results; }
public Map<String, List<String>> listEnvironments(List<String> adapters) throws ServiceQueryException { this.preparePM5InterfaceObject(); Map<String, List<String>> results = new HashMap<>(); if (this.pm5Services != null) { try { results = this.pm5Services.listEnvironments(adapters); } catch (ServiceQueryException var4) { MPLABLogger.mplog.log(Level.INFO, var4.getMessage()); throw new ServiceQueryException(var4.getErrorMessage()); } }
return results; }
public Map<String, String> getActiveEnvironments(List<String> adapters) throws ServiceQueryException { this.preparePM5InterfaceObject(); Map<String, String> results = new HashMap<>(); if (this.pm5Services != null) { try { results = this.pm5Services.getActiveEnvironments(adapters); } catch (ServiceQueryException var4) { MPLABLogger.mplog.log(Level.INFO, var4.getMessage()); throw new ServiceQueryException(var4.getErrorMessage()); } }
return results; }
public Map<String, FirmwareInfo> getFirmwareInfo(List<String> adapters) throws ServiceQueryException { this.preparePM5InterfaceObject(); Map<String, FirmwareInfo> results = new HashMap<>(); if (this.pm5Services != null) { try { results = this.pm5Services.getFirmwareInfo(adapters); } catch (ServiceQueryException var4) { MPLABLogger.mplog.log(Level.INFO, var4.getMessage()); throw new ServiceQueryException(var4.getErrorMessage()); } }
return results; }
public void setActiveEnvironments(List<String> adapters, String environment) throws ServiceQueryException { this.preparePM5InterfaceObject(); if (this.pm5Services != null) { try { this.pm5Services.setActiveEnvironments(adapters, environment); } catch (ServiceQueryException var4) { MPLABLogger.mplog.log(Level.INFO, var4.getMessage()); throw new ServiceQueryException(var4.getErrorMessage()); } } }
public void deleteEnvironments(String environment, List<String> adapters) throws ServiceQueryException { this.preparePM5InterfaceObject(); if (this.pm5Services != null) { try { this.pm5Services.deleteEnvironments(environment, adapters); } catch (ServiceQueryException var4) { MPLABLogger.mplog.log(Level.INFO, var4.getMessage()); throw new ServiceQueryException(var4.getErrorMessage()); } } }
public void transferEnvironment(String environment, List<String> adapters) throws ServiceQueryException { this.preparePM5InterfaceObject(); if (this.pm5Services != null) { try { this.pm5Services.transferEnvironment(environment, adapters); } catch (ServiceQueryException var4) { MPLABLogger.mplog.log(Level.INFO, var4.getMessage()); throw new ServiceQueryException(var4.getErrorMessage()); } } }
public List<String> listPM5Units() throws ServiceQueryException { this.preparePM5InterfaceObject(); List<String> results = new ArrayList<>(); if (this.pm5Services != null) { try { results = this.pm5Services.listUnits(""); } catch (ServiceQueryException var3) { MPLABLogger.mplog.log(Level.INFO, var3.getMessage()); throw new ServiceQueryException(var3.getErrorMessage()); } }
return results; }
public List<String> listPM5MainSubUnits(String serialNum) throws ServiceQueryException { this.preparePM5InterfaceObject(); List<String> results = new ArrayList<>(); if (this.pm5Services != null) { try { results = this.pm5Services.listSubUnits(serialNum); } catch (ServiceQueryException var4) { MPLABLogger.mplog.log(Level.INFO, var4.getMessage()); throw new ServiceQueryException(var4.getErrorMessage()); } }
return results; }
public List<String> listPM5MainEnvironments(String serialNum) throws ServiceQueryException { this.preparePM5InterfaceObject(); List<String> results = new ArrayList<>(); if (this.pm5Services != null) { try { results = this.pm5Services.listEnvironments(serialNum); } catch (ServiceQueryException var4) { MPLABLogger.mplog.log(Level.INFO, var4.getMessage()); throw new ServiceQueryException(var4.getErrorMessage()); } }
return results; }
public Map<String, List<String>> listPM5MainSubEnvironments(String serialNum, List<String> adapters) throws ServiceQueryException { this.preparePM5InterfaceObject(); Map<String, List<String>> results = new HashMap<>(); if (this.pm5Services != null) { try { results = this.pm5Services.listSubEnvironments(serialNum, adapters); } catch (ServiceQueryException var5) { MPLABLogger.mplog.log(Level.INFO, var5.getMessage()); throw new ServiceQueryException(var5.getErrorMessage()); } }
return results; }
public Map<String, String> getPM5MainSubActiveEnvironments(String serialNum, List<String> adapters) throws ServiceQueryException { this.preparePM5InterfaceObject(); Map<String, String> results = new HashMap<>(); if (this.pm5Services != null) { try { results = this.pm5Services.getSubsActiveEnvironments(serialNum, adapters); } catch (ServiceQueryException var5) { MPLABLogger.mplog.log(Level.INFO, var5.getMessage()); throw new ServiceQueryException(var5.getErrorMessage()); } }
return results; }
public void setPM5MainSubActiveEnvironments(String serialNum, List<String> adapters, String environment) throws ServiceQueryException { this.preparePM5InterfaceObject(); if (this.pm5Services != null) { try { this.pm5Services.setSubsActiveEnvironments(serialNum, adapters, environment); } catch (ServiceQueryException var5) { MPLABLogger.mplog.log(Level.INFO, var5.getMessage()); throw new ServiceQueryException(var5.getErrorMessage()); } } }
public void deletePM5MainEnvironments(String environment, String serialNum) throws ServiceQueryException { this.preparePM5InterfaceObject(); if (this.pm5Services != null) { try { this.pm5Services.deleteEnvironment(environment, serialNum); } catch (ServiceQueryException var4) { MPLABLogger.mplog.log(Level.INFO, var4.getMessage()); throw new ServiceQueryException(var4.getErrorMessage()); } } }
public void deletePM5MainSubEnvironments(String environment, String serialNum, List<String> adapters) throws ServiceQueryException { this.preparePM5InterfaceObject(); if (this.pm5Services != null) { try { this.pm5Services.deleteSubEnvironments(environment, serialNum, adapters); } catch (ServiceQueryException var5) { MPLABLogger.mplog.log(Level.INFO, var5.getMessage()); throw new ServiceQueryException(var5.getErrorMessage()); } } }
public Pm5Versions getPM5MainFirmwareInfo(String serialNum) throws ServiceQueryException { this.preparePM5InterfaceObject(); Pm5Versions pm5Version = null; if (this.pm5Services != null) { try { pm5Version = this.pm5Services.getFirmwareInfo(serialNum); } catch (ServiceQueryException var4) { MPLABLogger.mplog.log(Level.INFO, var4.getMessage()); throw new ServiceQueryException(var4.getErrorMessage()); } }
return pm5Version; }
public Map<String, FirmwareInfo> getPM5MainSubFirmwareInfo(String serialNum, List<String> adapters) throws ServiceQueryException { this.preparePM5InterfaceObject(); Map<String, FirmwareInfo> pm5Version = new HashMap<>(); if (this.pm5Services != null) { try { pm5Version = this.pm5Services.getSubFirmwareInfo(serialNum, adapters); } catch (ServiceQueryException var5) { MPLABLogger.mplog.log(Level.INFO, var5.getMessage()); throw new ServiceQueryException(var5.getErrorMessage()); } }
return pm5Version; }
public void transferPM5MainEnvironment(String environment, String serialNum) throws ServiceQueryException { this.preparePM5InterfaceObject(); if (this.pm5Services != null) { try { this.pm5Services.transferEnvironment(environment, serialNum); } catch (ServiceQueryException var4) { MPLABLogger.mplog.log(Level.INFO, var4.getMessage()); throw new ServiceQueryException(var4.getErrorMessage()); } } }
public void transferEnvironmentToPM5MainSub(String environment, String serialNum, List<String> adapters) throws ServiceQueryException { this.preparePM5InterfaceObject(); if (this.pm5Services != null) { try { this.pm5Services.transferEnvironmentToSubs(environment, serialNum, adapters); } catch (ServiceQueryException var5) { MPLABLogger.mplog.log(Level.INFO, var5.getMessage()); throw new ServiceQueryException(var5.getErrorMessage()); } } }
public Map<String, String> listPM5MainSubPgmStats(String environment, String serialNum, List<String> adapters) throws ServiceQueryException { this.preparePM5InterfaceObject(); Map<String, String> results = new HashMap<>(); if (this.pm5Services != null) { try { results = this.pm5Services.listSubPgmStats(environment, serialNum, adapters); } catch (ServiceQueryException var6) { MPLABLogger.mplog.log(Level.INFO, var6.getMessage()); throw new ServiceQueryException(var6.getErrorMessage()); } }
return results; }
public String getPM5Logs(String serialNum) throws ServiceQueryException { this.preparePM5InterfaceObject(); String results = ""; if (this.pm5Services != null) { try { results = this.pm5Services.getPM5Logs(serialNum); } catch (ServiceQueryException var4) { MPLABLogger.mplog.log(Level.INFO, var4.getMessage()); throw new ServiceQueryException(var4.getErrorMessage()); } }
return results; }
public boolean isIPAddress(String sNo) { if (sNo != null && !sNo.isEmpty()) { String[] octets = sNo.split("\\."); if (octets.length != 4) { return false; } else { for (String octet : octets) { try { int value = Integer.parseInt(octet); if (value < 0 || value > 255) { return false; } } catch (NumberFormatException var8) { return false; } }
return true; } } else { return false; } }
public class ToolDetails { String toolID = ""; String toolName = ""; String toolClass = ""; String toolFlavour = ""; String toolSN = ""; List<ToolSupport> ts = null;
public String getToolID() { return this.toolID; }
public String getToolName() { return this.toolName; }
public String getToolSN() { return this.toolSN; } }}