Example #1
0
        public CIIBasePackage(CIICodeArea codeArea, bool request = true)
        {
            this.markHead   = new byte[] { 0x5D, 0x5B };
            this.DestLength = 0x01;
            this.DestRegion = (byte)(request == true ? 0x21 : 0xFE);

            this.SourceLength = 0x01;
            this.SourceRegion = (byte)(request == true ? 0xFE : 0x21);

            this.appData    = new byte[1 + 1 + 2 + codeArea.Length];
            this.appData[0] = codeArea.CommandCode;
            this.appData[1] = codeArea.AdditionCode;
            Array.Copy(codeArea.DataLength, 0, this.appData, 2, 2);
            if (codeArea.Length > 0)
            {
                Array.Copy(codeArea.Data, 0, this.appData, 4, codeArea.Length);
            }
            this.markTail = new byte[] { 0x5D, 0x5D };
        }
Example #2
0
 public MotorBaseRequest()
 {
     CodeArea = new CIICodeArea();
 }
Example #3
0
 public MotorBaseResponse()
 {
     CodeArea           = new CIICodeArea();
     CodeArea.CRC16Code = new byte[2];
 }