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

GetUInt16() public method

Get UInt16 value from byte array from the current position and then increments the position.
public GetUInt16 ( ) : UInt16
return System.UInt16
        public UInt16 GetUInt16()
        {
            UInt16 value = GetUInt16(Position);
            Position += 2;
            return value;
        }

Same methods

GXByteBuffer::GetUInt16 ( int index ) : UInt16

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::GetUInt16