Exemplo n.º 1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="psem">The PSEM object for the current session.</param>
        /// <param name="table00">The Table 0 object for the current device.</param>
        /// <param name="table91">The Table 91 object for the current device.</param>
        //  Revision History
        //  MM/DD/YY Who Version Issue# Description
        //  -------- --- ------- ------ ---------------------------------------------
        //  02/14/07 RCG 8.00.12        Created

        public StdTable93(CPSEM psem, CTable00 table00, StdTable91 table91)
            : base(psem, 93, StdTable93.DetermineTableSize(table00, table91))
        {
            m_Table00 = table00;
            m_Table91 = table91;

            // Determine the size of the WINDOW_RCD record
            m_uiWindowRcdSize = table00.STIMESize * 2 + 1;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Reads the table from the meter and populates the data fields.
        /// </summary>
        /// <returns>The PSEM response code for the read request.</returns>
        //  Revision History
        //  MM/DD/YY Who Version Issue# Description
        //  -------- --- ------- ------ ---------------------------------------------
        //  02/21/07 RCG 8.00.12        Created

        public override PSEMResponse Read()
        {
            PSEMResponse Response      = PSEMResponse.Ok;
            uint         uiFillerBytes = 0;

            m_Logger.WriteLine(Logger.LoggingLevel.Detailed, "StdTable95.Read");

            // Read the table
            Response = base.Read();

            if (Response == PSEMResponse.Ok)
            {
                m_DataStream.Position = 0;

                // Parse the data that has been read.
                if (m_Table91.BitRate == StdTable91.BitRateTypes.SeperatelyControlled)
                {
                    // Read the Answer bit rate only if the bit rate is seperately controlled
                    m_uiAnswerBitRate = m_Reader.ReadUInt32();
                }

                if (m_Table91.NoLockoutParameters == false)
                {
                    // Read the lockout parameters only if the lockout parameters are available
                    m_byLockoutDelay     = m_Reader.ReadByte();
                    m_byRetryAttempts    = m_Reader.ReadByte();
                    m_byRetryLockoutTime = m_Reader.ReadByte();
                }

                m_byNumberOfRings = m_Reader.ReadByte();

                if (m_Table91.NumberOfAnswerWindows > 0)
                {
                    // Only read the Outside call window rings if answer windows are used
                    m_byNumberOfOutsideRings = m_Reader.ReadByte();
                }

                // Since we currently do not need the remaining data we are going to read this
                // information in as filler

                // Caller ID information
                uiFillerBytes += (uint)(m_Table91.NumberOfCallerIDs * m_Table91.CallerIDLength);

                // Windows information
                uiFillerBytes += (uint)(m_Table91.NumberOfAnswerWindows * StdTable93.WindowRcdSize(m_Table00));

                m_byFiller = m_Reader.ReadBytes((int)uiFillerBytes);
            }

            return(Response);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Calculates the size in bytes of standard table 95
        /// </summary>
        /// <param name="table00">The table 0 object for the current device.</param>
        /// <param name="table91">The table 91 object for the current device.</param>
        /// <returns>The size of the table in bytes.</returns>

        private static uint DetermineTableSize(CTable00 table00, StdTable91 table91)
        {
            uint uiTableSize = 0;

            // If the bit rate is set up to be seperately controlled then this
            // table will contain the answer baud rate
            if (table91.BitRate == StdTable91.BitRateTypes.SeperatelyControlled)
            {
                // ANSWER_BIT_RATE : UINT32
                uiTableSize += 4;
            }

            // If the meter supports lockout parameters we need to include the lockout
            // parameters. Notice the flag is true if there are no parameters and false
            // if there are lockout parameters.
            if (table91.NoLockoutParameters == false)
            {
                // LOCKOUT_DELAY        : UINT8
                // RETRY_ATTEMPTS       : UINT8
                // RETRY_LOCKOUT_TIME   : UINT8
                uiTableSize += 3;
            }

            // NBR_RINGS : UINT8
            uiTableSize += 1;

            // If the number of answer windows is greater than zero then the meter contains
            // the field for rings outside of the call window
            if (table91.NumberOfAnswerWindows > 0)
            {
                // NBR_RINGS_OUTSIDE : UINT8
                uiTableSize += 1;
            }

            // CALLER_IDS : ARRAY of CALLER_ID_RCD
            uiTableSize += (uint)(table91.NumberOfCallerIDs * table91.CallerIDLength);

            // WINDOWS : ARRAY of WINDOW_RCD
            uiTableSize += (uint)(table91.NumberOfAnswerWindows * StdTable93.WindowRcdSize(table00));

            return(uiTableSize);
        }