示例#1
0
        private static void RunFirmwareDownload()
        {
            try
            {
                _fwdl = InternalLib.Request.FirmwareDownload(1004, 1101);

                //_fwdl.Enter.Execute();
                //_fwdl.Enter.Execute(_internalCallback);
                InternalAPICallbackItem item = _fwdl.Enter.Execute(TimeSpan.FromSeconds(10));
                if (null == item)
                {
                    _fwdl.Enter.Cancel();
                }

                item = _fwdl.Download.Execute(TimeSpan.FromSeconds(10));
                if (null == item)
                {
                    _fwdl.Download.Cancel();
                }

                //Transfer only makes sense if firmware type is third party over zigbee.
                //item = _fwdl.Transfer.Execute(_internalCallback, TimeSpan.FromMinutes(3), TimeSpan.FromSeconds(15));
                //if (null == item)
                //    _fwdl.Transfer.Cancel();

                item = _fwdl.Activate.Execute(TimeSpan.FromSeconds(10));
                if (null == item)
                {
                    _fwdl.Activate.Cancel();
                }

                item = _fwdl.Exit.Execute(TimeSpan.FromSeconds(10));
                if (null == item)
                {
                    _fwdl.Exit.Cancel();
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("RunFirmwareDownload: " + ex.Message);
            }
        }
示例#2
0
        private void 固件升级ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FirmwareDownload fd = new FirmwareDownload();

            fd.ShowDialog();
        }