AprsSharp.AprsIsClient is part of the AprsSharp Project.
AprsIsClient aims to be a simple library for interacting with the Automatic
Packet Reporting System-Internet Service.
APRS-IS uses TCP messages and specific encodings to communicate amateur radio packets. This library abstracts those aspects away.
Currently, only receiving packets is implemented. The only outgoing communication to the server is that required for authorization and configuration. Packets cannot be sent via APRS-IS at this time.
This package can be installed via nuget.org: AprsSharp.AprsIsClient on nuget.org.
A simple meethod is via the command line:
dotnet add package AprsSharp.AprsIsClientAprsIsClient uses an event driven framework. Major steps are to create a client, define callbacks, and then begin receiving. See the code snippet below for examples.
using AprsSharp.AprsIsClient;
// Create a client
using AprsIsClient aprsIs = new AprsIsClient();
// Print the sender and type of packet received.
aprsIs.ReceivedPacket += packet => {
Console.WriteLine(packet.Sender);
Console.WriteLine(packet.InfoField.Type);
};
// Optionally, you can print when the server connection changes state.
aprsIs.ChangedState += state =>
Console.WriteLine($"State: {state} on server {aprsIs.ConnectedServer}");
// If you'd rather read the TCP messages directly, you can subscribe to those events
aprsIs.ReceivedTcpMessage += message =>
Console.WriteLine($"New TCP message: {message}");
// And if you'd like to see error messages, you can subscribe to those
aprsIs.DecodeFailed += (ex, message) =>
Console.WriteLine($"Failed to decode message {message} with exception {ex}");
// Once you've configured your events, begin receiving!
// Assuming `callsign` and `password` are variables, this connects to
// a server on the main rotation and requests all packets of
// type == message (t/m). You can read more about filter commands here:
// https://www.aprs-is.net/javAPRSFilter.aspx
//
// The `await` here is optional and may not be desirable if you're expecting
// additional input. If you're writing a simple script, the await is helpful
// to ensure your application doesn't terminate. The await will not return
// until AprsIsClient is instructed to stop receiving.
await aprsIs.Receive(callsign, password, "rotate.aprs2.net", "t/m");For more information, you can visit:
- AprsSharp on GitHub
- APRS-IS documentation on aprs-is.net
- APRS documentation on aprs.org
Bugs, feedback, and feature requests can be filed via GitHub Issues on the AprsSharp repository.