Exemplo n.º 1
0
        /// <summary>
        /// Toes the byte.
        /// </summary>
        /// <returns></returns>
        public byte ToByte()
        {
            BitArray bitArray = new BitArrayBuilder()
                                .Add(!DestinationAddressIsKnxDeviceAddress)
                                .Add(RoutingCounter, 3)
                                .Add(0, 4) // add 4 empty bits ( don't know, what they mean, but we should find out some day... )
                                .ToBitArray();

            return(bitArray.ToByteArray()[0]);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Serializes this instance into a single byte.
        /// </summary>
        /// <returns><c>byte</c></returns>
        public byte ToByte()
        {
            BitArray bitArray = new BitArrayBuilder()
                                .Add(IsStandardFrame) // set standard frame (see calimero... don't know what it mean!)
                                .Add(false)
                                .Add(!IsRepetition)   // If the message is send the first time, this flag needs to be false; otherwise true.
                                .Add(true)
                                .Add((byte)Priority, 2)
                                .Add(false)
                                .Add(IsPositivConfirmation)
                                .ToBitArray();

            return(bitArray.ToByteArray()[0]);
        }