KD0NKS / js-aprs-is

JavaScript implementation of the Perl-APRS-Fap/Ham::APRS::FAP IS class
MIT License
7 stars 0 forks source link

Transmit enabled flag. #186

Closed KD0NKS closed 5 months ago

KD0NKS commented 1 year ago

Would appreciate any feedback and discussion on this.

Should a isTransmitEnabled flag be added to ISSocket to prevent unintended sending of packets via the socket?

This would require a version bump to deprecate or remove usage of sendLine() and possibly userLogin in favor of sendLogin() and send().

KD0NKS commented 1 year ago

Currently, callsign, passcode, filter, appId are passed in the constructor and only used in the sendLogin. Would it be more appropriate to pass these as non-defaulted parameters to the function instead? This would be a big behavioral change from perl-aprs-fap.

connection.sendLogin("N0CALL", -1, "m/500", "my-aprs-app v100")
KD0NKS commented 1 year ago

Should send be responsible for building the packet header? Currently neither this library or perl-aprs-fap have this behavior. Ignoring my previous comment could also shorten and/or negate this.

connection.send("N0CALL", "T0CALL", ":Hello World")

Would result in the following packet being sent to the IS server:

N0CALL>T0CALL,TCIP*::Hello World\r\n
KD0NKS commented 5 months ago

Open to re-opening at a later time. However, further work and consideration, send still requires a packet be sent with a header already constructed as the send function is also used for server commands/filter commands. This was resolved by pull request #237.