public UndocumentedControlFunction(
            InputByteArray InputArray, ControlFunctionCode FunctionCode, int ParmLength)
            : base(InputArray, FunctionCode)
        {
            InputArray.AdvanceIndex(1);

            // isolate the parm bytes.
            if (ParmLength > 0)
            {
                this.ParmBytes = InputArray.GetBytes(ParmLength);
            }
        }
示例#2
0
        public VariableLengthControlFunction(
            InputByteArray InputArray, ControlFunctionCode ControlCode)
            : base(InputArray, ControlCode)
        {
            // first 3 bytes contain control code and then length byte.
            {
                var buf = InputArray.PeekBytes(3);
                this.ByteCount = buf[2];
            }

            // byte count from 1 to 50
            if ((this.ByteCount < 1) || (this.ByteCount > InputArray.RemainingLength) ||
                (this.ByteCount > 20))
            {
                this.Errmsg = "invalid byte count";
            }

            // isolate function parameter bytes.
            if (this.Errmsg == null)
            {
                InputArray.AdvanceIndex(3);
                this.ParmBytes = InputArray.GetBytes(this.ByteCount - 1);
            }
        }
 public SingleByteControlFunction(
     InputByteArray InputArray, ControlFunctionCode FunctionCode)
     : base(InputArray, FunctionCode)
 {
     InputArray.AdvanceIndex(1);
 }
 public ControlFunction(InputByteArray InputArray, ControlFunctionCode ControlCode)
     : base(InputArray)
 {
     this.ControlCode = ControlCode;
 }