예제 #1
0
        private void writeCmd(int cmd)
        {
            this.cmd = cmd;

            //if (log.DebugEnabled)
            {
                Console.WriteLine(string.Format("Starting cmd=0x{0:X}({1})", cmd, MECommand.getCommandName(cmd)));
            }
        }
예제 #2
0
        public override string ToString()
        {
            StringBuilder s = new StringBuilder(string.Format("cmd=0x{0:X}({1}), result=0x{2:X8}", cmd, MECommand.getCommandName(cmd), result));
            int           numberOfParameters = MECommand.getNumberOfParameters(cmd);

            for (int i = 0; i < numberOfParameters; i++)
            {
                s.Append(string.Format(", parameters[{0:D}]=0x{1:X8}", i, parameters[i]));
            }
            return(s.ToString());
        }
예제 #3
0
            public static int getNumberOfParameters(int cmd)
            {
                foreach (MECommand meCommand in MECommand.values())
                {
                    if (meCommand.Cmd == cmd)
                    {
                        return(meCommand.NumberOfParameters);
                    }
                }

                return(8);
            }
예제 #4
0
            public static string getCommandName(int cmd)
            {
                foreach (MECommand meCommand in MECommand.values())
                {
                    if (meCommand.Cmd == cmd)
                    {
                        return(meCommand.name());
                    }
                }

                return(string.Format("ME_CMD_UNKNOWN_{0:X}", cmd));
            }