Gurux.DLMS.GXByteBuffer.Get C# (CSharp) Method

Get() public method

Get value from the byte array.
public Get ( byte target ) : void
target byte Target array.
return void
        public void Get(byte[] target)
        {
            if (Size - Position < target.Length)
            {
                throw new OutOfMemoryException();
            }
            Buffer.BlockCopy(Data, Position, target, 0, target.Length);
            Position += target.Length;
        }

Usage Example

Esempio n. 1
0
        /// <summary>
        /// Parse register request.
        /// </summary>
        /// <param name="value"></param>
        /// <returns>System title mac address.</returns>
        public void ParseRegisterRequest(GXByteBuffer value)
        {
            //Get System title.
            byte[] st;
            if (settings.InterfaceType == Enums.InterfaceType.PlcHdlc)
            {
                st = new byte[8];
            }
            else
            {
                st = new byte[6];
            }
            value.Get(st);
            byte count = value.GetUInt8();

            for (int pos = 0; pos != count; ++pos)
            {
                //Get System title.
                if (settings.InterfaceType == Enums.InterfaceType.PlcHdlc)
                {
                    st = new byte[8];
                }
                else
                {
                    st = new byte[6];
                }
                value.Get(st);
                SystemTitle = st;
                //MAC address.
                MacSourceAddress = value.GetUInt16();
            }
        }
All Usage Examples Of Gurux.DLMS.GXByteBuffer::Get