Exemple #1
0
        internal static wclWeDoVersion FromByteArray(Byte[] Data)
        {
            wclWeDoVersion Version = new wclWeDoVersion();

            Version.MajorVersion  = Data[0];
            Version.MinorVersion  = Data[1];
            Version.BugFixVersion = Data[2];
            Version.BuildNumber   = Data[3];
            return(Version);
        }
Exemple #2
0
        /// <summary> Compares two versions. </summary>
        /// <param name="obj"> The other object to be compared with current. </param>
        /// <returns> <c>True</c> if this version is equal to <c>obj</c>.
        ///   <c>False</c> otherwise. </returns>
        public override Boolean Equals(Object obj)
        {
            if (ReferenceEquals(obj, null))
            {
                return(false);
            }
            if (ReferenceEquals(this, obj))
            {
                return(true);
            }
            if (this.GetType() != obj.GetType())
            {
                return(false);
            }

            wclWeDoVersion Version = (wclWeDoVersion)obj;

            return(Version.BugFixVersion == BugFixVersion && Version.BuildNumber == BuildNumber &&
                   Version.MajorVersion == MajorVersion && Version.MinorVersion == MinorVersion);
        }
Exemple #3
0
        /// <summary> Creates new IO device object. </summary>
        /// <param name="Hub"> The Hub object that owns the device. If this parameter is <c>null</c>
        ///   the <seealso cref="wclEInvalidArgument"/> exception raises. </param>
        /// <param name="ConnectionId"> The device's Connection ID. </param>
        /// <seealso cref="wclWeDoHub"/>
        /// <exception cref="wclEInvalidArgument"> The exception raises when the <c>Hub</c>
        ///   parameter is <c>null</c>. </exception>
        public wclWeDoIo(wclWeDoHub Hub, Byte ConnectionId)
        {
            if (Hub == null)
            {
                throw new wclEInvalidArgument("Hub parameter can not be null.");
            }

            FAttached           = true; // It is always attached on creation!
            FConnectionId       = ConnectionId;
            FDataFormats        = new List <wclWeDoDataFormat>();
            FDefaultInputFormat = null;
            FDeviceType         = wclWeDoIoDeviceType.iodUnknown;
            FFirmwareVersion    = new wclWeDoVersion();
            FHardwareVersion    = new wclWeDoVersion();
            FHub                  = Hub;
            FInputFormat          = null;
            FInternal             = true;
            FPortId               = 0;
            FNumbersFromValueData = new List <Byte[]>();
            FValidDataFormats     = new List <wclWeDoDataFormat>();
            FValue                = null;
        }