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

GetUInt8() public method

Get UInt8 value from byte array from the current position and then increments the position.
public GetUInt8 ( ) : byte
return byte
        public byte GetUInt8()
        {
            byte value = GetUInt8(Position);
            ++Position;
            return value;
        }

Same methods

GXByteBuffer::GetUInt8 ( int index ) : byte

Usage Example

Esempio n. 1
0
        /// <summary>
        /// Parse discover reply.
        /// </summary>
        /// <param name="value"></param>
        /// <returns>Array of system titles and alarm descriptor error code</returns>
        public List <GXDLMSPlcMeterInfo> ParseDiscover(GXByteBuffer value, UInt16 sa, UInt16 da)
        {
            List <GXDLMSPlcMeterInfo> list = new List <GXDLMSPlcMeterInfo>();
            byte count = value.GetUInt8();

            for (int pos = 0; pos != count; ++pos)
            {
                GXDLMSPlcMeterInfo info = new GXDLMSPlcMeterInfo();
                info.SourceAddress      = sa;
                info.DestinationAddress = da;
                //Get System title.
                if (settings.InterfaceType == Enums.InterfaceType.PlcHdlc)
                {
                    info.SystemTitle = new byte[8];
                }
                else
                {
                    info.SystemTitle = new byte[6];
                }
                value.Get(info.SystemTitle);
                // Alarm descriptor of the reporting system.
                // Alarm-Descriptor presence flag
                if (value.GetUInt8() != 0)
                {
                    //Alarm-Descriptor
                    info.AlarmDescriptor = value.GetUInt8();
                }
                list.Add(info);
            }
            return(list);
        }
All Usage Examples Of Gurux.DLMS.GXByteBuffer::GetUInt8