示例#1
0
        protected override void SystemExclusiveReceived(object?sender, IntegraSystemExclusiveEventArgs e)
        {
            if (!IsCached)
            {
                return;
            }

            if (e.SystemExclusive.Address == Address)
            {
                if (e.SystemExclusive.Data.Length == Size)
                {
                    // Model data received
                    if (Initialize(e.SystemExclusive.Data))
                    {
                        // Model is initialized
                    }
                }
                else
                {
                    // TODO:
                    ReceivedProperty(e.SystemExclusive);
                }
            }
            else if (e.SystemExclusive.Address.InRange(Address, Address + Size))
            {
                // Parameter data received
                ReceivedProperty(e.SystemExclusive);
            }
        }
        /// <summary>
        /// Handles received system exclusive messages matched to the exact address and length.
        /// </summary>
        /// <param name="sender">The device that raised the event.</param>
        /// <param name="e">The system exclusive message data.</param>
        protected override void SystemExclusiveReceived(object?sender, IntegraSystemExclusiveEventArgs e)
        {
            if (e.SystemExclusive.Address == Address)
            {
                if (e.SystemExclusive.Data.Length == _ItemSize)
                {
                    // Skip the empty message of 0x00 bytes received between requests
                    if (e.SystemExclusive.Data[0] == 0x00)
                    {
                        return;
                    }

                    if (Initialize(e.SystemExclusive.Data))
                    {
                        // Collection Initialized
                    }
                }
            }
        }