Example #1
0
        public void setState(ChipPowerState state)
        {
            switch (state)
            {
                case ChipPowerState.Sensor:
                    this.rdbSensor.Checked = true;
                    return;

                case ChipPowerState.Standby:
                    this.rdbStandby.Checked = true;
                    return;

                case ChipPowerState.Tune:
                    this.rdbTune.Checked = true;
                    return;

                case ChipPowerState.TX:
                    this.rdbTX.Checked = true;
                    return;
            }
            this.rdbShutDown.Checked = true;
        }
Example #2
0
        private void sts_stateChanged(ChipPowerState state)
        {
            byte[] buffer4 = new byte[3];
            buffer4[0] = 0x67;
            byte[] buffer = buffer4;
            byte[] buffer5 = new byte[3];
            buffer5[0] = 0x60;
            byte[] buffer2 = buffer5;
            byte[] buffer6 = new byte[6];
            buffer6[0] = 0x62;
            buffer6[5] = 1;
            byte[] buffer3 = buffer6;
            byte[][] rfCommandSet = new byte[][] { buffer, buffer2 };
            switch (state)
            {
                case ChipPowerState.ShutDown:
                    buffer[1] = (byte) (buffer2[1] | 1);
                    buffer2[1] = (byte) (buffer2[1] | 1);
                    break;

                case ChipPowerState.Sensor:
                    buffer[2] = 1;
                    buffer2[2] = 1;
                    break;

                case ChipPowerState.Tune:
                    buffer[2] = 2;
                    buffer2[2] = 2;
                    break;

                case ChipPowerState.TX:
                    rfCommandSet = new byte[][] { buffer3 };
                    break;
            }
            byte[][] dcpPrefixCommandSet = new byte[rfCommandSet.Length][];
            for (int i = 0; i < dcpPrefixCommandSet.Length; i++)
            {
                dcpPrefixCommandSet[i] = new byte[] { 0x27, 0x70, (byte) rfCommandSet[i].Length };
            }
            TelegramContainer container = this.createSeries(Task.ExecutingCommand, rfCommandSet.Length, dcpPrefixCommandSet, rfCommandSet, new Telegram.Callback(this.processSimpleCommunicationReplyTelegram), new bool[rfCommandSet.Length]);
            for (int j = 0; j < container.Count; j++)
            {
                container[j].telegram.UserDataExt.addUserData("SentData", "> " + WDSConverters.ToHexString(container[j].telegram.data.Buf, container[j].telegram.data.Buf.Length));
            }
            this.sbProgressBar.Reset();
            this.sbProgressBar.EndPoint = container.Count;
            this.sbDeviceStatePane.Text = this.getStatusString((Task) container[0].telegram.UserDataExt.StoredUserData["Task"]);
            if (this._ioph.telegramSeriesFromMainWin(container, SeriesExecutionState.Run, true) == -1)
            {
                MessageBox.Show("Device is BUSY!");
            }
        }