Struct NmeaAisBitVectorParser
Extracts values from a bit vector encoded using the NMEA 6-bit ASCII encoding for AIS payloads (AIVDM/AIVDO Payload Armoring).
Namespace: Ais.Net
Assembly: Ais.Net.dll
Syntax
public struct NmeaAisBitVectorParser
Constructors
| Improve this Doc View SourceNmeaAisBitVectorParser(ReadOnlySpan<Byte>, UInt32)
Creates a NmeaAisBitVectorParser.
Declaration
public NmeaAisBitVectorParser(ReadOnlySpan<byte> ascii, uint padding)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlySpan<System.Byte> | ascii | The ASCII data to be decoded. |
System.UInt32 | padding | The number of bits that are present at the end of the data that are to be ignored. (The ASCII encoding works in multiples of 6 bits, so we may end up with more bits present than were present in the source.) |
Properties
| Improve this Doc View SourceBitCount
Gets the number of valid bits in the payload (excluding any padding).
Declaration
public uint BitCount { get; }
Property Value
Type | Description |
---|---|
System.UInt32 |
Methods
| Improve this Doc View SourceGetBit(UInt32)
Gets the value of the specified bit.
Declaration
public bool GetBit(uint bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | bitOffset | The position of the bit to read. |
Returns
Type | Description |
---|---|
System.Boolean | True if the bit is 1, false if it is 0. |
GetSignedInteger(UInt32, UInt32)
Gets the value of a signed integer bitfield.
Declaration
public int GetSignedInteger(uint bitCount, uint bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | bitCount | The number of bits in the value. |
System.UInt32 | bitOffset | The offset (in bits) of the bitfield within the bit vector. |
Returns
Type | Description |
---|---|
System.Int32 | The value. |
GetUnsignedInteger(UInt32, UInt32)
Gets the value of an unsigned integer bitfield.
Declaration
public uint GetUnsignedInteger(uint bitCount, uint bitOffset)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | bitCount | The number of bits in the value. M. |
System.UInt32 | bitOffset | The offset (in bits) of the bitfield within the bit vector. |
Returns
Type | Description |
---|---|
System.UInt32 | The value. |