Esempio n. 1
0
        public void WriteData(AcnBinaryWriter data, bool tcpTransport)
        {
            ValidatePacket();

            if (!tcpTransport)
            {
                data.WriteOctet(PreambleSize);
                data.WriteOctet(PostambleSize);
            }

            data.WriteUtf8String(PacketId, 12);

            //PDU Block Size
            if (tcpTransport)
            {
                data.BaseStream.Seek(4, System.IO.SeekOrigin.Current);
            }

            //Save the position of the length so we can come back and fill it in.
            lengthPosition = data.BaseStream.Position;

            data.WriteOctet((short)((Flags << 12) + Length));
            data.WriteOctet(ProtocolId);
            data.Write(SenderId.ToByteArray());
        }
Esempio n. 2
0
 protected override void WriteData(AcnBinaryWriter data)
 {
     data.WriteUtf8String(SourceName, 64);
     data.WriteOctet(SequenceNumber);
     data.WriteOctet(EndpointID);
     data.BaseStream.Seek(1, SeekOrigin.Current);
 }
Esempio n. 3
0
 protected override void WriteData(AcnBinaryWriter data)
 {
     data.Write(AddressType);
     data.WriteOctet(FirstPropertyAddress);
     data.WriteOctet(AddressIncrement);
     data.WriteOctet(PropertyLength);
     WriteContent(data);
 }
Esempio n. 4
0
 protected override void WriteData(AcnBinaryWriter data)
 {
     data.Write(LeaderId.ToByteArray());
     data.WriteOctet(ChannelNumber);
     data.WriteOctet(MemberId);
     data.WriteOctet(ReliableSequenceNumber);
     data.WriteOctet(ReciprocalChannel);
 }
Esempio n. 5
0
 protected override void WriteData(AcnBinaryWriter data)
 {
     data.WriteUtf8String(SourceName, 64);
     data.Write(Priority);
     data.WriteOctet(SyncPacketAddress);
     data.Write(SequenceNumber);
     data.Write(Options);
     data.WriteOctet(Universe);
 }
Esempio n. 6
0
            /// <summary>
            /// Write the PDU information to the packet data to be transmitted.
            /// </summary>
            /// <param name="data">The packet data to be sent.</param>
            protected override void WriteData(AcnBinaryWriter data)
            {
                data.Write(Page);
                data.WriteOctet(TotalPages);

                foreach (int universe in universes)
                {
                    data.WriteOctet((short)universe);
                }
            }
Esempio n. 7
0
 protected override void WriteData(AcnBinaryWriter data)
 {
     data.Write(ComponentId.ToByteArray());
     data.WriteOctet(MemberId);
     data.WriteOctet(ChannelNumber);
     data.WriteOctet(ReciprocalChannel);
     data.WriteOctet(TotalSequenceNumber);
     data.WriteOctet(ReliableSequenceNumber);
     DestinationAddress.WriteData(data);
     ChannelParameterBlock.WriteData(data);
     data.Write(AdHocExpiry);
 }
Esempio n. 8
0
 protected override void WriteData(AcnBinaryWriter data)
 {
     data.WriteOctet(ChannelNumber);
     data.WriteOctet(TotalSequenceNumber);
     data.WriteOctet(ReliableSequenceNumber);
     data.WriteOctet(OldestAvailableWrapper);
     data.WriteOctet(FirstMemberToAck);
     data.WriteOctet(LastMemberToAck);
     data.WriteOctet(MAKThreshold);
     throw new NotImplementedException();
 }
Esempio n. 9
0
        public void WriteLength(AcnBinaryWriter data)
        {
            //Return to Length and update
            long endPosition = data.BaseStream.Position;

            Length = (int)(endPosition - lengthPosition);

            //Write PDU length.
            data.BaseStream.Seek(lengthPosition, System.IO.SeekOrigin.Begin);
            data.WriteOctet((short)((Length & 0x0FFF) + ((int)Flags << 12)));

            //Return to original stream position at end of PDU.
            data.BaseStream.Seek(endPosition, System.IO.SeekOrigin.Begin);
        }
Esempio n. 10
0
        public void WriteLength(AcnBinaryWriter data)
        {
            if (lengthPosition == 0)
            {
                throw new InvalidOperationException("You must write the root layer data first before calling WriteLength.");
            }

            //Update the Length
            Length = (int)(data.BaseStream.Position - lengthPosition);

            //Write the updated length to the packet data.
            long savedPosition = data.BaseStream.Position;

            data.BaseStream.Seek(lengthPosition, System.IO.SeekOrigin.Begin);
            data.WriteOctet((short)((Flags << 12) + Length));
            data.BaseStream.Seek(savedPosition, System.IO.SeekOrigin.Begin);
        }
Esempio n. 11
0
        public virtual void WritePdu(AcnBinaryWriter data)
        {
            //Save length and skip
            //We save the stream position of the length so we can come back later and write it.
            lengthPosition = data.BaseStream.Position;
            data.BaseStream.Seek(2, System.IO.SeekOrigin.Current);

            //Write the PDU Vector.
            switch (vectorLength)
            {
            case 1:
                data.Write((byte)Vector);
                break;

            case 4:
                data.WriteOctet(Vector);
                break;
            }

            //Write the PDU data.
            WriteData(data);
        }
Esempio n. 12
0
 protected override void WriteData(AcnBinaryWriter data)
 {
     data.WriteOctet(ProtocolId);
 }
 /// <summary>
 /// Write the PDU information to the packet data to be transmitted.
 /// </summary>
 /// <param name="data">The packet data to be sent.</param>
 protected override void WriteData(AcnBinaryWriter data)
 {
     data.Write(SequenceNumber);
     data.WriteOctet(SynchronizationAddress);
     data.BaseStream.Seek(2, SeekOrigin.Current);
 }
Esempio n. 14
0
 protected override void WriteData(AcnBinaryWriter data)
 {
     data.WriteOctet(ReliableSequenceNumber);
 }
Esempio n. 15
0
 protected override void WriteData(AcnBinaryWriter data)
 {
     data.WriteOctet(StatusCode);
     data.WriteUtf8String(StatusMessage, StatusMessage.Length);
 }