Exemplo n.º 1
0
        private void button5_Click(object sender, EventArgs e)
        {
            CoreFunction_API.IMC_CORE_ACCESS_BOOTCOUNTER Parm_AB = new CoreFunction_API.IMC_CORE_ACCESS_BOOTCOUNTER();
            unsafe
            {
                bool  status; Parm_AB.enable = &status;
                Int32 value; Parm_AB.value   = &value;

                Parm_AB.mode   = 1;
                Parm_AB.OPFlag = 1;
                if (BootCntStatusCmbBox.Text == "True")
                {
                    status = true;
                }
                else
                {
                    status = false;
                }
                if (IMC_ERR_NO_ERROR != CoreFunction_API.CORE_AccessBootCounter(ref Parm_AB))
                {
                    MessageBox.Show("Fails to get boot counter status!");
                }

                Parm_AB.OPFlag = 2;
                value          = Convert.ToInt32(BootTimesTxtBx.Text);
                if (IMC_ERR_NO_ERROR != CoreFunction_API.CORE_AccessBootCounter(ref Parm_AB))
                {
                    MessageBox.Show("Fails to get boot times!");
                }
            }
        }
Exemplo n.º 2
0
        private void button4_Click(object sender, EventArgs e)
        {
            CoreFunction_API.IMC_CORE_ACCESS_BOOTCOUNTER Parm_AB = new CoreFunction_API.IMC_CORE_ACCESS_BOOTCOUNTER();
            unsafe
            {
                bool  status; Parm_AB.enable = &status;
                Int32 value; Parm_AB.value   = &value;

                Parm_AB.mode   = 0;
                Parm_AB.OPFlag = 1;

                CoreFunction_API.CORE_AccessBootCounter(ref Parm_AB);
                if (status == true)
                {
                    BootCntStatusCmbBox.Text = "True";
                }
                else
                {
                    BootCntStatusCmbBox.Text = "False";
                }

                Parm_AB.OPFlag = 2;
                CoreFunction_API.CORE_AccessBootCounter(ref Parm_AB);
                BootTimesTxtBx.Text = value.ToString();
            }
        }