/*
 *  Do not modify this file; it is automatically 
 *  generated and any modifications will be overwritten.
 *
 * @(#) xdc-x20
 */
import java.util.*;
import org.mozilla.javascript.*;
import xdc.services.intern.xsr.*;
import xdc.services.spec.Session;

public class ti_uiactools_services
{
    static final String VERS = "@(#) xdc-x20\n";

    static final Proto.Elm $$T_Bool = Proto.Elm.newBool();
    static final Proto.Elm $$T_Num = Proto.Elm.newNum();
    static final Proto.Elm $$T_Str = Proto.Elm.newStr();
    static final Proto.Elm $$T_Obj = Proto.Elm.newObj();

    static final Proto.Fxn $$T_Met = new Proto.Fxn(null, null, 0, -1, false);
    static final Proto.Map $$T_Map = new Proto.Map($$T_Obj);
    static final Proto.Arr $$T_Vec = new Proto.Arr($$T_Obj);

    static final XScriptO $$DEFAULT = Value.DEFAULT;
    static final Object $$UNDEF = Undefined.instance;

    static final Proto.Obj $$Package = (Proto.Obj)Global.get("$$Package");
    static final Proto.Obj $$Module = (Proto.Obj)Global.get("$$Module");
    static final Proto.Obj $$Instance = (Proto.Obj)Global.get("$$Instance");
    static final Proto.Obj $$Params = (Proto.Obj)Global.get("$$Params");

    static final Object $$objFldGet = Global.get("$$objFldGet");
    static final Object $$objFldSet = Global.get("$$objFldSet");
    static final Object $$proxyGet = Global.get("$$proxyGet");
    static final Object $$proxySet = Global.get("$$proxySet");
    static final Object $$delegGet = Global.get("$$delegGet");
    static final Object $$delegSet = Global.get("$$delegSet");

    Scriptable xdcO;
    Session ses;
    Value.Obj om;

    boolean isROV;
    boolean isCFG;

    Proto.Obj pkgP;
    Value.Obj pkgV;

    ArrayList<Object> imports = new ArrayList<Object>();
    ArrayList<Object> loggables = new ArrayList<Object>();
    ArrayList<Object> mcfgs = new ArrayList<Object>();
    ArrayList<Object> icfgs = new ArrayList<Object>();
    ArrayList<Object> proxies = new ArrayList<Object>();
    ArrayList<Object> sizes = new ArrayList<Object>();
    ArrayList<Object> tdefs = new ArrayList<Object>();

    void $$IMPORTS()
    {
        Global.callFxn("loadPackage", xdcO, "xdc.rov");
        Global.callFxn("loadPackage", xdcO, "xdc");
        Global.callFxn("loadPackage", xdcO, "xdc.corevers");
        Global.callFxn("loadPackage", xdcO, "ti.uia.events");
        Global.callFxn("loadPackage", xdcO, "ti.uiactools.runtime");
        Global.callFxn("loadPackage", xdcO, "xdc.runtime");
        Global.callFxn("loadPackage", xdcO, "ti.uia.runtime");
    }

    void $$OBJECTS()
    {
        pkgP = (Proto.Obj)om.bind("ti.uiactools.services.Package", new Proto.Obj());
        pkgV = (Value.Obj)om.bind("ti.uiactools.services", new Value.Obj("ti.uiactools.services", pkgP));
    }

    void BufferUpload$$OBJECTS()
    {
        Proto.Obj po, spo;
        Value.Obj vo;

        po = (Proto.Obj)om.bind("ti.uiactools.services.BufferUpload.Module", new Proto.Obj());
        vo = (Value.Obj)om.bind("ti.uiactools.services.BufferUpload", new Value.Obj("ti.uiactools.services.BufferUpload", po));
        pkgV.bind("BufferUpload", vo);
        // decls 
        spo = (Proto.Obj)om.bind("ti.uiactools.services.BufferUpload$$Packet", new Proto.Obj());
        om.bind("ti.uiactools.services.BufferUpload.Packet", new Proto.Str(spo, false));
        spo = (Proto.Obj)om.bind("ti.uiactools.services.BufferUpload$$ModuleView", new Proto.Obj());
        om.bind("ti.uiactools.services.BufferUpload.ModuleView", new Proto.Str(spo, false));
        spo = (Proto.Obj)om.bind("ti.uiactools.services.BufferUpload$$Module_State", new Proto.Obj());
        om.bind("ti.uiactools.services.BufferUpload.Module_State", new Proto.Str(spo, false));
        om.bind("ti.uiactools.services.BufferUpload.Command", new Proto.Enm("ti.uiactools.services.BufferUpload.Command"));
        om.bind("ti.uiactools.services.BufferUpload.ErrorCode", new Proto.Enm("ti.uiactools.services.BufferUpload.ErrorCode"));
    }

    void BufferUpload$$CONSTS()
    {
        // module BufferUpload
        om.bind("ti.uiactools.services.BufferUpload.Command_BUF_OFF", xdc.services.intern.xsr.Enum.make((Proto.Enm)om.findStrict("ti.uiactools.services.BufferUpload.Command", "ti.uiactools.services"), "ti.uiactools.services.BufferUpload.Command_BUF_OFF", xdc.services.intern.xsr.Enum.intValue(2L)+0));
        om.bind("ti.uiactools.services.BufferUpload.Command_BUF_ON", xdc.services.intern.xsr.Enum.make((Proto.Enm)om.findStrict("ti.uiactools.services.BufferUpload.Command", "ti.uiactools.services"), "ti.uiactools.services.BufferUpload.Command_BUF_ON", xdc.services.intern.xsr.Enum.intValue(3L)+0));
        om.bind("ti.uiactools.services.BufferUpload.Command_GET_CPU_SPEED", xdc.services.intern.xsr.Enum.make((Proto.Enm)om.findStrict("ti.uiactools.services.BufferUpload.Command", "ti.uiactools.services"), "ti.uiactools.services.BufferUpload.Command_GET_CPU_SPEED", xdc.services.intern.xsr.Enum.intValue(4L)+0));
        om.bind("ti.uiactools.services.BufferUpload.Command_RESET_BUF", xdc.services.intern.xsr.Enum.make((Proto.Enm)om.findStrict("ti.uiactools.services.BufferUpload.Command", "ti.uiactools.services"), "ti.uiactools.services.BufferUpload.Command_RESET_BUF", xdc.services.intern.xsr.Enum.intValue(5L)+0));
        om.bind("ti.uiactools.services.BufferUpload.Command_CHANGE_PERIOD", xdc.services.intern.xsr.Enum.make((Proto.Enm)om.findStrict("ti.uiactools.services.BufferUpload.Command", "ti.uiactools.services"), "ti.uiactools.services.BufferUpload.Command_CHANGE_PERIOD", xdc.services.intern.xsr.Enum.intValue(6L)+0));
        om.bind("ti.uiactools.services.BufferUpload.Command_START_TX", xdc.services.intern.xsr.Enum.make((Proto.Enm)om.findStrict("ti.uiactools.services.BufferUpload.Command", "ti.uiactools.services"), "ti.uiactools.services.BufferUpload.Command_START_TX", xdc.services.intern.xsr.Enum.intValue(7L)+0));
        om.bind("ti.uiactools.services.BufferUpload.Command_STOP_TX", xdc.services.intern.xsr.Enum.make((Proto.Enm)om.findStrict("ti.uiactools.services.BufferUpload.Command", "ti.uiactools.services"), "ti.uiactools.services.BufferUpload.Command_STOP_TX", xdc.services.intern.xsr.Enum.intValue(8L)+0));
        om.bind("ti.uiactools.services.BufferUpload.Command_BUF_OFF_ALL", xdc.services.intern.xsr.Enum.make((Proto.Enm)om.findStrict("ti.uiactools.services.BufferUpload.Command", "ti.uiactools.services"), "ti.uiactools.services.BufferUpload.Command_BUF_OFF_ALL", xdc.services.intern.xsr.Enum.intValue(9L)+0));
        om.bind("ti.uiactools.services.BufferUpload.Command_BUF_ON_ALL", xdc.services.intern.xsr.Enum.make((Proto.Enm)om.findStrict("ti.uiactools.services.BufferUpload.Command", "ti.uiactools.services"), "ti.uiactools.services.BufferUpload.Command_BUF_ON_ALL", xdc.services.intern.xsr.Enum.intValue(10L)+0));
        om.bind("ti.uiactools.services.BufferUpload.Command_RESET_BUF_ALL", xdc.services.intern.xsr.Enum.make((Proto.Enm)om.findStrict("ti.uiactools.services.BufferUpload.Command", "ti.uiactools.services"), "ti.uiactools.services.BufferUpload.Command_RESET_BUF_ALL", xdc.services.intern.xsr.Enum.intValue(11L)+0));
        om.bind("ti.uiactools.services.BufferUpload.Command_SNAPSHOT_ALL", xdc.services.intern.xsr.Enum.make((Proto.Enm)om.findStrict("ti.uiactools.services.BufferUpload.Command", "ti.uiactools.services"), "ti.uiactools.services.BufferUpload.Command_SNAPSHOT_ALL", xdc.services.intern.xsr.Enum.intValue(12L)+0));
        om.bind("ti.uiactools.services.BufferUpload.ErrorCode_NULLPOINTER", xdc.services.intern.xsr.Enum.make((Proto.Enm)om.findStrict("ti.uiactools.services.BufferUpload.ErrorCode", "ti.uiactools.services"), "ti.uiactools.services.BufferUpload.ErrorCode_NULLPOINTER", xdc.services.intern.xsr.Enum.intValue(0L)+0));
        om.bind("ti.uiactools.services.BufferUpload.processCallback", new Extern("ti_uiactools_services_BufferUpload_processCallback__E", "xdc_Void(*)(ti_uia_runtime_ServiceMgr_Reason,ti_uia_runtime_UIAPacket_Hdr*)", true, false));
        om.bind("ti.uiactools.services.BufferUpload.disableAllBuffers", new Extern("ti_uiactools_services_BufferUpload_disableAllBuffers__E", "xdc_Void(*)(xdc_Void)", true, false));
        om.bind("ti.uiactools.services.BufferUpload.enableAllBuffers", new Extern("ti_uiactools_services_BufferUpload_enableAllBuffers__E", "xdc_Void(*)(xdc_Void)", true, false));
        om.bind("ti.uiactools.services.BufferUpload.snapshotAllBuffers", new Extern("ti_uiactools_services_BufferUpload_snapshotAllBuffers__E", "xdc_Void(*)(xdc_UArg,xdc_UArg)", true, false));
        om.bind("ti.uiactools.services.BufferUpload.resetAllBuffers", new Extern("ti_uiactools_services_BufferUpload_resetAllBuffers__E", "xdc_Void(*)(xdc_Void)", true, false));
        om.bind("ti.uiactools.services.BufferUpload.startDataTx", new Extern("ti_uiactools_services_BufferUpload_startDataTx__E", "xdc_Void(*)(xdc_Void)", true, false));
        om.bind("ti.uiactools.services.BufferUpload.stopDataTx", new Extern("ti_uiactools_services_BufferUpload_stopDataTx__E", "xdc_Void(*)(xdc_Void)", true, false));
        om.bind("ti.uiactools.services.BufferUpload.isDataTx", new Extern("ti_uiactools_services_BufferUpload_isDataTx__E", "xdc_Bool(*)(xdc_Void)", true, false));
        om.bind("ti.uiactools.services.BufferUpload.packetBufferExchange", new Extern("ti_uiactools_services_BufferUpload_packetBufferExchange__E", "xdc_Ptr(*)(xdc_Ptr,xdc_Ptr)", true, false));
        om.bind("ti.uiactools.services.BufferUpload.sendEvents", new Extern("ti_uiactools_services_BufferUpload_sendEvents__I", "xdc_Void(*)(xdc_Void)", true, false));
        om.bind("ti.uiactools.services.BufferUpload.processMsg", new Extern("ti_uiactools_services_BufferUpload_processMsg__I", "xdc_Void(*)(ti_uia_runtime_UIAPacket_Hdr*)", true, false));
        om.bind("ti.uiactools.services.BufferUpload.flushBuffer", new Extern("ti_uiactools_services_BufferUpload_flushBuffer__I", "xdc_Void(*)(ti_uiactools_runtime_IUIAPacketTransfer_Handle,xdc_UInt)", true, false));
        om.bind("ti.uiactools.services.BufferUpload.acknowledgeCmd", new Extern("ti_uiactools_services_BufferUpload_acknowledgeCmd__I", "xdc_Void(*)(ti_uiactools_services_BufferUpload_Packet*)", true, false));
        om.bind("ti.uiactools.services.BufferUpload.enableBuffer", new Extern("ti_uiactools_services_BufferUpload_enableBuffer__I", "xdc_Void(*)(xdc_UArg)", true, false));
        om.bind("ti.uiactools.services.BufferUpload.disableBuffer", new Extern("ti_uiactools_services_BufferUpload_disableBuffer__I", "xdc_Void(*)(xdc_UArg)", true, false));
        om.bind("ti.uiactools.services.BufferUpload.getCpuSpeed", new Extern("ti_uiactools_services_BufferUpload_getCpuSpeed__I", "xdc_Void(*)(ti_uiactools_services_BufferUpload_Packet*)", true, false));
        om.bind("ti.uiactools.services.BufferUpload.resetBuffer", new Extern("ti_uiactools_services_BufferUpload_resetBuffer__I", "xdc_Void(*)(xdc_UArg)", true, false));
        om.bind("ti.uiactools.services.BufferUpload.changePeriod", new Extern("ti_uiactools_services_BufferUpload_changePeriod__I", "xdc_Void(*)(xdc_UArg)", true, false));
    }

    void BufferUpload$$CREATES()
    {
        Proto.Fxn fxn;
        StringBuilder sb;

    }

    void BufferUpload$$FUNCTIONS()
    {
        Proto.Fxn fxn;

        // fxn BufferUpload.registerBuffers
        fxn = (Proto.Fxn)om.bind("ti.uiactools.services.BufferUpload$$registerBuffers", new Proto.Fxn(om.findStrict("ti.uiactools.services.BufferUpload.Module", "ti.uiactools.services"), null, 0, -1, false));
    }

    void BufferUpload$$SIZES()
    {
        Proto.Str so;
        Object fxn;

        so = (Proto.Str)om.findStrict("ti.uiactools.services.BufferUpload.Packet", "ti.uiactools.services");
        sizes.clear();
        sizes.add(Global.newArray("hdr", "Sti.uia.runtime.UIAPacket;Hdr"));
        sizes.add(Global.newArray("arg0", "UInt32"));
        sizes.add(Global.newArray("arg1", "UInt32"));
        so.bind("$$sizes", Global.newArray(sizes.toArray()));
        fxn = Global.eval("function() { return $$sizeof(xdc.om['ti.uiactools.services.BufferUpload.Packet']); }");
        so.bind("$sizeof", fxn);
        fxn = Global.eval("function() { return $$alignof(xdc.om['ti.uiactools.services.BufferUpload.Packet']); }");
        so.bind("$alignof", fxn);
        fxn = Global.eval("function(fld) { return $$offsetof(xdc.om['ti.uiactools.services.BufferUpload.Packet'], fld); }");
        so.bind("$offsetof", fxn);
        so = (Proto.Str)om.findStrict("ti.uiactools.services.BufferUpload.Module_State", "ti.uiactools.services");
        sizes.clear();
        sizes.add(Global.newArray("hBufferPacketizers", "UPtr"));
        sizes.add(Global.newArray("numBufs", "UInt"));
        sizes.add(Global.newArray("totalPacketsSent", "UInt"));
        sizes.add(Global.newArray("period", "TInt"));
        sizes.add(Global.newArray("seq", "UInt16"));
        sizes.add(Global.newArray("txData", "UShort"));
        sizes.add(Global.newArray("snapshot", "UShort"));
        so.bind("$$sizes", Global.newArray(sizes.toArray()));
        fxn = Global.eval("function() { return $$sizeof(xdc.om['ti.uiactools.services.BufferUpload.Module_State']); }");
        so.bind("$sizeof", fxn);
        fxn = Global.eval("function() { return $$alignof(xdc.om['ti.uiactools.services.BufferUpload.Module_State']); }");
        so.bind("$alignof", fxn);
        fxn = Global.eval("function(fld) { return $$offsetof(xdc.om['ti.uiactools.services.BufferUpload.Module_State'], fld); }");
        so.bind("$offsetof", fxn);
    }

    void BufferUpload$$TYPES()
    {
        Scriptable cap;
        Proto.Obj po;
        Proto.Str ps;
        Proto.Typedef pt;
        Object fxn;

        cap = (Scriptable)Global.callFxn("loadCapsule", xdcO, "ti/uiactools/services/BufferUpload.xs");
        om.bind("ti.uiactools.services.BufferUpload$$capsule", cap);
        po = (Proto.Obj)om.findStrict("ti.uiactools.services.BufferUpload.Module", "ti.uiactools.services");
        po.init("ti.uiactools.services.BufferUpload.Module", om.findStrict("ti.uia.events.IUIAMetaProvider.Module", "ti.uiactools.services"));
                po.addFld("$hostonly", $$T_Num, 0, "r");
        if (isCFG) {
            po.addFld("rovViewInfo", (Proto)om.findStrict("xdc.rov.ViewInfo.Instance", "ti.uiactools.services"), $$UNDEF, "wh");
            po.addFld("LD_recordsSent", (Proto)om.findStrict("xdc.runtime.Log$$Event", "ti.uiactools.services"), Global.newObject("mask", 0x0200L, "msg", "BufferUpload LD_recordsSent:  Sent %d bytes from logger [%d] 0x%x"), "w");
            po.addFld("LD_cmdRcvd", (Proto)om.findStrict("xdc.runtime.Log$$Event", "ti.uiactools.services"), Global.newObject("mask", 0x0200L, "msg", "BufferUpload LD_cmdRcvd: Received command: %d, arg0: 0x%x, arg1: 0x%x"), "w");
            po.addFld("periodInMs", Proto.Elm.newCNum("(xdc_Int)"), 100L, "w");
            po.addFld("SERVICEID", (Proto)om.findStrict("ti.uia.runtime.ServiceMgr$$ServiceId", "ti.uiactools.services"), $$DEFAULT, "r");
            po.addFld("maxNumConsecutivePackets", Proto.Elm.newCNum("(xdc_UInt32)"), 1L, "w");
            po.addFld("hasMetaData", $$T_Bool, true, "wh");
        }//isCFG
        fxn = Global.get(cap, "module$use");
        if (fxn != null) om.bind("ti.uiactools.services.BufferUpload$$module$use", true);
        if (fxn != null) po.addFxn("module$use", $$T_Met, fxn);
        fxn = Global.get(cap, "module$meta$init");
        if (fxn != null) om.bind("ti.uiactools.services.BufferUpload$$module$meta$init", true);
        if (fxn != null) po.addFxn("module$meta$init", $$T_Met, fxn);
        fxn = Global.get(cap, "module$static$init");
        if (fxn != null) om.bind("ti.uiactools.services.BufferUpload$$module$static$init", true);
        if (fxn != null) po.addFxn("module$static$init", $$T_Met, fxn);
        fxn = Global.get(cap, "module$validate");
        if (fxn != null) om.bind("ti.uiactools.services.BufferUpload$$module$validate", true);
        if (fxn != null) po.addFxn("module$validate", $$T_Met, fxn);
                fxn = Global.get(cap, "writeUIAMetaData");
                if (fxn != null) po.addFxn("writeUIAMetaData", (Proto.Fxn)om.findStrict("ti.uia.events.IUIAMetaProvider$$writeUIAMetaData", "ti.uiactools.services"), fxn);
                po.addFxn("registerBuffers", (Proto.Fxn)om.findStrict("ti.uiactools.services.BufferUpload$$registerBuffers", "ti.uiactools.services"), Global.get(cap, "registerBuffers"));
        // struct BufferUpload.Packet
        po = (Proto.Obj)om.findStrict("ti.uiactools.services.BufferUpload$$Packet", "ti.uiactools.services");
        po.init("ti.uiactools.services.BufferUpload.Packet", null);
                po.addFld("$hostonly", $$T_Num, 0, "r");
                po.addFld("hdr", (Proto)om.findStrict("ti.uia.runtime.UIAPacket.Hdr", "ti.uiactools.services"), $$DEFAULT, "w");
                po.addFld("arg0", Proto.Elm.newCNum("(xdc_Bits32)"), $$UNDEF, "w");
                po.addFld("arg1", Proto.Elm.newCNum("(xdc_Bits32)"), $$UNDEF, "w");
        // struct BufferUpload.ModuleView
        po = (Proto.Obj)om.findStrict("ti.uiactools.services.BufferUpload$$ModuleView", "ti.uiactools.services");
        po.init("ti.uiactools.services.BufferUpload.ModuleView", null);
                po.addFld("$hostonly", $$T_Num, 1, "r");
                po.addFld("serviceId", Proto.Elm.newCNum("(xdc_Int)"), $$UNDEF, "w");
                po.addFld("enabled", $$T_Bool, $$UNDEF, "w");
                po.addFld("snapshotMode", $$T_Bool, $$UNDEF, "w");
                po.addFld("period", Proto.Elm.newCNum("(xdc_Int)"), $$UNDEF, "w");
                po.addFld("numBufs", Proto.Elm.newCNum("(xdc_UInt)"), $$UNDEF, "w");
                po.addFld("hBufferPacketizers", new Proto.Arr($$T_Str, false), $$DEFAULT, "w");
                po.addFld("sequence", Proto.Elm.newCNum("(xdc_Bits16)"), $$UNDEF, "w");
                po.addFld("totalPacketsSent", Proto.Elm.newCNum("(xdc_UInt)"), $$UNDEF, "w");
        // struct BufferUpload.Module_State
        po = (Proto.Obj)om.findStrict("ti.uiactools.services.BufferUpload$$Module_State", "ti.uiactools.services");
        po.init("ti.uiactools.services.BufferUpload.Module_State", null);
                po.addFld("$hostonly", $$T_Num, 0, "r");
                po.addFld("hBufferPacketizers", new Proto.Arr((Proto)om.findStrict("ti.uiactools.runtime.IUIAPacketTransfer.Handle", "ti.uiactools.services"), false), $$DEFAULT, "w");
                po.addFld("numBufs", Proto.Elm.newCNum("(xdc_UInt)"), $$UNDEF, "w");
                po.addFld("totalPacketsSent", Proto.Elm.newCNum("(xdc_UInt)"), $$UNDEF, "w");
                po.addFld("period", Proto.Elm.newCNum("(xdc_Int)"), $$UNDEF, "w");
                po.addFld("seq", Proto.Elm.newCNum("(xdc_Bits16)"), $$UNDEF, "w");
                po.addFld("txData", $$T_Bool, $$UNDEF, "w");
                po.addFld("snapshot", $$T_Bool, $$UNDEF, "w");
    }

    void BufferUpload$$ROV()
    {
        Proto.Obj po;
        Value.Obj vo;

        vo = (Value.Obj)om.findStrict("ti.uiactools.services.BufferUpload", "ti.uiactools.services");
        vo.bind("Packet$fetchDesc", Global.newObject("type", "ti.uiactools.services.BufferUpload.Packet", "isScalar", false));
        po = (Proto.Obj)om.findStrict("ti.uiactools.services.BufferUpload$$Packet", "ti.uiactools.services");
        vo.bind("Module_State$fetchDesc", Global.newObject("type", "ti.uiactools.services.BufferUpload.Module_State", "isScalar", false));
        po = (Proto.Obj)om.findStrict("ti.uiactools.services.BufferUpload$$Module_State", "ti.uiactools.services");
        po.bind("hBufferPacketizers$fetchDesc", Global.newObject("type", "xdc.rov.support.ScalarStructs.S_Ptr", "isScalar", true));
    }

    void $$SINGLETONS()
    {
        pkgP.init("ti.uiactools.services.Package", (Proto.Obj)om.findStrict("xdc.IPackage.Module", "ti.uiactools.services"));
        pkgP.bind("$capsule", $$UNDEF);
        pkgV.init2(pkgP, "ti.uiactools.services", Value.DEFAULT, false);
        pkgV.bind("$name", "ti.uiactools.services");
        pkgV.bind("$category", "Package");
        pkgV.bind("$$qn", "ti.uiactools.services.");
        pkgV.bind("$vers", Global.newArray("1, 0, 0, 0"));
        Value.Map atmap = (Value.Map)pkgV.getv("$attr");
        atmap.seal("length");
        imports.clear();
        imports.add(Global.newArray("xdc.rov", Global.newArray()));
        pkgV.bind("$imports", imports);
        StringBuilder sb = new StringBuilder();
        sb.append("var pkg = xdc.om['ti.uiactools.services'];\n");
        sb.append("if (pkg.$vers.length >= 3) {\n");
            sb.append("pkg.$vers.push(Packages.xdc.services.global.Vers.getDate(xdc.csd() + '/..'));\n");
        sb.append("}\n");
        sb.append("pkg.build.libraries = [\n");
            sb.append("'lib/ti.uiactools.services.a64T',\n");
            sb.append("'lib/ti.uiactools.services.a64P',\n");
            sb.append("'lib/ti.uiactools.services.a674',\n");
            sb.append("'lib/ti.uiactools.services.ae66',\n");
            sb.append("'lib/ti.uiactools.services.ae66e',\n");
            sb.append("'lib/ti.uiactools.services.aem3',\n");
        sb.append("];\n");
        sb.append("pkg.build.libDesc = [\n");
            sb.append("['lib/ti.uiactools.services.a64T', {target: 'ti.targets.C64T', suffix: '64T'}],\n");
            sb.append("['lib/ti.uiactools.services.a64P', {target: 'ti.targets.C64P', suffix: '64P'}],\n");
            sb.append("['lib/ti.uiactools.services.a674', {target: 'ti.targets.C674', suffix: '674'}],\n");
            sb.append("['lib/ti.uiactools.services.ae66', {target: 'ti.targets.elf.C66', suffix: 'e66'}],\n");
            sb.append("['lib/ti.uiactools.services.ae66e', {target: 'ti.targets.elf.C66_big_endian', suffix: 'e66e'}],\n");
            sb.append("['lib/ti.uiactools.services.aem3', {target: 'ti.targets.arm.elf.M3', suffix: 'em3'}],\n");
        sb.append("];\n");
        Global.eval(sb.toString());
    }

    void BufferUpload$$SINGLETONS()
    {
        Proto.Obj po;
        Value.Obj vo;

        vo = (Value.Obj)om.findStrict("ti.uiactools.services.BufferUpload", "ti.uiactools.services");
        po = (Proto.Obj)om.findStrict("ti.uiactools.services.BufferUpload.Module", "ti.uiactools.services");
        vo.init2(po, "ti.uiactools.services.BufferUpload", $$DEFAULT, false);
        vo.bind("Module", po);
        vo.bind("$category", "Module");
        vo.bind("$capsule", om.findStrict("ti.uiactools.services.BufferUpload$$capsule", "ti.uiactools.services"));
        vo.bind("$package", om.findStrict("ti.uiactools.services", "ti.uiactools.services"));
        tdefs.clear();
        proxies.clear();
        mcfgs.clear();
        icfgs.clear();
        mcfgs.add("Module__diagsEnabled");
        icfgs.add("Module__diagsEnabled");
        mcfgs.add("Module__diagsIncluded");
        icfgs.add("Module__diagsIncluded");
        mcfgs.add("Module__diagsMask");
        icfgs.add("Module__diagsMask");
        mcfgs.add("Module__gateObj");
        icfgs.add("Module__gateObj");
        mcfgs.add("Module__gatePrms");
        icfgs.add("Module__gatePrms");
        mcfgs.add("Module__id");
        icfgs.add("Module__id");
        mcfgs.add("Module__loggerDefined");
        icfgs.add("Module__loggerDefined");
        mcfgs.add("Module__loggerObj");
        icfgs.add("Module__loggerObj");
        mcfgs.add("Module__loggerFxn0");
        icfgs.add("Module__loggerFxn0");
        mcfgs.add("Module__loggerFxn1");
        icfgs.add("Module__loggerFxn1");
        mcfgs.add("Module__loggerFxn2");
        icfgs.add("Module__loggerFxn2");
        mcfgs.add("Module__loggerFxn4");
        icfgs.add("Module__loggerFxn4");
        mcfgs.add("Module__loggerFxn8");
        icfgs.add("Module__loggerFxn8");
        mcfgs.add("Module__startupDoneFxn");
        icfgs.add("Module__startupDoneFxn");
        mcfgs.add("Object__count");
        icfgs.add("Object__count");
        mcfgs.add("Object__heap");
        icfgs.add("Object__heap");
        mcfgs.add("Object__sizeof");
        icfgs.add("Object__sizeof");
        mcfgs.add("Object__table");
        icfgs.add("Object__table");
        vo.bind("Packet", om.findStrict("ti.uiactools.services.BufferUpload.Packet", "ti.uiactools.services"));
        tdefs.add(om.findStrict("ti.uiactools.services.BufferUpload.Packet", "ti.uiactools.services"));
        vo.bind("ModuleView", om.findStrict("ti.uiactools.services.BufferUpload.ModuleView", "ti.uiactools.services"));
        tdefs.add(om.findStrict("ti.uiactools.services.BufferUpload.ModuleView", "ti.uiactools.services"));
        mcfgs.add("LD_recordsSent");
        mcfgs.add("LD_cmdRcvd");
        mcfgs.add("periodInMs");
        vo.bind("Module_State", om.findStrict("ti.uiactools.services.BufferUpload.Module_State", "ti.uiactools.services"));
        tdefs.add(om.findStrict("ti.uiactools.services.BufferUpload.Module_State", "ti.uiactools.services"));
        mcfgs.add("SERVICEID");
        icfgs.add("SERVICEID");
        vo.bind("Command", om.findStrict("ti.uiactools.services.BufferUpload.Command", "ti.uiactools.services"));
        vo.bind("ErrorCode", om.findStrict("ti.uiactools.services.BufferUpload.ErrorCode", "ti.uiactools.services"));
        mcfgs.add("maxNumConsecutivePackets");
        icfgs.add("maxNumConsecutivePackets");
        icfgs.add("hasMetaData");
        vo.bind("Command_BUF_OFF", om.findStrict("ti.uiactools.services.BufferUpload.Command_BUF_OFF", "ti.uiactools.services"));
        vo.bind("Command_BUF_ON", om.findStrict("ti.uiactools.services.BufferUpload.Command_BUF_ON", "ti.uiactools.services"));
        vo.bind("Command_GET_CPU_SPEED", om.findStrict("ti.uiactools.services.BufferUpload.Command_GET_CPU_SPEED", "ti.uiactools.services"));
        vo.bind("Command_RESET_BUF", om.findStrict("ti.uiactools.services.BufferUpload.Command_RESET_BUF", "ti.uiactools.services"));
        vo.bind("Command_CHANGE_PERIOD", om.findStrict("ti.uiactools.services.BufferUpload.Command_CHANGE_PERIOD", "ti.uiactools.services"));
        vo.bind("Command_START_TX", om.findStrict("ti.uiactools.services.BufferUpload.Command_START_TX", "ti.uiactools.services"));
        vo.bind("Command_STOP_TX", om.findStrict("ti.uiactools.services.BufferUpload.Command_STOP_TX", "ti.uiactools.services"));
        vo.bind("Command_BUF_OFF_ALL", om.findStrict("ti.uiactools.services.BufferUpload.Command_BUF_OFF_ALL", "ti.uiactools.services"));
        vo.bind("Command_BUF_ON_ALL", om.findStrict("ti.uiactools.services.BufferUpload.Command_BUF_ON_ALL", "ti.uiactools.services"));
        vo.bind("Command_RESET_BUF_ALL", om.findStrict("ti.uiactools.services.BufferUpload.Command_RESET_BUF_ALL", "ti.uiactools.services"));
        vo.bind("Command_SNAPSHOT_ALL", om.findStrict("ti.uiactools.services.BufferUpload.Command_SNAPSHOT_ALL", "ti.uiactools.services"));
        vo.bind("ErrorCode_NULLPOINTER", om.findStrict("ti.uiactools.services.BufferUpload.ErrorCode_NULLPOINTER", "ti.uiactools.services"));
        vo.bind("$$tdefs", Global.newArray(tdefs.toArray()));
        vo.bind("$$proxies", Global.newArray(proxies.toArray()));
        vo.bind("$$mcfgs", Global.newArray(mcfgs.toArray()));
        vo.bind("$$icfgs", Global.newArray(icfgs.toArray()));
        ((Value.Arr)pkgV.getv("$modules")).add(vo);
        ((Value.Arr)om.findStrict("$modules", "ti.uiactools.services")).add(vo);
        vo.bind("$$instflag", 0);
        vo.bind("$$iobjflag", 0);
        vo.bind("$$sizeflag", 1);
        vo.bind("$$dlgflag", 0);
        vo.bind("$$iflag", 1);
        vo.bind("$$romcfgs", "|");
        vo.bind("$$nortsflag", 0);
        if (isCFG) {
            Proto.Str ps = (Proto.Str)vo.find("Module_State");
            if (ps != null) vo.bind("$object", ps.newInstance());
            vo.bind("$$meta_iobj", 1);
        }//isCFG
        vo.bind("processCallback", om.findStrict("ti.uiactools.services.BufferUpload.processCallback", "ti.uiactools.services"));
        vo.bind("disableAllBuffers", om.findStrict("ti.uiactools.services.BufferUpload.disableAllBuffers", "ti.uiactools.services"));
        vo.bind("enableAllBuffers", om.findStrict("ti.uiactools.services.BufferUpload.enableAllBuffers", "ti.uiactools.services"));
        vo.bind("snapshotAllBuffers", om.findStrict("ti.uiactools.services.BufferUpload.snapshotAllBuffers", "ti.uiactools.services"));
        vo.bind("resetAllBuffers", om.findStrict("ti.uiactools.services.BufferUpload.resetAllBuffers", "ti.uiactools.services"));
        vo.bind("startDataTx", om.findStrict("ti.uiactools.services.BufferUpload.startDataTx", "ti.uiactools.services"));
        vo.bind("stopDataTx", om.findStrict("ti.uiactools.services.BufferUpload.stopDataTx", "ti.uiactools.services"));
        vo.bind("isDataTx", om.findStrict("ti.uiactools.services.BufferUpload.isDataTx", "ti.uiactools.services"));
        vo.bind("packetBufferExchange", om.findStrict("ti.uiactools.services.BufferUpload.packetBufferExchange", "ti.uiactools.services"));
        vo.bind("sendEvents", om.findStrict("ti.uiactools.services.BufferUpload.sendEvents", "ti.uiactools.services"));
        vo.bind("processMsg", om.findStrict("ti.uiactools.services.BufferUpload.processMsg", "ti.uiactools.services"));
        vo.bind("flushBuffer", om.findStrict("ti.uiactools.services.BufferUpload.flushBuffer", "ti.uiactools.services"));
        vo.bind("acknowledgeCmd", om.findStrict("ti.uiactools.services.BufferUpload.acknowledgeCmd", "ti.uiactools.services"));
        vo.bind("enableBuffer", om.findStrict("ti.uiactools.services.BufferUpload.enableBuffer", "ti.uiactools.services"));
        vo.bind("disableBuffer", om.findStrict("ti.uiactools.services.BufferUpload.disableBuffer", "ti.uiactools.services"));
        vo.bind("getCpuSpeed", om.findStrict("ti.uiactools.services.BufferUpload.getCpuSpeed", "ti.uiactools.services"));
        vo.bind("resetBuffer", om.findStrict("ti.uiactools.services.BufferUpload.resetBuffer", "ti.uiactools.services"));
        vo.bind("changePeriod", om.findStrict("ti.uiactools.services.BufferUpload.changePeriod", "ti.uiactools.services"));
        vo.bind("$$fxntab", Global.newArray("ti_uiactools_services_BufferUpload_Module__startupDone__E", "ti_uiactools_services_BufferUpload_processCallback__E", "ti_uiactools_services_BufferUpload_disableAllBuffers__E", "ti_uiactools_services_BufferUpload_enableAllBuffers__E", "ti_uiactools_services_BufferUpload_snapshotAllBuffers__E", "ti_uiactools_services_BufferUpload_resetAllBuffers__E", "ti_uiactools_services_BufferUpload_startDataTx__E", "ti_uiactools_services_BufferUpload_stopDataTx__E", "ti_uiactools_services_BufferUpload_isDataTx__E", "ti_uiactools_services_BufferUpload_packetBufferExchange__E"));
        vo.bind("$$logEvtCfgs", Global.newArray("LD_recordsSent", "LD_cmdRcvd"));
        vo.bind("$$errorDescCfgs", Global.newArray());
        vo.bind("$$assertDescCfgs", Global.newArray());
        Value.Map atmap = (Value.Map)vo.getv("$attr");
        atmap.seal("length");
        vo.bind("MODULE_STARTUP$", 0);
        vo.bind("PROXY$", 0);
        loggables.clear();
        loggables.add(Global.newObject("name", "packetBufferExchange", "entry", "%p, %p", "exit", "%p"));
        vo.bind("$$loggables", loggables.toArray());
        pkgV.bind("BufferUpload", vo);
        ((Value.Arr)pkgV.getv("$unitNames")).add("BufferUpload");
    }

    void $$INITIALIZATION()
    {
        Value.Obj vo;

        if (isCFG) {
        }//isCFG
        Global.callFxn("module$meta$init", (Scriptable)om.findStrict("ti.uiactools.services.BufferUpload", "ti.uiactools.services"));
        if (isCFG) {
            vo = (Value.Obj)om.findStrict("ti.uiactools.services.BufferUpload", "ti.uiactools.services");
            Global.put(vo, "rovViewInfo", Global.callFxn("create", (Scriptable)om.find("xdc.rov.ViewInfo"), Global.newObject("viewMap", Global.newArray(new Object[]{Global.newArray(new Object[]{"Module", Global.newObject("type", om.find("xdc.rov.ViewInfo.MODULE"), "viewInitFxn", "viewInitModule", "structName", "ModuleView")})}))));
        }//isCFG
        Global.callFxn("init", pkgV);
        ((Value.Obj)om.getv("ti.uiactools.services.BufferUpload")).bless();
        ((Value.Arr)om.findStrict("$packages", "ti.uiactools.services")).add(pkgV);
    }

    public void exec( Scriptable xdcO, Session ses )
    {
        this.xdcO = xdcO;
        this.ses = ses;
        om = (Value.Obj)xdcO.get("om", null);

        Object o = om.geto("$name");
        String s = o instanceof String ? (String)o : null;
        isCFG = s != null && s.equals("cfg");
        isROV = s != null && s.equals("rov");

        $$IMPORTS();
        $$OBJECTS();
        BufferUpload$$OBJECTS();
        BufferUpload$$CONSTS();
        BufferUpload$$CREATES();
        BufferUpload$$FUNCTIONS();
        BufferUpload$$SIZES();
        BufferUpload$$TYPES();
        if (isROV) {
            BufferUpload$$ROV();
        }//isROV
        $$SINGLETONS();
        BufferUpload$$SINGLETONS();
        $$INITIALIZATION();
    }
}
