Interface INmeaAisMessageStreamProcessor
Receives AIS messages parsed from an NMEA file by NmeaStreamParser.
Namespace: Ais.Net
Assembly: Ais.Net.dll
Syntax
public interface INmeaAisMessageStreamProcessor
Remarks
In cases where AIS messages have been fragmented across multiple lines, they will be reassembled and passed to implementors of this interface as single messages.
Methods
| Improve this Doc View SourceOnCompleted()
Called when all lines have been processed.
Declaration
void OnCompleted()
OnError(ReadOnlySpan<Byte>, Exception, Int32)
Called when a line cannot be parsed, e.g. it does not contain a well-formed NMEA message.
Declaration
void OnError(in ReadOnlySpan<byte> line, Exception error, int lineNumber)
Parameters
Type | Name | Description |
---|---|---|
ReadOnlySpan<System.Byte> | line | The line that cannot be parsed. |
Exception | error | An exception describing the problem. |
System.Int32 | lineNumber | The 1-based line number on which the error was detected. |
OnNext(NmeaLineParser, ReadOnlySpan<Byte>, UInt32)
Called for each complete AIS message.
Declaration
void OnNext(in NmeaLineParser firstLine, in ReadOnlySpan<byte> asciiPayload, uint padding)
Parameters
Type | Name | Description |
---|---|---|
NmeaLineParser | firstLine | The parsed line. |
ReadOnlySpan<System.Byte> | asciiPayload | The full payload. |
System.UInt32 | padding | The number of bits of padding at the end of the payload. |
Remarks
Where the source message was not fragmented, the asciiPayload
will refer
directly to the original message's payload in situ. If the AIS message was split
across multiple NMEA sentences, the various sections of the payload will have been
copied into a reassembly buffer, so that it can be presented as a single contiguous
block of data.
Progress(Boolean, Int32, Int32, Int32, Int32, Int32, Int32)
Called regularly to provide progress reports, and always called at the end.
Declaration
void Progress(bool done, int totalNmeaLines, int totalAisMessages, int totalTicks, int nmeaLinesSinceLastUpdate, int aisMessagesSinceLastUpdate, int ticksSinceLastUpdate)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | done | True if all processing is complete. |
System.Int32 | totalNmeaLines | The number of NMEA lines processed. |
System.Int32 | totalAisMessages | The number of AIS messages processed. |
System.Int32 | totalTicks | The number of milliseconds of processing. |
System.Int32 | nmeaLinesSinceLastUpdate | The number of lines since the last progress notification. |
System.Int32 | aisMessagesSinceLastUpdate | The number of AIS messages since the last progress notification. |
System.Int32 | ticksSinceLastUpdate | The number of ticks since the last progress notification. |