public override byte[] make() { PduBuffer = new byte[] { FuncNo, Reg16.hi(StartAddress), Reg16.lo(StartAddress), Reg16.hi(RegsQuant), Reg16.lo(RegsQuant) }; return(PduBuffer); }
public static byte[] make_frame(byte _slAddress, byte[] _pdu) { int _pduLen = _pdu.Length; int _aduLen = 1 + _pduLen + 2; byte[] _array = new byte[_aduLen]; _array[0] = _slAddress; Array.Copy(_pdu, 0, _array, 1, _pduLen); ushort _crc16 = crc16_est(_array, _aduLen - 2); _array[_aduLen - 2] = Reg16.lo(_crc16); _array[_aduLen - 1] = Reg16.hi(_crc16); return(_array); }