APRS is a registered trademark Bob Bruninga, WB4APR.
This project will attempt to provide a node version of the perl-aprs-fap/HAM::APRS::FAP IS class/module. Over time, it is likely this will diverge from the original code due to platforms, but will attempt to keep usage straightforward and similar where applicable. The biggest difference will be the usage of a push rather than pull paradigm, which will also negate the need for some methods/functions.
https://github.com/KD0NKS/aprs-is-demo
npm install js-aprs-is --save
Extends NodeJS Socket, which means this is not guranteed to deliver one APRS packet per tcp packet. Buffering must be implemented when using.
let connection = new ISSocket("aprsserverurl", PORTNUMBER, "N0CALL", -1, FILTER);
connection.on('packet', (data: string) => {
// ...
});
let bufferedData = '';
let connection = new ISSocket("aprsserverurl", PORTNUMBER, "N0CALL", -1, FILTER);
// Probably not the best way, but good enough for now. Still consumes world feed on low end computer.
connection.on('data', (data: Buffer) => {
bufferedData += data.toString();
let msgs = bufferedData.split('\r\n');
if(this._bufferedData.endsWith('\r\n')) {
this._bufferedData = '';
msgs = msgs.filter(msg => msg.trim() != ''); // This is trimming out any empty messages
} else {
this._bufferedData = msgs.pop();
}
//...
}
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The constructor paramaters have changed drastically. Please note the order has changed as well as what is required.