Пример #1
0
        /// <summary>
        /// Used to generate a heart beat.
        /// The pending status is propogated to the public interface and the pending status is cleared.
        /// </summary>
        /// <returns>True if the status has changed.</returns>
        public bool PulseAlive()
        {
            bool ret = false;

            lock (this)
            {
                ret            = (mStatus != mPendingStatus);
                mStatus        = mPendingStatus;
                mPendingStatus = EquipmentFlages.None;
            }

            return(ret);
        }
Пример #2
0
        /// <summary>
        /// Updates the BuildNo, Mask and Status.
        /// </summary>
        /// <param name="info">Device details to update this device to.</param>
        /// <returns>True if any data was changed, false if no fields needed updating.</returns>
        /// <remarks>
        /// The Status information is staged to allow for any gitter.
        /// Use the <see cref="PulseAlive"/> method to propogate the Status to the public interface.
        /// </remarks>
        public DeviceCatalogue.CatalogueChangeType Update(DeviceCatalogueInfo info)
        {
            DeviceCatalogue.CatalogueChangeType ret = DeviceCatalogue.CatalogueChangeType.NONE;

            lock (this)
            {
                if (mBuildNo != info.mBuildNo || mMask != info.mMask)
                {
                    mBuildNo = info.BuildNo;
                    mMask   |= info.mMask;
                    ret      = DeviceCatalogue.CatalogueChangeType.EQUIPMENT;
                }
                mPendingStatus |= info.mStatus;
            }

            return(ret);
        }