2.0.1 • Published 17 days ago

js-aprs-is v2.0.1

Weekly downloads
4
License
ISC
Repository
github
Last release
17 days ago

js-aprs-is npm Build Status Coverage Status Codacy Badge Known Vulnerabilities

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.

USAGE

Demo

https://github.com/KD0NKS/aprs-is-demo

npm

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.

TypeScript

  • import import ISSocket from 'js-aprs-is';

Using this the easy way

let connection = new ISSocket("aprsserverurl", PORTNUMBER, "N0CALL", -1, FILTER);

connection.on('packet', (data: string) => {
    // ...
});

BYOB (Bring your own buffer)

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();
    }

    //...
}

KNOWN ISSUES

  • Timeout should be implemented.
    • Need to research timeout tollerance on APRS-IS servers. 30 seconds?
    • On timeout event, socket should automatically send login message.
    • Hook tests fail due to async issues.

TO CONSIDER

  • Allow connections to IS server to automatically reconnect on failure?
    • The original client specified number of retries at a half second interval.
    • Internal packet buffering to emit single packets?

SEE ALSO

ORIGINAL COPYRIGHT

  • Copyright (C) 2005-2012 Tapio Sokura
  • Copyright (C) 2007-2012 Heikki Hannikainen

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

UPGRADING 1.x.x to 2.x.x

ISSocket Constructor

The constructor paramaters have changed drastically. Please note the order has changed as well as what is required. - Callsign is no longer defaulted to discourage useage of erroneous callsigns. - appId is now required.

  • ISSocket.sendLine() is now deprecated.
    • Use sendLogin() and send() instead.
    • send() will still send server commands even if transmit is disabled.
2.0.1

17 days ago

2.0.0

22 days ago

1.2.0

12 months ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

2 years ago

1.1.0

2 years ago

1.1.0-alpha.1

2 years ago

1.1.0-alpha.0

2 years ago

1.0.6

2 years ago

1.0.5

3 years ago

1.0.5-beta

3 years ago

1.0.4

4 years ago

1.0.4-beta.15

4 years ago

1.0.4-beta.14

4 years ago

1.0.4-beta.12

4 years ago

1.0.4-beta.11

4 years ago

1.0.4-beta.10

4 years ago

1.0.4-beta.9

4 years ago

1.0.4-beta.8

4 years ago

1.0.4-beta.7

4 years ago

1.0.4-beta.6

4 years ago

1.0.4-beta.5

4 years ago

1.0.4-beta.4

4 years ago

1.0.4-beta.1

4 years ago

1.0.4-beta.3

4 years ago

1.0.4-beta.0

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago