/// <summary>
        /// Adds an <see cref="ExtractedBytes"/> with the supplied parameters.
        /// </summary>
        /// <param name="format"></param>
        /// <param name="payload"></param>
        /// <param name="offset"></param>
        /// <param name="length"></param>
        /// <param name="checksumFailed"></param>
        /// <param name="hasParity"></param>
        public ExtractedBytes AddExtractedBytes(ExtractedBytesFormat format, byte[] payload, int offset, int length, bool checksumFailed, bool hasParity)
        {
            var result = new ExtractedBytes()
            {
                Bytes          = payload,
                Offset         = offset,
                Length         = length,
                Format         = format,
                ChecksumFailed = checksumFailed,
                HasParity      = hasParity,
            };

            ExtractedBytes.Add(result);

            return(result);
        }
 /// <summary>
 /// Adds an <see cref="ExtractedBytes"/> with the supplied parameters.
 /// </summary>
 /// <param name="format"></param>
 /// <param name="payload"></param>
 /// <param name="checksumFailed"></param>
 /// <param name="hasParity"></param>
 public void AddExtractedBytes(ExtractedBytesFormat format, byte[] payload, bool checksumFailed, bool hasParity)
 {
     AddExtractedBytes(format, payload, 0, payload.Length, checksumFailed, hasParity);
 }
 /// <summary>
 /// Adds an <see cref="ExtractedBytes"/> with the supplied parameters.
 /// </summary>
 /// <param name="format"></param>
 /// <param name="payload"></param>
 public void AddExtractedBytes(ExtractedBytesFormat format, byte[] payload)
 {
     AddExtractedBytes(format, payload, 0, payload.Length, false, false);
 }
        /// <summary>
        /// Adds an <see cref="ExtractedBytes"/> with a given payload expressed as an ASCII string.
        /// </summary>
        /// <param name="format"></param>
        /// <param name="asciiPayload"></param>
        /// <param name="offset"></param>
        /// <param name="length"></param>
        /// <param name="checksumFailed"></param>
        /// <param name="hasParity"></param>
        public void AddExtractedBytes(ExtractedBytesFormat format, string asciiPayload, int offset, int length, bool checksumFailed, bool hasParity)
        {
            var bytes = Encoding.ASCII.GetBytes(asciiPayload);

            AddExtractedBytes(format, bytes, offset, length, checksumFailed, hasParity);
        }
        /// <summary>
        /// Adds an <see cref="ExtractedBytes"/> with a given payload expressed as an ASCII string.
        /// </summary>
        /// <param name="format"></param>
        /// <param name="asciiPayload"></param>
        public void AddExtractedBytes(ExtractedBytesFormat format, string asciiPayload)
        {
            var bytes = Encoding.ASCII.GetBytes(asciiPayload);

            AddExtractedBytes(format, bytes, 0, bytes.Length, false, false);
        }
        /// <summary>
        /// Adds an <see cref="ExtractedBytes"/> with a simple payload of the supplied length and format.
        /// </summary>
        /// <param name="format"></param>
        /// <param name="length"></param>
        /// <param name="checksumFailed"></param>
        /// <param name="hasParity"></param>
        public void AddExtractedBytes(ExtractedBytesFormat format, int length, bool checksumFailed, bool hasParity)
        {
            var bytes = new byte[length];

            AddExtractedBytes(format, bytes, 0, length, checksumFailed, hasParity);
        }
        /// <summary>
        /// Adds an <see cref="ExtractedBytes"/> with a simple payload of the supplied length and format.
        /// </summary>
        /// <param name="format"></param>
        /// <param name="length"></param>
        public void AddExtractedBytes(ExtractedBytesFormat format, int length)
        {
            var bytes = new byte[length];

            AddExtractedBytes(format, bytes, 0, length, false, false);
        }
 public CommonMessageBytesExtractorTests(TestContext testContext, IMessageBytesExtractor extractor, ExtractedBytesFormat format)
 {
     TestContext = testContext;
     Extractor   = extractor;
     Format      = format;
 }
Пример #9
0
 /// <summary>
 /// Adds an <see cref="ExtractedBytes"/> with the supplied parameters.
 /// </summary>
 /// <param name="format"></param>
 /// <param name="payload"></param>
 /// <param name="offset"></param>
 /// <param name="length"></param>
 /// <param name="checksumFailed"></param>
 /// <param name="hasParity"></param>
 /// <returns></returns>
 public ExtractedBytes AddExtractedBytes(ExtractedBytesFormat format, byte[] payload, int offset, int length, bool checksumFailed, bool hasParity)
 {
     return(AddExtractedBytes(format, payload, offset, length, checksumFailed, hasParity, null));
 }
Пример #10
0
 /// <summary>
 /// Adds an <see cref="ExtractedBytes"/> with the supplied parameters.
 /// </summary>
 /// <param name="format"></param>
 /// <param name="payload"></param>
 public ExtractedBytes AddExtractedBytes(ExtractedBytesFormat format, byte[] payload)
 {
     return(AddExtractedBytes(format, payload, 0, payload.Length, false, false, null));
 }
Пример #11
0
        /// <summary>
        /// Adds an <see cref="ExtractedBytes"/> with a given payload expressed as an ASCII string.
        /// </summary>
        /// <param name="format"></param>
        /// <param name="asciiPayload"></param>
        /// <param name="offset"></param>
        /// <param name="length"></param>
        /// <param name="checksumFailed"></param>
        /// <param name="hasParity"></param>
        /// <param name="signalLevel"></param>
        public ExtractedBytes AddExtractedBytes(ExtractedBytesFormat format, string asciiPayload, int offset, int length, bool checksumFailed, bool hasParity, int?signalLevel)
        {
            var bytes = Encoding.ASCII.GetBytes(asciiPayload);

            return(AddExtractedBytes(format, bytes, offset, length, checksumFailed, hasParity, signalLevel));
        }
Пример #12
0
        /// <summary>
        /// Adds an <see cref="ExtractedBytes"/> with a given payload expressed as an ASCII string.
        /// </summary>
        /// <param name="format"></param>
        /// <param name="asciiPayload"></param>
        /// <param name="checksumFailed"></param>
        /// <param name="hasParity"></param>
        public ExtractedBytes AddExtractedBytes(ExtractedBytesFormat format, string asciiPayload, bool checksumFailed, bool hasParity)
        {
            var bytes = Encoding.ASCII.GetBytes(asciiPayload);

            return(AddExtractedBytes(format, bytes, 0, bytes.Length, checksumFailed, hasParity, null));
        }
Пример #13
0
        /// <summary>
        /// Adds an <see cref="ExtractedBytes"/> with a given payload expressed as an ASCII string.
        /// </summary>
        /// <param name="format"></param>
        /// <param name="asciiPayload"></param>
        public ExtractedBytes AddExtractedBytes(ExtractedBytesFormat format, string asciiPayload)
        {
            var bytes = Encoding.ASCII.GetBytes(asciiPayload);

            return(AddExtractedBytes(format, bytes, 0, bytes.Length, false, false, null));
        }
Пример #14
0
        /// <summary>
        /// Adds an <see cref="ExtractedBytes"/> with a simple payload of the supplied length and format.
        /// </summary>
        /// <param name="format"></param>
        /// <param name="length"></param>
        /// <param name="checksumFailed"></param>
        /// <param name="hasParity"></param>
        public ExtractedBytes AddExtractedBytes(ExtractedBytesFormat format, int length, bool checksumFailed, bool hasParity)
        {
            var bytes = new byte[length];

            return(AddExtractedBytes(format, bytes, 0, length, checksumFailed, hasParity, null));
        }
Пример #15
0
        /// <summary>
        /// Adds an <see cref="ExtractedBytes"/> with a simple payload of the supplied length and format.
        /// </summary>
        /// <param name="format"></param>
        /// <param name="length"></param>
        public ExtractedBytes AddExtractedBytes(ExtractedBytesFormat format, int length)
        {
            var bytes = new byte[length];

            return(AddExtractedBytes(format, bytes, 0, length, false, false, null));
        }
Пример #16
0
 /// <summary>
 /// Adds an <see cref="ExtractedBytes"/> with a simple payload and the supplied format.
 /// </summary>
 /// <param name="format"></param>
 public ExtractedBytes AddExtractedBytes(ExtractedBytesFormat format)
 {
     return(AddExtractedBytes(format, new byte[] { 0x31 }, 0, 1, false, false, null));
 }
 /// <summary>
 /// Adds an <see cref="ExtractedBytes"/> with a simple payload and the supplied format.
 /// </summary>
 /// <param name="format"></param>
 public void AddExtractedBytes(ExtractedBytesFormat format)
 {
     AddExtractedBytes(format, new byte[] { 0x31 }, 0, 1, false, false);
 }
 public CommonMessageBytesExtractorTests(TestContext testContext, IMessageBytesExtractor extractor, ExtractedBytesFormat format)
 {
     TestContext = testContext;
     Extractor = extractor;
     Format = format;
 }