Example #1
0
 public Command(byte id, byte length, byte category, byte parameter, CommandDataType commandDataType, CommandOperationType commandOperationType)
 {
     Id            = id;
     Length        = length;
     Category      = category;
     Parameter     = parameter;
     DataType      = (byte)commandDataType;
     OperationType = (byte)commandOperationType;
 }
Example #2
0
 /// <summary>
 /// 获得命令数据参数方法,根据命令类型
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 public static CmdData GetCmdData(CommandDataType type)
 {
     if (type == CommandDataType.FT)
     {
         if (gcmddata == null)
         {
             gcmddata = new CmdDataFT();
         }
         else
         {
             if (type != cmdtype)
             {
                 gcmddata = new CmdDataFT();
             }
         }
     }
     else if (type == CommandDataType.A4)
     {
     }
     cmdtype = type;
     return(gcmddata);
 }