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 }; }
public MotorBaseRequest() { CodeArea = new CIICodeArea(); }
public MotorBaseResponse() { CodeArea = new CIICodeArea(); CodeArea.CRC16Code = new byte[2]; }