コード例 #1
0
        public static string PreRegisterHub(string addr)
        {
            string errmsg = "";

            InternalStuff.initYoctopuceLibrary(ref errmsg, true);

            InternalStuff.log("Pre-registering Hub (" + addr + ") ...");
            if (YAPI.PreregisterHub(addr, ref errmsg) != YAPI.SUCCESS)
            {
                string msg = addr + " Hub  asynch registering failed (" + errmsg + ")";
                return(msg);
            }

            try { YAPI.UpdateDeviceList(ref errmsg); } catch (Exception) { }
            return("");
        }
コード例 #2
0
        // perform the initial setup that may be done without a YoctoAPI object (hwd can be null)
        internal virtual void base_init(YFunction hwd, string instantiationName)
        {
            string errmsg = "";

            _func = hwd;
            _instantiationName = instantiationName;
            InternalStuff.initYoctopuceLibrary(ref errmsg, true);
            if (_func != null)
            {
                try
                {
                    _func.set_userData(this);
                    _hwdid = _func.get_hardwareId();
                    //InternalStuff.log(" hwdID = " + _hwdid);
                }
                catch (Exception)
                {
                    //InternalStuff.log("Failed to find out HwdID, device is probably offline ");
                }
            }
        }