BACnet.Types.BitString24.WithBit C# (CSharp) Method

WithBit() public method

Creates a copy of this bitstring with a certain bit overriden
public WithBit ( int index, bool set = true ) : BitString24
index int The bit to override
set bool The value to override to
return BitString24
        public BitString24 WithBit(int index, bool set = true)
        {
            var mask = (ushort)(0x80000000 >> index);
            uint flags = _flags;
            if (set)
                flags |= mask;
            else
                flags &= (uint)~mask;
            return new BitString24(_length, flags);
        }