Exemple #1
0
        /// <summary>
        /// test static method in the class
        /// for non-static method, it is also the same
        /// </summary>
        public static void TestStaticFcnImportFromClass()
        {
            Console.WriteLine("------test static function that in the class--------");
            ImportFcnClass.PrintInfo("23333");
            Console.WriteLine(ImportFcnClass.Add(5, 2));

            Console.WriteLine(ImportFcnClass.minus(5, 2));
            Console.WriteLine(ImportFcnClass.AddMnius(1, 2, 3));
        }
Exemple #2
0
        /// <summary>
        /// test function parameters with the stuct
        /// how the struct data convert with C++ and C#
        /// </summary>
        public static void TestImportFcnWithStruct()
        {
            Console.WriteLine("------struct import test-------");
            HSCAN_MSG[] msg = new HSCAN_MSG[5]; //发送缓冲区大小可根据需要设置;
            for (int yy = 0; yy < msg.Length; yy++)
            {
                msg[yy]      = new HSCAN_MSG();
                msg[yy].Port = (byte)((yy + 1) * 10);
            }

            for (int i = 1; i < 5; i++)
            {
                //msg[i] = ImportFcnClass.GenerateMsg();
            }
            Console.WriteLine("port : " + ImportFcnClass.HSCAN_SendCANMessage(0x0, 0x0, msg, msg.Count()));
        }