コード例 #1
0
 public void EndPositionTestMethod()
 {
     ushort _length = 16;
       HeaderWriterTest _htw = new HeaderWriterTest(x => { });
       HeaderWriter _hw = new HeaderWriter(_htw, _length);
       _htw.Write((byte)0x1);
       _htw.Write((byte)0x1);
       _htw.Write((byte)0x1);
       _htw.Write((byte)0x1);
       Assert.AreEqual<long>(_length + 4, _htw.Position);
 }
コード例 #2
0
ファイル: MessageHeader.cs プロジェクト: yuriik83/OPC-UA-OOI
 public ProducerMessageHeader(IBinaryHeaderEncoder writer, FieldEncodingEnum encoding, MessageLengthFieldTypeEnum lengthFieldType, MessageTypeEnum messageType, ConfigurationVersionDataType configurationVersion)
 {
     m_MessageType = messageType;
     m_Encoding = encoding;
     m_lengthFieldType = lengthFieldType;
     m_HeaderWriter = new HeaderWriter(writer, PackageHeaderLength());
     MessageSequenceNumber = 0;
     ConfigurationVersion = configurationVersion;
 }
コード例 #3
0
 public void CreatorTestMethod()
 {
     HeaderWriterTest _htw = new HeaderWriterTest(x => { });
       HeaderWriter _hw = new HeaderWriter(_htw, 16);
       Assert.AreEqual(16, _htw.Position);
 }
コード例 #4
0
ファイル: PacketHeader.cs プロジェクト: yuriik83/OPC-UA-OOI
 public ProducerHeader(IBinaryHeaderEncoder writer, Guid producerId, IList<UInt16> dataSetWriterIds)
     : base()
 {
     if (writer == null)
       throw new ArgumentNullException(nameof(writer));
     PublisherId = producerId;
     NetworkMessageFlags = Convert.ToByte(PacketFlagsDefinitions.NetworkMessageType.RegularMessages);
     ProtocolVersion = CommonDefinitions.ProtocolVersion;
     SecurityTokenId = 0;
     NonceLength = 0;
     DataSetWriterIds = new ReadOnlyCollection<UInt16>(dataSetWriterIds);
     MessageCount = Convert.ToByte(DataSetWriterIds.Count);
     ushort _packetLength = Convert.ToUInt16(m_PacketHeaderLength + dataSetWriterIds.Count * 2);
     m_HeaderWriter = new HeaderWriter(writer, _packetLength);
 }