Example #1
0
        // 5. Run command (S0, S2)
        private void btn5_Click(object sender, EventArgs e)
        {
            /*
             * dump_DST_nodeid = textBox3.Text;
             * dump_DST_nodeid = Regex.Replace(dump_DST_nodeid, " ", "");
             * char[] buf = dump_DST_nodeid.ToCharArray();
             * byte[] real_dst = new byte[1];
             * StringToHex.String_to_Hex(buf, real_dst, buf.Length);
             */

            dump_Network_Key = textBox4.Text;
            dump_Network_Key = Regex.Replace(dump_Network_Key, " ", "");
            char[] buf1    = dump_Network_Key.ToCharArray();
            byte[] real_Kn = new byte[16];
            StringToHex.String_to_Hex(buf1, real_Kn, buf1.Length);

            dump_command = textBox5.Text;
            dump_command = Regex.Replace(dump_command, " ", "");
            char[] buf2    = dump_command.ToCharArray();
            byte[] real_cm = new byte[buf2.Length / 2];
            StringToHex.String_to_Hex(buf2, real_cm, buf2.Length);

            dump_Nonce = textBox6.Text;
            dump_Nonce = Regex.Replace(dump_Nonce, " ", "");
            char[] buf3       = dump_Nonce.ToCharArray();
            byte[] real_nonce = new byte[8];
            StringToHex.String_to_Hex(buf3, real_nonce, buf3.Length);

            Send_command.RunCommand_Security(controller, real_dst_for_enc, real_cm, real_Kn, real_nonce);

            dump_DST_nodeid     = null;
            real_dst_for_enc[0] = 0;
            dump_Network_Key    = null;
            dump_command        = null;
            dump_Nonce          = null;
        }