Exemple #1
0
 /// <summary>
 /// Create an <see cref="NmeaAisStaticDataReportParserPartB"/>.
 /// </summary>
 /// <param name="ascii">The ASCII-encoded message payload.</param>
 /// <param name="padding">The number of bits of padding in this payload.</param>
 public NmeaAisStaticDataReportParserPartB(ReadOnlySpan <byte> ascii, uint padding)
 {
     this.bits = new NmeaAisBitVectorParser(ascii, padding);
     if (this.PartNumber != 1)
     {
         throw new ArgumentException($"This is a parser for Part B (1) messages, but the part number of the message supplied is {this.PartNumber}");
     }
 }
 /// <summary>
 /// Create an <see cref="NmeaAisPositionReportClassBParser"/>.
 /// </summary>
 /// <param name="ascii">The ASCII-encoded message payload.</param>
 /// <param name="padding">The number of bits of padding in this payload.</param>
 public NmeaAisPositionReportClassBParser(ReadOnlySpan <byte> ascii, uint padding)
 {
     this.bits = new NmeaAisBitVectorParser(ascii, padding);
 }
        /// <summary>
        /// Inspects a Type 24: Static Data Report message and determines the message Part Number.
        /// </summary>
        /// <param name="ascii">The ASCII-encoded message payload.</param>
        /// <param name="padding">The number of bits of padding in this payload.</param>
        /// <returns>The part number.</returns>
        public static uint GetPartNumber(ReadOnlySpan <byte> ascii, uint padding)
        {
            var bits = new NmeaAisBitVectorParser(ascii, padding);

            return(bits.GetUnsignedInteger(2, 38));
        }
 /// <summary>
 /// Creates a <see cref="NmeaAisTextFieldParser"/>.
 /// </summary>
 /// <param name="bits">The bit vector (in 6-bit ASCII encoding) containing the name.</param>
 /// <param name="bitLength">The length of the name field in bits.</param>
 /// <param name="bitOffset">The bit offset of the name field within the bit vector.</param>
 public NmeaAisTextFieldParser(NmeaAisBitVectorParser bits, uint bitLength, uint bitOffset)
 {
     this.bits      = bits;
     this.bitOffset = bitOffset;
     this.bitLength = bitLength;
 }
Exemple #5
0
 /// <summary>
 /// Create an <see cref="NmeaAisPositionReportClassAParser"/>.
 /// </summary>
 /// <param name="ascii">The ASCII-encoded message payload.</param>
 /// <param name="padding">The number of bits of padding in this payload.</param>
 public NmeaAisLongRangeAisBroadcastParser(ReadOnlySpan <byte> ascii, uint padding)
 {
     this.bits = new NmeaAisBitVectorParser(ascii, padding);
 }
 /// <summary>
 /// Create an <see cref="NmeaAisStaticAndVoyageRelatedDataParser"/>.
 /// </summary>
 /// <param name="ascii">The ASCII-encoded message payload.</param>
 /// <param name="padding">The number of bits of padding in this payload.</param>
 public NmeaAisStaticAndVoyageRelatedDataParser(ReadOnlySpan <byte> ascii, uint padding)
 {
     this.bits = new NmeaAisBitVectorParser(ascii, padding);
 }