コード例 #1
0
            private void WriteHeader(IBinaryHeaderEncoder writer, ushort messageLength)
            {
                writer.Write((byte)MessageType);
                writer.Write(EncodingFlags);
                switch (m_lengthFieldType)
                {
                case MessageLengthFieldTypeEnum.OneByte:
                    writer.Write(Convert.ToByte(messageLength));
                    break;

                case MessageLengthFieldTypeEnum.TwoBytes:
                    writer.Write(Convert.ToUInt16(messageLength));
                    break;

                case MessageLengthFieldTypeEnum.FourBytes:
                    writer.Write(Convert.ToUInt32(messageLength));
                    break;
                }
                writer.Write(MessageSequenceNumber);
                writer.Write(ConfigurationVersion.MajorVersion);
                writer.Write(ConfigurationVersion.MinorVersion);
                switch (MessageType)
                {
                case MessageTypeEnum.DataKeyFrame:
                case MessageTypeEnum.DataDeltaFrame:
                case MessageTypeEnum.Event:
                    writer.Write(TimeStamp);
                    writer.Write(FieldCount);
                    break;

                case MessageTypeEnum.KeepAlive:
                    break;

                case MessageTypeEnum.DataSetMetadata:
                    break;

                default:
                    break;
                }
            }
コード例 #2
0
 //methods
 private void WriteHeader(IBinaryHeaderEncoder m_Writer, ushort dataLength)
 {
     Debug.Assert(DataSetWriterIds != null);
     Debug.Assert(DataSetWriterIds.Count == MessageCount);
     m_Writer.Write(ProtocolVersion);
     m_Writer.Write(NetworkMessageFlags);
     m_Writer.Write(PublisherId);
     m_Writer.Write(SecurityTokenId);
     m_Writer.Write(NonceLength);
     for (int i = 0; i < NonceLength; i++)
     {
         m_Writer.Write(Nonce[i]);
     }
     m_Writer.Write(MessageCount);
     if (MessageCount == 0)
     {
         return;
     }
     for (int i = 0; i < DataSetWriterIds.Count; i++)
     {
         m_Writer.Write(DataSetWriterIds[i]);
     }
 }
コード例 #3
0
ファイル: MessageHeader.cs プロジェクト: yuriik83/OPC-UA-OOI
 private void WriteHeader(IBinaryHeaderEncoder writer, ushort messageLength)
 {
     writer.Write((byte)MessageType);
     writer.Write(EncodingFlags);
     switch (m_lengthFieldType)
     {
       case MessageLengthFieldTypeEnum.OneByte:
     writer.Write(Convert.ToByte(messageLength));
     break;
       case MessageLengthFieldTypeEnum.TwoBytes:
     writer.Write(Convert.ToUInt16(messageLength));
     break;
       case MessageLengthFieldTypeEnum.FourBytes:
     writer.Write(Convert.ToUInt32(messageLength));
     break;
     }
     writer.Write(MessageSequenceNumber);
     writer.Write(ConfigurationVersion.MajorVersion);
     writer.Write(ConfigurationVersion.MinorVersion);
     switch (MessageType)
     {
       case MessageTypeEnum.DataKeyFrame:
       case MessageTypeEnum.DataDeltaFrame:
       case MessageTypeEnum.Event:
     writer.Write(TimeStamp);
     writer.Write(FieldCount);
     break;
       case MessageTypeEnum.KeepAlive:
     break;
       case MessageTypeEnum.DataSetMetadata:
     break;
       default:
     break;
     }
 }
コード例 #4
0
ファイル: PacketHeader.cs プロジェクト: yuriik83/OPC-UA-OOI
 //methods
 private void WriteHeader(IBinaryHeaderEncoder m_Writer, ushort dataLength)
 {
     Debug.Assert(DataSetWriterIds != null);
     Debug.Assert(DataSetWriterIds.Count == MessageCount);
     m_Writer.Write(ProtocolVersion);
     m_Writer.Write(NetworkMessageFlags);
     m_Writer.Write(PublisherId);
     m_Writer.Write(SecurityTokenId);
     m_Writer.Write(NonceLength);
     for (int i = 0; i < NonceLength; i++)
       m_Writer.Write(Nonce[i]);
     m_Writer.Write(MessageCount);
     if (MessageCount == 0)
       return;
     for (int i = 0; i < DataSetWriterIds.Count; i++)
       m_Writer.Write(DataSetWriterIds[i]);
 }